From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753851AbcFPJRF (ORCPT ); Thu, 16 Jun 2016 05:17:05 -0400 Received: from outbound-smtp06.blacknight.com ([81.17.249.39]:55303 "EHLO outbound-smtp06.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750902AbcFPJQ6 (ORCPT ); Thu, 16 Jun 2016 05:16:58 -0400 Date: Thu, 16 Jun 2016 10:16:54 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , Linux-MM , Rik van Riel , Johannes Weiner , LKML Subject: Re: [PATCH 08/27] mm, vmscan: Simplify the logic deciding whether kswapd sleeps Message-ID: <20160616091654.GG1868@techsingularity.net> References: <1465495483-11855-1-git-send-email-mgorman@techsingularity.net> <1465495483-11855-9-git-send-email-mgorman@techsingularity.net> <6b6b9f95-869a-a9f2-c5cf-f0a3e4d6bd6a@suse.cz> <20160616083033.GF1868@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20160616083033.GF1868@techsingularity.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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