mm/page_alloc: simplify locking during free_unref_page_list
authorMel Gorman <mgorman@techsingularity.net>
Tue, 22 Nov 2022 13:12:29 +0000 (13:12 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 30 Nov 2022 23:59:01 +0000 (15:59 -0800)
commita4bafffb5dc5be6c7a3b77b2de0cbaf6776a3c8b
tree04cf1f17fdbbe496d109fbeb331f5a12ef88e17b
parent5749077415994eb02d660b2559b9d8278521e73d
mm/page_alloc: simplify locking during free_unref_page_list

While freeing a large list, the zone lock will be released and reacquired
to avoid long hold times since commit c24ad77d962c ("mm/page_alloc.c:
avoid excessive IRQ disabled times in free_unref_page_list()").  As
suggested by Vlastimil Babka, the lockrelease/reacquire logic can be
simplified by reusing the logic that acquires a different lock when
changing zones.

Link: https://lkml.kernel.org/r/20221122131229.5263-3-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c