From: Andrew Morton Subject: Re: [PATCH 5/6] mm: page_alloc: Reduce cost of dirty zone balancing Date: Wed, 25 Jun 2014 16:35:28 -0700 Message-ID: <20140625163528.11368b86ef7d0a38cf9d1255@linux-foundation.org> References: <1403683129-10814-1-git-send-email-mgorman@suse.de> <1403683129-10814-6-git-send-email-mgorman@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Linux Kernel , Linux-MM , Linux-FSDevel , Johannes Weiner , Jens Axboe , Jeff Moyer , Dave Chinner To: Mel Gorman Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:49311 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbaFYXfa (ORCPT ); Wed, 25 Jun 2014 19:35:30 -0400 In-Reply-To: <1403683129-10814-6-git-send-email-mgorman@suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 25 Jun 2014 08:58:48 +0100 Mel Gorman wrote: > @@ -325,7 +321,14 @@ static unsigned long zone_dirty_limit(struct zone *zone) > */ > bool zone_dirty_ok(struct zone *zone) > { > - unsigned long limit = zone_dirty_limit(zone); > + unsigned long limit = zone->dirty_limit_cached; > + struct task_struct *tsk = current; > + > + if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) { > + limit = zone_dirty_limit(zone); > + zone->dirty_limit_cached = limit; > + limit += limit / 4; > + } Could we get a comment in here explaining what we're doing and why PF_LESS_THROTTLE and rt_task control whether we do it?