From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754136Ab1GRRUf (ORCPT ); Mon, 18 Jul 2011 13:20:35 -0400 Received: from smtp107.prem.mail.ac4.yahoo.com ([76.13.13.46]:23018 "HELO smtp107.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753787Ab1GRRUe (ORCPT ); Mon, 18 Jul 2011 13:20:34 -0400 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: pZL5RGYVM1m6kWZ1xWXrAsMvUY35oDjUHxuqkpgv_TSN1Pp a4ZgzjrmAvCjjkUxpu_u.lnvG319VGDMB9UykkSSNWqKVnLu1eDAMOIMhpXH ZIg8YIyeTI2bVxiQZV0h0T4XVbQvvLPeQKk9q6A4D6w0mxlbslX6xqV_ch7D 5deo01altrpSaq0t7clnwI4fKyIlbRU1yIEbBMPkFHdgJsLQWA1aMO247sUL Ulu9FOOks4nQO4c6xh0pr0FDQIHz3PnjF7wJ6KggyAF1GcFo.pWyPEamjl3v NwG_OvWbn9Ca7UWlT074D1kIhAb.xLacDcEwpUYBdBLN9KHct X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- Date: Mon, 18 Jul 2011 12:20:11 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: Mel Gorman cc: Andrew Morton , Minchan Kim , KOSAKI Motohiro , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mm: page allocator: Initialise ZLC for first zone eligible for zone_reclaim In-Reply-To: <20110718160552.GB5349@suse.de> Message-ID: References: <1310742540-22780-1-git-send-email-mgorman@suse.de> <1310742540-22780-2-git-send-email-mgorman@suse.de> <20110718160552.GB5349@suse.de> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jul 2011, Mel Gorman wrote: > On Mon, Jul 18, 2011 at 09:56:31AM -0500, Christoph Lameter wrote: > > On Fri, 15 Jul 2011, Mel Gorman wrote: > > > > > Currently the zonelist cache is setup only after the first zone has > > > been considered and zone_reclaim() has been called. The objective was > > > to avoid a costly setup but zone_reclaim is itself quite expensive. If > > > it is failing regularly such as the first eligible zone having mostly > > > mapped pages, the cost in scanning and allocation stalls is far higher > > > than the ZLC initialisation step. > > > > Would it not be easier to set zlc_active and allowednodes based on the > > zone having an active ZLC at the start of get_pages()? > > > > What do you mean by a zones active ZLC? zonelists are on a per-node, > not a per-zone basis (see node_zonelist) so a zone doesn't have an > active ZLC as such. If the zlc_active is set at the beginning of Look at get_page_from_freelist(): It sets zlc_active = 0 even through the zonelist under consideration may have a ZLC. zlc_active = 0 can also mean that the function has not bothered to look for the zlc information of the current zonelist. > get_page_from_freelist(), it implies that we are calling zlc_setup() > even when the watermarks are met which is unnecessary. Ok then that decision to not call zlc_setup() for performance reasons is what created the problem that you are trying to solve. In case that the first zones watermarks are okay we can avoid calling zlc_setup(). What we do now have is checking for zlc_active in the loop just so that the first time around we do not call zlc_setup(). We may be able to simplify the function by: 1. Checking for the special case that the first zone is ok and that we do not want to call zlc_setup before we get to the loop. 2. Do the zlc_setup() before the loop. 3. Remove the zlc_setup() code as you did from the loop as well as the checks for zlc_active. zlc_active becomes not necessary since a zlc is always available when we go through the loop.