Randy Dunlap <[email protected]> writes: > On 04/16/18 19:02, Huang, Ying wrote: >> From: Huang Ying <[email protected]> >> >> 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" <[email protected]> >> Cc: "Kirill A. Shutemov" <[email protected]> >> Cc: Andrea Arcangeli <[email protected]> >> Cc: Michal Hocko <[email protected]> >> Cc: Johannes Weiner <[email protected]> >> Cc: Shaohua Li <[email protected]> >> Cc: Hugh Dickins <[email protected]> >> Cc: Minchan Kim <[email protected]> >> Cc: Rik van Riel <[email protected]> >> Cc: Dave Hansen <[email protected]> >> Cc: Naoya Horiguchi <[email protected]> >> Cc: Zi Yan <[email protected]> >> --- >> include/linux/swap.h | 6 +++++ >> mm/huge_memory.c | 54 ++++++++++++++++++++++++++++++++++++++++---- >> mm/swapfile.c | 28 +++++++++++++++++++++++ >> 3 files changed, 83 insertions(+), 5 deletions(-)

