[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160616091654.GG1868@techsingularity.net>
Date: Thu, 16 Jun 2016 10:16:54 +0100
From: Mel Gorman <mgorman@...hsingularity.net>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linux-MM <linux-mm@...ck.org>, Rik van Riel <riel@...riel.com>,
Johannes Weiner <hannes@...xchg.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 08/27] mm, vmscan: Simplify the logic deciding whether
kswapd sleeps
On Thu, Jun 16, 2016 at 09:30:33AM +0100, Mel Gorman wrote:
> > >@@ -2727,7 +2727,7 @@ static bool pfmemalloc_watermark_ok(pg_data_t *pgdat)
> > >
> > > /* kswapd must be awake if processes are being throttled */
> > > if (!wmark_ok && waitqueue_active(&pgdat->kswapd_wait)) {
> > >- pgdat->classzone_idx = min(pgdat->classzone_idx,
> > >+ pgdat->kswapd_classzone_idx = min(pgdat->kswapd_classzone_idx,
> > > (enum zone_type)ZONE_NORMAL);
> > > wake_up_interruptible(&pgdat->kswapd_wait);
> > > }
> > >@@ -3211,6 +3211,12 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order,
> > >
> > > prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
> > >
> > >+ /* If kswapd has not been woken recently, then full sleep */
> > >+ if (classzone_idx == -1) {
> > >+ classzone_idx = balanced_classzone_idx = MAX_NR_ZONES - 1;
> > >+ goto full_sleep;
> >
> > This will skip the wakeup_kcompactd() part.
> >
>
> I wrestled with this one. I decided to leave it alone on the grounds
> that if kswapd has not been woken recently then compaction efforts also
> have not failed and kcompactd is not required.
>
And I was wrong. There needs to be a call to wakeup_kcompactd there to
cover the case where there was a single high-order allocation request
that failed and woke kswapd.
--
Mel Gorman
SUSE Labs
Powered by blists - more mailing lists