Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761852Ab0GTWF6 (ORCPT ); Tue, 20 Jul 2010 18:05:58 -0400 Received: from f0.cmpxchg.org ([85.214.51.133]:60729 "EHLO cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761502Ab0GTWF5 (ORCPT ); Tue, 20 Jul 2010 18:05:57 -0400 Date: Wed, 21 Jul 2010 00:05:51 +0200 From: Johannes Weiner To: Mel Gorman Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Dave Chinner , Chris Mason , Nick Piggin , Rik van Riel , Wu Fengguang , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Andrew Morton , Andrea Arcangeli Subject: Re: [PATCH 8/8] vmscan: Kick flusher threads to clean pages when reclaim is encountering dirty pages Message-ID: <20100720220550.GF16031@cmpxchg.org> References: <1279545090-19169-1-git-send-email-mel@csn.ul.ie> <1279545090-19169-9-git-send-email-mel@csn.ul.ie> <20100719142349.GE12510@infradead.org> <20100719143737.GQ13117@csn.ul.ie> <20100719224838.GC16031@cmpxchg.org> <20100720141049.GV13117@csn.ul.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100720141049.GV13117@csn.ul.ie> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1558 Lines: 35 On Tue, Jul 20, 2010 at 03:10:49PM +0100, Mel Gorman wrote: > On Tue, Jul 20, 2010 at 12:48:39AM +0200, Johannes Weiner wrote: > > On Mon, Jul 19, 2010 at 03:37:37PM +0100, Mel Gorman wrote: > > > although the latter can get disabled too. Deleting the magic is an > > > option which would trade IO efficiency for power efficiency but my > > > current thinking is laptop mode preferred reduced power. > > > > Maybe couple your wakeup with sc->may_writepage? It is usually false > > for laptop_mode but direct reclaimers enable it at one point in > > do_try_to_free_pages() when it scanned more than 150% of the reclaim > > target, so you could use existing disk spin-up points instead of > > introducing new ones or disabling the heuristics in laptop mode. > > > > How about the following? > > if (nr_dirty && sc->may_writepage) > wakeup_flusher_threads(laptop_mode ? 0 : > nr_dirty + nr_dirty / 2); > > > 1. Wakup flusher threads if dirty pages are encountered > 2. For direct reclaim, only wake them up if may_writepage is set > indicating that the system is ready to spin up disks and start > reclaiming > 3. In laptop_mode, flush everything to reduce future spin-ups Sounds like the sanest approach to me. Thanks. Hannes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/