From: "Stephen C. Tweedie" <sct@redhat.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Stephen Tweedie <sct@redhat.com>
Subject: Re: [Patch 0/10]: Cleanup online reservations for 2.6.9-rc2-mm4.
Date: 30 Sep 2004 18:04:47 +0100 [thread overview]
Message-ID: <1096563886.1977.262.camel@sisko.scot.redhat.com> (raw)
In-Reply-To: <415C2DA4.5080102@colorfullife.com>
Hi,
On Thu, 2004-09-30 at 17:00, Manfred Spraul wrote:
> >Locking
> >is minimised: the impact on the hot path consists of nothing more than
> >an smp_rmb() before we test sb->s_groups_count. That's a noop on x86,
> >
> No, wrong way around:
> wmb() is empty. rmb() is either lfence or a locked dummy instruction.
Hmm. But I'm still not sure we can get away with anything
lighter-weight.
The basic construct we need to worry about is:
new_group_table = kmalloc(...);
memcpy(new_group_table, old_group_table);
new_group_table[new_group] = foo;
sbi->s_group_desc = new_group_table;
/* SMP WRITE BARRIER */
sbi->s_group_count = new_group_count;
on the writer side, and
ngroups = sbi->s_group_count;
/* SMP READ BARRIER */
for (i = 0; i < ngroups; i++)
gdp = sbi->s_group_desc[i];
The latter is the worry --- we're doing a read that depends immediately
on "i" and s_group_desc, but not on sbi->s_group_count. There *IS* a
comparison between i and s_group_count, though, so the dependency is
implicit.
I'm just not familiar enough with the architecture of weakly-ordered
platforms to know if we can get away with smp_read_barrier_depends() in
this particular case. If so, we can use that and be done with the extra
locked op on x86.
--Stephen
next prev parent reply other threads:[~2004-09-30 17:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-30 16:00 Manfred Spraul
2004-09-30 17:04 ` Stephen C. Tweedie [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-09-30 13:23 Stephen Tweedie
2004-09-30 18:32 ` Andreas Dilger
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=1096563886.1977.262.camel@sisko.scot.redhat.com \
--to=sct@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
/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
all inboxes | Powered by JetHome®