From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752360AbXDHBZR (ORCPT ); Sat, 7 Apr 2007 21:25:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932469AbXDHBZR (ORCPT ); Sat, 7 Apr 2007 21:25:17 -0400 Received: from smtp.osdl.org ([65.172.181.24]:37420 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbXDHBZP (ORCPT ); Sat, 7 Apr 2007 21:25:15 -0400 Date: Sat, 7 Apr 2007 18:25:06 -0700 From: Andrew Morton To: Christoph Lameter Cc: Hugh Dickins , Nick Piggin , dgc@sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] Optimize compound_head() by avoiding a shared page flag Message-Id: <20070407182506.4386dc13.akpm@linux-foundation.org> In-Reply-To: References: <20070405223651.21698.77505.sendpatchset@schroedinger.engr.sgi.com> <20070405223657.21698.32754.sendpatchset@schroedinger.engr.sgi.com> <20070406222336.4dcdd663.akpm@linux-foundation.org> <20070407155148.94da92e8.akpm@linux-foundation.org> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 7 Apr 2007 17:21:38 -0700 (PDT) Christoph Lameter wrote: > On Sat, 7 Apr 2007, Andrew Morton wrote: > > > Which is all a ton of fun, but this subversion of the architecture's > > freedom to use volatile, memory barriers etc is a worry. We do the same in > > page_alloc.c, of course... > > I just tried the approach that we discussed earlier and it was not > nice either. We've discussed at least three approaches, so we don't know to what you refer. > Lets just use a page flag please. Nope, try harder. PageCompound is an unlikely case. Back in the old days we would have done if (PageCompound(page)) goto out_of_line; back: do_stuff_with(page); return; out_of_line: if (PageTail(page)) { page = page_tail(page); goto back; } and nowadays we hope that gcc does the above for us. If it doesn't do it for us, perhaps it needs open-coded help. Because I don't expect there will be much efficiency difference between the above and the use of another page flag.