public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schlichter <schlicht@uni-mannheim.de>
To: Dave Jones <davej@codemonkey.org.uk>
Cc: Hugh Dickins <hugh@veritas.com>, Andrew Morton <akpm@digeo.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][2.5] replace flush_map() in arch/i386/mm/pageattr.c w ith flush_tlb_all()
Date: Fri, 21 Feb 2003 15:25:01 +0100	[thread overview]
Message-ID: <200302211525.07213.schlicht@uni-mannheim.de> (raw)
In-Reply-To: <20030221142039.GA21532@codemonkey.org.uk>

[-- Attachment #1: signed data --]
[-- Type: text/plain, Size: 1773 bytes --]

Yes, you are right. I was just looking for this preempt-problem where a 
flush_tlb* was done, but there are many other places where this problem 
occours, too... Nearly everywhere where smp_call_function() is used!

I found a function in the file mm/slab.c called smp_call_function_all_cpus() 
which tries to do the thing we want, but I think not even this function is 
preempt-safe...!

But here I think I better get off my fingers, I just wanted to help a bit with 
this issue, but I don't think I have the time and knowledge to solve it 
completely in the mentioned good way...

Perhaps even the semantic of the function smp_call_function() could be changed 
to call the function on every CPU? Just an idea...

Best regards
  Thomas Schlichter


On Fri, 21 Feb 2003 15:20, Dave Jones wrote:
> On Fri, Feb 21, 2003 at 01:42:12PM +0100, Thomas Schlichter wrote:
>  > > No.  All that does is make sure that the cpu you start out on is
>  > > flushed, once or twice, and the cpu you end up on may be missed.
>  > > Use preempt_disable and preempt_enable.
>  >
>  > Oh, you are right! I think I am totally stupid this morning...!
>  > Now finally I hope this is the correct patch...
>
> That would appear to do what you want, but its an ugly construct to
> be repeating everywhere that wants to call a function on all CPUs.
> It would probably clean things up a lot if we had a function to do..
>
> static inline void on_each_cpu(void *func)
> {
> #ifdef CONFIG_SMP
> 	preempt_disable();
> 	smp_call_function(func, NULL, 1, 1);
> 	func(NULL);
> 	preempt_enable();
> #else
> 	func(NULL);
> #endif
> }
>
> Bluesmoke and agpgart could both use this to cleanup some mess,
> and no doubt there are others
>
> Comments?
>
> 		Dave

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2003-02-21 14:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-20 20:00 [PATCH][2.5] replace flush_map() in arch/i386/mm/pageattr.c with flush_tlb_all() Thomas Schlichter
2003-02-20 20:20 ` Andrew Morton
2003-02-20 20:36 ` Dave Jones
2003-02-20 20:30   ` Thomas Schlichter
2003-02-20 20:50     ` Dave Jones
2003-02-21 11:24       ` Thomas Schlichter
2003-02-21 12:19         ` [PATCH][2.5] replace flush_map() in arch/i386/mm/pageattr.c w ith flush_tlb_all() Hugh Dickins
2003-02-21 12:42           ` Thomas Schlichter
2003-02-21 14:20             ` Dave Jones
2003-02-21 14:25               ` Thomas Schlichter [this message]
2003-02-21 15:01                 ` Dave Jones
2003-02-21 14:52               ` Hugh Dickins
2003-02-21 15:10                 ` 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=200302211525.07213.schlicht@uni-mannheim.de \
    --to=schlicht@uni-mannheim.de \
    --cc=akpm@digeo.com \
    --cc=davej@codemonkey.org.uk \
    --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