linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: mingming cao <cmm@us.ibm.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]IPC locks breaking down with RCU
Date: Mon, 21 Oct 2002 21:23:55 +0200	[thread overview]
Message-ID: <3DB4544B.806@colorfullife.com> (raw)

Hugh wrote:

>I had toyed with the idea of never
>freeing entries once allocated, which is a similarly simple solution;
>

Not possible, the structure size for ipc sem depends on the number of 
semaphores in the semaphore set.

Probably the best approach is to add a "deleted" flag into the ipc_id 
structure, and to check that flag after acquiring the spinlock. And 
perform the actual free operations for the ipc element in a rcu callback.
At which context do the rcu callbacks run? The semaphore sets are 
allocated with vmalloc for large sets, and that function is only 
permitted from process context, not from bh or irq context. According to 
a comment in rcupdate.c, rcu_process_callbacks runs in a tasklet, i.e. 
at bh context.

>I'm happy to be overruled by someone who understands these cacheline
>bounce issues better than we do, but nobody else has spoken up yet.
>  
>
Are there any good documents about cacheline bouncing, or rules how to 
reduce it?

For example, should a spinlock and the data it protects be in the same 
cacheline, or in different cachelines?
I guess that "same cacheline" means that only one cacheline is 
transfered if a cpu acquires the spinlock and touches the data.
But OTHO a spinning cpu would probably force the cacheline into shared 
state, and that'll slow down the data access for the cpu that owns the 
spinlock.

--
    Manfred


             reply	other threads:[~2002-10-21 19:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-21 19:23 Manfred Spraul [this message]
2002-10-21 20:10 ` [PATCH]IPC locks breaking down with RCU Hugh Dickins
2002-10-21 20:34   ` mingming cao
  -- strict thread matches above, loose matches on Subject: below --
2002-10-18  0:14 mingming cao
2002-10-20 13:14 ` Hugh Dickins
2002-10-20 17:27   ` Hugh Dickins
2002-10-21 18:11     ` mingming cao
2002-10-21 19:00       ` Hugh Dickins
2002-10-21 19:18       ` Dipankar Sarma
2002-10-21 19:36         ` Hugh Dickins
2002-10-21 19:41         ` mingming cao
2002-10-21 20:14           ` Dipankar Sarma
2002-10-21 18:07   ` mingming cao

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=3DB4544B.806@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=cmm@us.ibm.com \
    --cc=hugh@veritas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).