• Alex Shi's avatar
    mm/mlock: remove lru_lock on TestClearPageMlocked · 3db19aa3
    Alex Shi authored
    In the func munlock_vma_page, comments mentained lru_lock needed for
    serialization with split_huge_pages.  But the page must be PageLocked as
    well as pages in split_huge_page series funcs.  Thus the PageLocked is
    enough to serialize both funcs.
    
    Further more, Hugh Dickins pointed: before splitting in
    split_huge_page_to_list, the page was unmap_page() to remove pmd/ptes
    which protect the page from munlock.  Thus, no needs to guard
    __split_huge_page_tail for mlock clean, just keep the lru_lock there for
    isolation purpose.
    
    LKP found a preempt issue on __mod_zone_page_state which need change to
    mod_zone_page_state.  Thanks!
    
    Link: https://lkml.kernel.org/r/1604566549-62481-13-git-send-email-alex.shi@linux.alibaba.comSigned-off-by: default avatarAlex Shi <alex.shi@linux.alibaba.com>
    Acked-by: default avatarHugh Dickins <hughd@google.com>
    Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Cc: "Chen, Rong A" <rong.a.chen@intel.com>
    Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
    Cc: "Huang, Ying" <ying.huang@intel.com>
    Cc: Jann Horn <jannh@google.com>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Kirill A. Shutemov <kirill@shutemov.name>
    Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mika Penttilä <mika.penttila@nextfour.com>
    Cc: Minchan Kim <minchan@kernel.org>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
    Cc: Wei Yang <richard.weiyang@gmail.com>
    Cc: Yang Shi <yang.shi@linux.alibaba.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3db19aa3
mlock.c 22.4 KB