From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Michel Lespinasse <walken@google.com>,
Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
aswin@hp.com, scott.norton@hp.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm: per-thread vma caching
Date: Tue, 25 Feb 2014 20:46:49 +0100 [thread overview]
Message-ID: <20140225194649.GV6835@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <1393353454.2577.42.camel@buesod1.americas.hpqcorp.net>
On Tue, Feb 25, 2014 at 10:37:34AM -0800, Davidlohr Bueso wrote:
> On Tue, 2014-02-25 at 19:35 +0100, Peter Zijlstra wrote:
> > On Tue, Feb 25, 2014 at 10:16:46AM -0800, Davidlohr Bueso wrote:
> > > +void vmacache_update(struct mm_struct *mm, unsigned long addr,
> > > + struct vm_area_struct *newvma)
> > > +{
> > > + /*
> > > + * Hash based on the page number. Provides a good
> > > + * hit rate for workloads with good locality and
> > > + * those with random accesses as well.
> > > + */
> > > + int idx = (addr >> PAGE_SHIFT) & 3;
> >
> > % VMACACHE_SIZE
> >
> > perhaps? GCC should turn that into a mask for all sensible values I
> > would think.
> >
> > Barring that I think something like:
> >
> > #define VMACACHE_BITS 2
> > #define VMACACHE_SIZE (1U << VMACACHE_BITS)
> > #define VMACACHE_MASK (VMACACHE_SIZE - 1)
>
> Hmm all that seems like an overkill.
If GCC does the right thing with % VMACACHE_SIZE it gets rid of an ugly
constant. But the 3 VMACACHE_* things are 'better' in that its
impossible to set VMACACHE_SIZE to silly values.
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-02-25 19:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-25 18:16 Davidlohr Bueso
2014-02-25 18:24 ` Rik van Riel
2014-02-25 18:36 ` Davidlohr Bueso
2014-02-25 18:35 ` Peter Zijlstra
2014-02-25 18:37 ` Davidlohr Bueso
2014-02-25 19:46 ` Peter Zijlstra [this message]
2014-02-25 18:37 ` Linus Torvalds
2014-02-25 18:45 ` Linus Torvalds
2014-02-25 19:04 ` Davidlohr Bueso
2014-02-25 19:30 ` Davidlohr Bueso
2014-02-25 19:31 ` Linus Torvalds
2014-02-26 2:04 ` Michel Lespinasse
2014-02-26 4:04 ` Davidlohr Bueso
2014-02-26 7:52 ` Michel Lespinasse
2014-02-26 8:50 ` Peter Zijlstra
2014-02-26 8:55 ` Peter Zijlstra
2014-02-26 11:26 ` Mel Gorman
2014-02-26 19:11 ` Davidlohr Bueso
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=20140225194649.GV6835@laptop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=aswin@hp.com \
--cc=davidlohr@hp.com \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=riel@redhat.com \
--cc=scott.norton@hp.com \
--cc=torvalds@linux-foundation.org \
--cc=walken@google.com \
/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