From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763357AbZD1RYe (ORCPT ); Tue, 28 Apr 2009 13:24:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761224AbZD1RYX (ORCPT ); Tue, 28 Apr 2009 13:24:23 -0400 Received: from extu-mxob-1.symantec.com ([216.10.194.28]:41448 "EHLO extu-mxob-1.symantec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760775AbZD1RYV (ORCPT ); Tue, 28 Apr 2009 13:24:21 -0400 Date: Tue, 28 Apr 2009 18:15:30 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@blonde.anvils To: Mel Gorman cc: Christoph Lameter , Andrew Morton , Linux Memory Management List , KOSAKI Motohiro , Nick Piggin , Linux Kernel Mailing List , Lin Ming , Peter Zijlstra , Pekka Enberg , "Zhang, Yanmin" Subject: Re: [PATCH] Properly account for freed pages in free_pages_bulk() and when allocating high-order pages in buffered_rmqueue() In-Reply-To: <20090428165129.GA18893@csn.ul.ie> Message-ID: References: <1240408407-21848-1-git-send-email-mel@csn.ul.ie> <1240819119.2567.884.camel@ymzhang> <20090427143845.GC912@csn.ul.ie> <1240883957.2567.886.camel@ymzhang> <20090428103159.GB23540@csn.ul.ie> <20090428165129.GA18893@csn.ul.ie> 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 Tue, 28 Apr 2009, Mel Gorman wrote: > On Tue, Apr 28, 2009 at 12:37:22PM -0400, Christoph Lameter wrote: > > On Tue, 28 Apr 2009, Mel Gorman wrote: > > > > > @@ -1151,6 +1151,7 @@ again: > > > } else { > > > spin_lock_irqsave(&zone->lock, flags); > > > page = __rmqueue(zone, order, migratetype); > > > + __mod_zone_page_state(zone, NR_FREE_PAGES, -(1UL << order)); > > > spin_unlock(&zone->lock); > > > if (!page) > > > goto failed; > > > > __mod_zone_page_state takes an signed integer argument. Not sure what is > > won by the UL suffix here. > > > > Matches other call sites such as in __offline_isolated_pages(), habit when > using shifts like this and matches other locations, paranoia, doesn't hurt. Well, not a big deal, but I'd say that it does hurt: by wasting people's time (mine!), wondering what that "UL" is for - I'd have had to ask, if Christoph hadn't cleared this up first (thank you). And elsewhere, you're using an int << order to update NR_FREE_PAGES, so I don't see the consistency argument. Hugh From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with ESMTP id C4F7A6B003D for ; Tue, 28 Apr 2009 13:22:01 -0400 (EDT) Date: Tue, 28 Apr 2009 18:15:30 +0100 (BST) From: Hugh Dickins Subject: Re: [PATCH] Properly account for freed pages in free_pages_bulk() and when allocating high-order pages in buffered_rmqueue() In-Reply-To: <20090428165129.GA18893@csn.ul.ie> Message-ID: References: <1240408407-21848-1-git-send-email-mel@csn.ul.ie> <1240819119.2567.884.camel@ymzhang> <20090427143845.GC912@csn.ul.ie> <1240883957.2567.886.camel@ymzhang> <20090428103159.GB23540@csn.ul.ie> <20090428165129.GA18893@csn.ul.ie> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Mel Gorman Cc: Christoph Lameter , Andrew Morton , Linux Memory Management List , KOSAKI Motohiro , Nick Piggin , Linux Kernel Mailing List , Lin Ming , Peter Zijlstra , Pekka Enberg , "Zhang, Yanmin" List-ID: On Tue, 28 Apr 2009, Mel Gorman wrote: > On Tue, Apr 28, 2009 at 12:37:22PM -0400, Christoph Lameter wrote: > > On Tue, 28 Apr 2009, Mel Gorman wrote: > > > > > @@ -1151,6 +1151,7 @@ again: > > > } else { > > > spin_lock_irqsave(&zone->lock, flags); > > > page = __rmqueue(zone, order, migratetype); > > > + __mod_zone_page_state(zone, NR_FREE_PAGES, -(1UL << order)); > > > spin_unlock(&zone->lock); > > > if (!page) > > > goto failed; > > > > __mod_zone_page_state takes an signed integer argument. Not sure what is > > won by the UL suffix here. > > > > Matches other call sites such as in __offline_isolated_pages(), habit when > using shifts like this and matches other locations, paranoia, doesn't hurt. Well, not a big deal, but I'd say that it does hurt: by wasting people's time (mine!), wondering what that "UL" is for - I'd have had to ask, if Christoph hadn't cleared this up first (thank you). And elsewhere, you're using an int << order to update NR_FREE_PAGES, so I don't see the consistency argument. Hugh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org