lkml.org 
[lkml]   [2012]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 09/11] thp: lazy huge zero page allocation
On Thu, 15 Nov 2012 11:41:55 +0200
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:

> On Wed, Nov 14, 2012 at 03:37:09PM -0800, David Rientjes wrote:
> > On Wed, 7 Nov 2012, Kirill A. Shutemov wrote:
> >
> > > From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> > >
> > > Instead of allocating huge zero page on hugepage_init() we can postpone it
> > > until first huge zero page map. It saves memory if THP is not in use.
> > >
> >
> > Is it worth the branch on every non-write pagefault after that? The
> > unlikely() is not going to help on x86. If thp is enabled in your
> > .config (which isn't the default), then I think it's better to just
> > allocate the zero huge page once and avoid any branches after that to
> > lazily allocate it. (Or do it only when thp is set to "madvise" or
> > "always" if booting with transparent_hugepage=never.)
>
> I can rewrite the check to static_key if you want. Would it be better?

The new test-n-branch only happens on the first read fault against a
thp huge page, yes? In which case it's a quite infrequent event and I
suspect this isn't worth bothering about.




\
 
 \ /
  Last update: 2012-12-12 22:41    [W:0.083 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site