[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210922141301.GZ3959@techsingularity.net>
Date: Wed, 22 Sep 2021 15:13:01 +0100
From: Mel Gorman <mgorman@...hsingularity.net>
To: Hillf Danton <hdanton@...a.com>
Cc: Linux-MM <linux-mm@...ck.org>, NeilBrown <neilb@...e.de>,
Dave Chinner <david@...morbit.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/5] mm/vmscan: Throttle reclaim until some writeback
completes if congested
On Wed, Sep 22, 2021 at 08:16:20PM +0800, Hillf Danton wrote:
> On Mon, 20 Sep 2021 09:54:32 +0100 Mel Gorman wrote:
> > +static void
> > +reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason,
> > + long timeout)
> > +{
> > + wait_queue_head_t *wqh =3D &pgdat->reclaim_wait;
> > + unsigned long start =3D jiffies;
> > + long ret;
> > + DEFINE_WAIT(wait);
> > +
> > + atomic_inc(&pgdat->nr_reclaim_throttled);
> > + WRITE_ONCE(pgdat->nr_reclaim_start,
> > + node_page_state(pgdat, NR_THROTTLED_WRITTEN));
>
> Missing wakeup could happen if the current sleeper overwrites
> pgdat->nr_reclaim_start set by the existing sleeper.
>
> if (1 == atomic_inc_and_return(&pgdat->nr_reclaim_throttled))
> WRITE_ONCE(pgdat->nr_reclaim_start,
> node_page_state(pgdat, NR_THROTTLED_WRITTEN));
>
Good spot, will fix.
--
Mel Gorman
SUSE Labs
Powered by blists - more mailing lists