From: Tim Chen <tim.c.chen@linux.intel.com>
To: Christoph Lameter <cl@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Tejun Heo <tj@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>,
Dave Hansen <dave.hansen@intel.com>,
Andi Kleen <ak@linux.intel.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH 1/2] Make the batch size of the percpu_counter configurable
Date: Tue, 30 Apr 2013 10:48:14 -0700 [thread overview]
Message-ID: <1367344094.27102.182.camel@schen9-DESK> (raw)
In-Reply-To: <0000013e5bfd1548-a6ef7962-7b00-495b-8e83-d7a08413e165-000000@email.amazonses.com>
On Tue, 2013-04-30 at 17:28 +0000, Christoph Lameter wrote:
> On Tue, 30 Apr 2013, Tim Chen wrote:
>
> > On Tue, 2013-04-30 at 13:32 +0000, Christoph Lameter wrote:
> > > On Mon, 29 Apr 2013, Tim Chen wrote:
> > >
> > > > diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
> > > > index d5dd465..5ca7df5 100644
> > > > --- a/include/linux/percpu_counter.h
> > > > +++ b/include/linux/percpu_counter.h
> > > > @@ -22,6 +22,7 @@ struct percpu_counter {
> > > > struct list_head list; /* All percpu_counters are on a list */
> > > > #endif
> > > > s32 __percpu *counters;
> > > > + int *batch ____cacheline_aligned_in_smp;
> > > > };
> > >
> > > What is this for and why does it have that alignmend?
> >
> > I was assuming that if batch is frequently referenced, it probably
> > should not share a cache line with the counters field.
>
> And why is it a pointer?
A pointer because the default percpu_counter_batch value could change
later when cpus come online after we initialize per cpu counter and
percpu_counter_batch will get computed again in percpu_counter_startup.
Making it a pointer will make it unnecessary to come back and change the
batch sizes if we use static batch value and default batch size.
>
> And the pointer is so frequently changed that it needs it own cache line?
>
On second thought, your're right. It is unnecessary for *batch to have
its own cache line as the counters pointer and head_list above it will
not change frequently. I'll remove the cache alignment.
Tim
--
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:[~2013-04-30 17:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 17:12 Tim Chen
2013-04-29 17:12 ` [PATCH 2/2] Make batch size for memory accounting configured according to size of memory Tim Chen
2013-05-01 5:09 ` Ric Mason
2013-05-01 16:07 ` Tim Chen
2013-04-30 13:32 ` [PATCH 1/2] Make the batch size of the percpu_counter configurable Christoph Lameter
2013-04-30 16:23 ` Tim Chen
2013-04-30 17:28 ` Christoph Lameter
2013-04-30 17:48 ` Tim Chen [this message]
2013-04-30 17:53 ` Christoph Lameter
2013-04-30 17:55 ` Tim Chen
2013-04-30 18:27 ` Christoph Lameter
2013-04-30 19:00 ` Tim Chen
2013-04-30 19:04 ` Tejun Heo
2013-04-30 20:50 ` Christoph Lameter
2013-04-30 17:34 ` Andi Kleen
2013-04-30 18:10 ` Eric Dumazet
2013-04-30 18:28 ` Tim Chen
2013-05-01 4:52 ` Simon Jeons
2013-05-01 15:53 ` Tim Chen
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=1367344094.27102.182.camel@schen9-DESK \
--to=tim.c.chen@linux.intel.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=dave.hansen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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