From: Rusty Russell <rusty@rustcorp.com.au>
To: Dave Jones <davej@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: Keith Owens <kaos@ocs.com.au>, Rob Love <rml@tech9.net>
Subject: Re: [DOCUMENTATION] Revised Unreliable Kernel Locking Guide
Date: Mon, 15 Dec 2003 13:28:39 +1100 [thread overview]
Message-ID: <20031215060838.B7C952C232@lists.samba.org> (raw)
In-Reply-To: Your message of "Fri, 12 Dec 2003 15:44:01 -0000." <20031212154401.GA10584@redhat.com>
In message <20031212154401.GA10584@redhat.com> you write:
> On Fri, Dec 12, 2003 at 04:24:18PM +1100, Rusty Russell wrote:
> > OK, I've put the html version up for your reading pleasure: the diff
> > is quite extensive and hard to read.
> >
> > http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/
> >
> > Feedback welcome,
>
> Hi Rusty,
> Might be worth mentioning in the Per-CPU data section that code doing
> operations on CPU registers (MSRs and the like) needs to be protected
> by an explicit preempt_disable() / preempt_enable() pair if it's doing
> operations that it expects to run on a specific CPU.
>
> For examples, see arch/i386/kernel/msr.c & cpuid.c
I don't think it belongs in per-cpu data, that's a bit disingenous.
It's a separate section by itself, I think. But it's also fairly
rare.
The smp_call_function() case is more subtle, but in fact, there are
only two calls to smp_call_function in non-arch-specific code, and
both are wrong:
mm/slab.c: smp_call_function_all_cpus() should just be on_each_cpu.
net/core/flow.c: This should also be on_each_cpu: I actually have a
patch for this, too.
The aim of this document is to give the reader an overview core
techniques, not describe every possible variant. IMHO a more likely
candidate for a section would be atomic_dec_and_lock(), which there is
no real concept of an "owner" of an object, but the destroy is
implicit (and atomic) by the last user.
Hope that clarifies,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2003-12-15 6:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-12 5:24 [DOCUMENTATION] Revised Unreliable Kernel Locking Guide Rusty Russell
2003-12-12 15:44 ` Dave Jones
2003-12-12 16:25 ` Keith Owens
2003-12-12 18:25 ` Dave Jones
2003-12-13 0:28 ` Keith Owens
2003-12-12 21:05 ` Rob Love
2003-12-15 2:28 ` Rusty Russell [this message]
2003-12-12 19:35 ` Paul E. McKenney
2003-12-13 3:16 ` Zwane Mwaikambo
2003-12-15 5:17 ` Rusty Russell
2003-12-15 5:17 ` Rusty Russell
2003-12-15 22:22 ` Paul E. McKenney
2003-12-16 6:32 ` Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
2003-12-13 3:15 Manfred Spraul
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=20031215060838.B7C952C232@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=davej@redhat.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.