From: Andrew Morton <akpm@digeo.com>
To: Dave Jones <davej@codemonkey.org.uk>
Cc: schlicht@uni-mannheim.de, torvalds@transmeta.com,
hugh@veritas.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][2.5] fix preempt-issues with smp_call_function()
Date: Wed, 26 Feb 2003 01:54:09 -0800 [thread overview]
Message-ID: <20030226015409.78e8e1fb.akpm@digeo.com> (raw)
In-Reply-To: <20030226103742.GA29250@suse.de>
Dave Jones <davej@codemonkey.org.uk> wrote:
>
> On Tue, Feb 25, 2003 at 07:08:48PM +0100, Thomas Schlichter wrote:
>
> > here is a patch to solve all (I hope I missed none) possible problems that
> > could occur on SMP machines running a preemptible kernel when
> > smp_call_function() calls a function which should be also executed on the
> > current processor.
> >
> > This patch is based on the one Dave Jones sent to the LKML last friday and
> > applies to the linux kernel version 2.5.63.
>
> Just one comment. You moved quite a few of the preempt_disable/enable
> pairs outside of the CONFIG_SMP checks. The issue we're working against
> here is to try and prevent preemption and ending up on a different CPU.
> As this cannot happen if CONFIG_SMP=n, I don't see why you've done this.
>
Just in two places.
arch/i386/kernel/ldt.c | 6 ++++--
arch/x86_64/kernel/ldt.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff -puN arch/i386/kernel/ldt.c~on_each_cpu-ldt-cleanup arch/i386/kernel/ldt.c
--- 25/arch/i386/kernel/ldt.c~on_each_cpu-ldt-cleanup 2003-02-26 01:51:27.000000000 -0800
+++ 25-akpm/arch/i386/kernel/ldt.c 2003-02-26 01:52:21.000000000 -0800
@@ -55,13 +55,15 @@ static int alloc_ldt(mm_context_t *pc, i
wmb();
if (reload) {
+#ifdef CONFIG_SMP
preempt_disable();
load_LDT(pc);
-#ifdef CONFIG_SMP
if (current->mm->cpu_vm_mask != (1 << smp_processor_id()))
smp_call_function(flush_ldt, 0, 1, 1);
-#endif
preempt_enable();
+#else
+ load_LDT(pc);
+#endif
}
if (oldsize) {
if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
diff -puN arch/x86_64/kernel/ldt.c~on_each_cpu-ldt-cleanup arch/x86_64/kernel/ldt.c
--- 25/arch/x86_64/kernel/ldt.c~on_each_cpu-ldt-cleanup 2003-02-26 01:51:36.000000000 -0800
+++ 25-akpm/arch/x86_64/kernel/ldt.c 2003-02-26 01:52:37.000000000 -0800
@@ -60,13 +60,15 @@ static int alloc_ldt(mm_context_t *pc, i
pc->size = mincount;
wmb();
if (reload) {
+#ifdef CONFIG_SMP
preempt_disable();
load_LDT(pc);
-#ifdef CONFIG_SMP
if (current->mm->cpu_vm_mask != (1<<smp_processor_id()))
smp_call_function(flush_ldt, 0, 1, 1);
-#endif
preempt_enable();
+#else
+ load_LDT(pc);
+#endif
}
if (oldsize) {
if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
_
next prev parent reply other threads:[~2003-02-26 9:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-25 18:08 [PATCH][2.5] fix preempt-issues with smp_call_function() Thomas Schlichter
2003-02-26 9:27 ` Andrew Morton
2003-02-26 10:37 ` Dave Jones
2003-02-26 9:54 ` Andrew Morton [this message]
2003-02-26 10:14 ` Thomas Schlichter
2003-02-26 11:19 ` Dave Jones
2003-02-26 10:28 ` Andrew Morton
2003-02-26 10:52 ` Thomas Schlichter
2003-02-26 11:28 ` Dave Jones
2003-02-26 13:39 ` Alan Cox
2003-02-26 18:47 ` Andrew Morton
2003-02-26 20:11 ` Alan Cox
2003-02-26 16:00 ` Martin J. Bligh
-- strict thread matches above, loose matches on Subject: below --
2003-02-21 14:20 [PATCH][2.5] replace flush_map() in arch/i386/mm/pageattr.c w ith flush_tlb_all() Dave Jones
2003-02-21 17:36 ` Dave Jones
2003-02-22 3:23 ` [PATCH][2.5] fix preempt-issues with smp_call_function() Thomas Schlichter
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=20030226015409.78e8e1fb.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=davej@codemonkey.org.uk \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schlicht@uni-mannheim.de \
--cc=torvalds@transmeta.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