mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hugh@veritas.com>, Nick Piggin <npiggin@suse.de>,
	dgc@sgi.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Optimize compound_head() by avoiding a shared page flag
Date: Mon, 9 Apr 2007 11:49:11 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0704091146320.8783@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070409114545.3858d8f1.akpm@linux-foundation.org>

On Mon, 9 Apr 2007, Andrew Morton wrote:

> > The patch adds PageTail(page) and PageHead(page) to check if a page is the
> > head or the tail of a compound page. This is done by masking the two
> > bits describing the state of a compound page and then comparing them. So 
> > one comparision and a branch instead of two bit checks and two branches.
> > 
> 
> OK.  I'm still a bit concerned about bypassing the bitops synchronisation:
> barriers, volatile, etc.  We had lengthy ruminations on that a few years
> ago, I think when working on free_pages_check().

Those are important for bits that are changing while a page is in use. 
These are constant.

> > +#define __SetPageTail(page)	page->flags |= PG_head_tail_mask
> > +#define __ClearPageTail(page)	page->flags ~= PG_head_tail_mask
> 
> hm.  The lack of parenthesisation here _might_ be OK, but I haven't
> thought it through.

This is a command and not an expression. Ok will inline.
 
> And I'd prefer not to have to, because I know that the do { } while (0)
> thing works.  As do static inline functions.
> 
> > +#define PageHead(page)	((page->flags & PG_head_tail_mask) \
> > +				== (1L << PG_compound))
> > +#define __SetPageHead(page)	__SetCompoundPage(page)
> > +#define __ClearPageHead(page)	__ClearCompoundPage(page)
> 
> You meant __SetPageCompound and __ClearPageCompound.

Right.


  reply	other threads:[~2007-04-09 18:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05 22:36 [PATCH 1/2] Make page->private usable in compound pages V1 Christoph Lameter
2007-04-05 22:36 ` [PATCH 2/2] Optimize compound_head() by avoiding a shared page flag Christoph Lameter
2007-04-07  5:23   ` Andrew Morton
2007-04-07 22:16     ` Christoph Lameter
2007-04-07 22:51       ` Andrew Morton
2007-04-08  0:21         ` Christoph Lameter
2007-04-08  1:25           ` Andrew Morton
2007-04-08  1:32             ` Christoph Lameter
2007-04-08  1:48               ` Andrew Morton
2007-04-09 17:22                 ` Christoph Lameter
2007-04-09 18:09                 ` Christoph Lameter
2007-04-09 18:45                   ` Andrew Morton
2007-04-09 18:49                     ` Christoph Lameter [this message]
2007-04-09 22:05                     ` Christoph Lameter
2007-04-05 23:43 ` [PATCH 1/2] Make page->private usable in compound pages V1 Andrew Morton
2007-04-06 17:01   ` Christoph Lameter
2007-04-06 20:04     ` Andrew Morton
2007-04-06 20:28       ` Christoph Lameter
2007-04-06 19:46   ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0704091146320.8783@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=dgc@sgi.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®