From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org,
Christoph Lameter <clameter@engr.sgi.com>,
Alok Kataria <alok.kataria@calsoftinc.com>,
"Shai Fultheim (Shai@scalex86.org)" <shai@scalex86.org>,
"Benzi Galili (Benzi@ScaleMP.com)" <benzi@scalemp.com>
Subject: Re: [patch] slab: Fix a cpu hotplug race condition while tuning slab cpu caches
Date: Mon, 16 Oct 2006 12:26:15 -0700 [thread overview]
Message-ID: <20061016192615.GA3746@localhost.localdomain> (raw)
In-Reply-To: <20061016111511.3901be27.akpm@osdl.org>
On Mon, Oct 16, 2006 at 11:15:11AM -0700, Andrew Morton wrote:
> On Mon, 16 Oct 2006 01:54:39 -0700
> Ravikiran G Thirumalai <kiran@scalex86.org> wrote:
>
> The problem is obvious: we have some data (the array caches) and we have a
> data structure which is used to look up that data (cpu_online_map). But
> we're releasing the lock while these two things are in an inconsistent
> state.
>
> So you could have fixed this by taking cache_chain_mutex in CPU_UP_PREPARE
> and releasing it in CPU_ONLINE and CPU_UP_CANCELED.
Hmm, yes. I suppose so. Maybe we can do away with other uses of
lock_cpu_hotplug() in slab.c as well then! Will give it a shot. Slab
locking might look uglier than what it already is though no?
>
> > list_for_each_entry(cachep, &cache_chain, next) {
> > @@ -4087,6 +4088,7 @@ ssize_t slabinfo_write(struct file *file
> > }
> > }
> > mutex_unlock(&cache_chain_mutex);
> > + unlock_cpu_hotplug();
> > if (res >= 0)
> > res = count;
> > return res;
>
> Given that this lock_cpu_hotplug() happens at a high level I guess it'll
> avoid the usual lock_cpu_hotplug() horrors and we can live with it. I
> assume lockdep was enabled when you were testing this?
Not when I tested it. I just retested with lockdep on and things seemed
fine on a SMP.
Thanks,
Kiran
next prev parent reply other threads:[~2006-10-16 19:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-16 8:54 [patch] slab: Fix a cpu hotplug race condition while tuning slab cpu caches Ravikiran G Thirumalai
2006-10-16 9:12 ` Christoph Lameter
2006-10-16 18:15 ` Andrew Morton
2006-10-16 19:26 ` Ravikiran G Thirumalai [this message]
2006-10-16 19:48 ` Andrew Morton
2006-10-16 22:43 ` 2.6.19-rc2 cpu hotplug lockdep warning: possible circular locking dependency Ravikiran G Thirumalai
2006-10-16 22:58 ` Neil Brown
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=20061016192615.GA3746@localhost.localdomain \
--to=kiran@scalex86.org \
--cc=akpm@osdl.org \
--cc=alok.kataria@calsoftinc.com \
--cc=benzi@scalemp.com \
--cc=clameter@engr.sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shai@scalex86.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