From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: paulmck@linux.vnet.ibm.com, Andrew Morton <akpm@osdl.org>,
Dipankar Sarma <dipankar@in.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RCU] adds a prefetch() in rcu_do_batch()
Date: Thu, 30 Nov 2006 09:15:33 -0800 [thread overview]
Message-ID: <20061130171533.GB1869@us.ibm.com> (raw)
In-Reply-To: <200611300955.52293.dada1@cosmosbay.com>
On Thu, Nov 30, 2006 at 09:55:52AM +0100, Eric Dumazet wrote:
> On Thursday 30 November 2006 02:25, Paul E. McKenney wrote:
> > On Wed, Nov 22, 2006 at 04:02:29PM +0100, Eric Dumazet wrote:
> > > On some workloads, (for example when lot of close() syscalls are done),
> > > RCU qlen can be quite large, and RCU heads are no longer in cpu cache
> > > when rcu_do_batch() is called.
> > >
> > > This patches adds a prefetch() in rcu_do_batch() to give CPU a hint to
> > > bring back cache lines containing 'struct rcu_head's.
> > >
> > > Most list manipulations macros include prefetch(), but not open coded
> > > ones (at least with current C compilers :) )
> > >
> > > I got a nice speedup on a trivial benchmark (3.48 us per iteration
> > > instead of 3.95 us on a 1.6 GHz Pentium-M)
> > > while (1) { pipe(p); close(fd[0]); close(fd[1]);}
> >
> > Interesting! How much of the speedup was due to the prefetch() and how
> > much to removing the extra store to rdp->donelist?
>
> I only benchmarked the prefetch() case.
>
> Then, when cooking the patch I found I could do the rdp->donelist affectation
> after the loop. I am not sure it's worth to do another benchmark for this
> trivial optimization (Please dont tell me its not a valid one :) )
It would be a good idea to check it out. Modern CPUs can be a bit
on the tricky side. I have seen cases where removing instructions
slowed things down. And it can't be -that- hard to run the other
two cases!
Thanx, Paul
next prev parent reply other threads:[~2006-11-30 17:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-21 20:33 [PATCH] snd-hda-intel: fix insufficient memory wbrana
2006-11-22 6:46 ` Andrew Morton
2006-11-22 15:02 ` [RCU] adds a prefetch() in rcu_do_batch() Eric Dumazet
2006-11-22 17:48 ` [PATCH] dont insert pipe dentries into dentry_hashtable Eric Dumazet
2006-11-22 21:36 ` Andrew Morton
2006-11-22 21:40 ` Al Viro
2006-11-23 4:12 ` David Miller
2006-11-30 1:25 ` [RCU] adds a prefetch() in rcu_do_batch() Paul E. McKenney
2006-11-30 8:55 ` Eric Dumazet
2006-11-30 17:15 ` Paul E. McKenney [this message]
2006-11-22 17:19 ` [PATCH] snd-hda-intel: fix insufficient memory wbrana
2006-11-22 20:04 ` Andrew Morton
2006-11-23 20:17 ` wbrana
2006-11-23 21:10 ` Andrew Morton
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=20061130171533.GB1869@us.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@osdl.org \
--cc=dada1@cosmosbay.com \
--cc=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.