Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760104Ab3CHApm (ORCPT ); Thu, 7 Mar 2013 19:45:42 -0500 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:62771 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759272Ab3CHApk (ORCPT ); Thu, 7 Mar 2013 19:45:40 -0500 X-AuditID: 9c93016f-b7b46ae000000e4b-26-513934b14d6b Date: Fri, 8 Mar 2013 09:45:50 +0900 From: Joonsoo Kim To: Hugh Dickins Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: page_alloc: remove branch operation in free_pages_prepare() Message-ID: <20130308004550.GA19010@lge.com> References: <1362644480-18381-1-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2158 Lines: 59 Hello, Hugh. On Thu, Mar 07, 2013 at 10:54:15AM -0800, Hugh Dickins wrote: > On Thu, 7 Mar 2013, Joonsoo Kim wrote: > > > When we found that the flag has a bit of PAGE_FLAGS_CHECK_AT_PREP, > > we reset the flag. If we always reset the flag, we can reduce one > > branch operation. So remove it. > > > > Cc: Hugh Dickins > > Signed-off-by: Joonsoo Kim > > I don't object to this patch. But certainly I would have written it > that way in order not to dirty a cacheline unnecessarily. It may be > obvious to you that the cacheline in question is almost always already > dirty, and the branch almost always more expensive. But I'll leave that > to you, and to those who know more about these subtle costs than I do. Yes. I already think about that. I thought that even if a cacheline is not dirty at this time, we always touch the 'struct page' in set_freepage_migratetype() a little later, so dirtying is not the problem. But, now, I re-think this and decide to drop this patch. The reason is that 'struct page' of 'compound pages' may not be dirty at this time and will not be dirty at later time. So this patch is bad idea. Is there any comments? Thanks. > Hugh > > > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 8fcced7..778f2a9 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -614,8 +614,7 @@ static inline int free_pages_check(struct page *page) > > return 1; > > } > > page_nid_reset_last(page); > > - if (page->flags & PAGE_FLAGS_CHECK_AT_PREP) > > - page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP; > > + page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP; > > return 0; > > } > > > > -- > 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 -- 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/