All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitri Sivanich <sivanich@sgi.com>
To: Eric Dumazet <dada1@cosmosbay.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.14-rc4 latency issue with rcu_process_callbacks()/file_free_rcu()
Date: Thu, 20 Oct 2005 11:31:16 -0500	[thread overview]
Message-ID: <20051020163116.GA23262@sgi.com> (raw)
In-Reply-To: <4357BE1C.9080004@cosmosbay.com>

On Thu, Oct 20, 2005 at 05:56:12PM +0200, Eric Dumazet wrote:
> Dimitri Sivanich a écrit :
> >Just bringing up a latency issue I've noticed recently.
> >
> >In or around 2.6.14-rc4 some changes were made to have the call to
> >kmem_cache_free() from file_free() in the Linux kernel be deferred, running
> >as a tasklet via file_free_rcu(), rather than running kmem_cache_free()
> >right from file_free() directly.
> >
> >I've noticed that rcu_process_callbacks() can take quite a while to run
> >now that it routinely calls file_free_rcu() to run kmem_cache_free().
> >This can make the cpu unavailable for 100's of usec on 1GHz machines, with
> >or without preemption configured on (much of this path is non-preemptible).
> >
> >This can result in some unpredictable periods of fairly long cpu latency,
> >such as when a thread is waiting to be woken by an interrupt handler on a
> >'now quiet' cpu.  Changing file_free() to call kmem_cache_free() directly
> >completely eliminates this unexpected latency.
> 
> Well, you cannot change file_free() to call kmem_cache_free() directly, or 
> risk corruption/crash.
> 
> See Documentation/RCU/UP.txt

OK.  I'll have to look at this more closely.  I simply ran across this as a
substantial change between this and earlier kernels and decided to test
against the original file_free()->kmem_cache_free() code to ensure that that
alone was indeed the issue (for the circumstance I'll describe below).

> 
> Dont you notice latency issue with other RCU protected data, like dentries ?

No, but here's the circumstance under which I notice this:

I'm running on a single cpu of an SMP system (4 cpu).  When I hit this I'm in
a situation where I've written some file data, and am now sleeping waiting to
be woken up.  No other threads are running on that cpu other than a few kernel
threads, so all is fairly quiet.

By the simple one line change (file_free() calling kmem_cache_free() again),
I'm always woken up very quickly.   Too bad we cannot revert back that way
with the rcu changes.

> 
> BTW a change in 2.6.14-rc5 might give different latency results.

I'll look at this as soon as I get a chance.

> 
> Eric

      reply	other threads:[~2005-10-20 16:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-20 14:07 2.6.14-rc4 latency issue with rcu_process_callbacks()/file_free_rcu() Dimitri Sivanich
2005-10-20 15:56 ` Eric Dumazet
2005-10-20 16:31   ` Dimitri Sivanich [this message]

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=20051020163116.GA23262@sgi.com \
    --to=sivanich@sgi.com \
    --cc=dada1@cosmosbay.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.