Randy Dunlap <rdun...@infradead.org> writes:

> On 04/16/18 19:02, Huang, Ying wrote:
>> From: Huang Ying <ying.hu...@intel.com>
>> 
>> A huge PMD need to be split when zap a part of the PMD mapping etc.
>> If the PMD mapping is a swap mapping, we need to split it too.  This
>> patch implemented the support for this.  This is similar as splitting
>> the PMD page mapping, except we need to decrease the PMD swap mapping
>> count for the huge swap cluster too.  If the PMD swap mapping count
>> becomes 0, the huge swap cluster will be split.
>> 
>> Notice: is_huge_zero_pmd() and pmd_page() doesn't work well with swap
>> PMD, so pmd_present() check is called before them.
>
> FWIW, I would prefer to see that comment in the source code, not just
> in the commit description.

Sure.  I will add comment in source code too.

Best Regards,
Huang, Ying

>> 
>> Signed-off-by: "Huang, Ying" <ying.hu...@intel.com>
>> Cc: "Kirill A. Shutemov" <kirill.shute...@linux.intel.com>
>> Cc: Andrea Arcangeli <aarca...@redhat.com>
>> Cc: Michal Hocko <mho...@suse.com>
>> Cc: Johannes Weiner <han...@cmpxchg.org>
>> Cc: Shaohua Li <s...@kernel.org>
>> Cc: Hugh Dickins <hu...@google.com>
>> Cc: Minchan Kim <minc...@kernel.org>
>> Cc: Rik van Riel <r...@redhat.com>
>> Cc: Dave Hansen <dave.han...@linux.intel.com>
>> Cc: Naoya Horiguchi <n-horigu...@ah.jp.nec.com>
>> Cc: Zi Yan <zi....@cs.rutgers.edu>
>> ---
>>  include/linux/swap.h |  6 +++++
>>  mm/huge_memory.c     | 54 ++++++++++++++++++++++++++++++++++++++++----
>>  mm/swapfile.c        | 28 +++++++++++++++++++++++
>>  3 files changed, 83 insertions(+), 5 deletions(-)

Reply via email to