lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 6 Apr 2007 22:23:36 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Christoph Lameter <clameter@....com>
Cc:	Hugh Dickins <hugh@...itas.com>, Nick Piggin <npiggin@...e.de>,
	dgc@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] Optimize compound_head() by avoiding a shared page
 flag

On Thu,  5 Apr 2007 15:36:57 -0700 (PDT) Christoph Lameter <clameter@....com> wrote:

> Unalias PG_tail for performance reasons
> 
> If PG_tail is an alias then we need to check PageCompound before PageTail.
> This is particularly bad because the slab and others have to use these tests
> in performance critical paths. 
> 
> This patch uses one of the freed up software suspend flags that is defined
> next to PG_compound.

I get a reject from this because it is dependent upon later patches.  As
the Official Protector Of Page Flags, I'm going to drop it.

Did you investigate

static inline int page_tail(struct page *page)
{
	return ((page->flags & (PG_compound|PG_tail)) == (PG_compound|PG_tail));
}

and

static inline int page_tail(struct page *page)
{
	return unlikely(PageCompound(page)) && unlikely(PageTail(page));
}

?

In the latter case we _should_ have a not-taken branch to not-inline code. 
If the compiler doesn't do that, we can make the PageTail() test an
out-of-line function.  Or make the whole thing an uninlined function.

More work needed, please.  I don't expect that a not-taken branch to
not-inline code is worth a new page flag.  Especially as it does not
actually reduce the number of branch decisions in the common case.

(I'm assuming in all of this that !PageCompound() is the very common case
with slub.  If that is not true, we need to talk).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ