[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 9 Sep 2020 02:01:18 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Alex Shi <alex.shi@...ux.alibaba.com>
Cc: akpm@...ux-foundation.org, mgorman@...hsingularity.net,
tj@...nel.org, hughd@...gle.com, khlebnikov@...dex-team.ru,
daniel.m.jordan@...cle.com, hannes@...xchg.org, lkp@...el.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, shakeelb@...gle.com,
iamjoonsoo.kim@....com, richard.weiyang@...il.com,
kirill@...temov.name, alexander.duyck@...il.com,
rong.a.chen@...el.com, mhocko@...e.com, vdavydov.dev@...il.com,
shy828301@...il.com,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>
Subject: Re: [PATCH v18 31/32] mm: Add explicit page decrement in exception
path for isolate_lru_pages
On Mon, Aug 24, 2020 at 08:55:04PM +0800, Alex Shi wrote:
> +++ b/mm/vmscan.c
> @@ -1688,10 +1688,13 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
>
> if (!TestClearPageLRU(page)) {
> /*
> - * This page may in other isolation path,
> - * but we still hold lru_lock.
> + * This page is being isolated in another
> + * thread, but we still hold lru_lock. The
> + * other thread must be holding a reference
> + * to the page so this should never hit a
> + * reference count of 0.
> */
> - put_page(page);
> + WARN_ON(put_page_testzero(page));
> goto busy;
I read Hugh's review and that led me to take a look at this. We don't
do it like this. Use the same pattern as elsewhere in mm:
page_ref_sub(page, nr);
VM_BUG_ON_PAGE(page_count(page) <= 0, page);
Powered by blists - more mailing lists