All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Miller <davem@davemloft.net>
Cc: hugh@veritas.com, linux-mm@kvack.org,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	npiggin@suse.de, zach@vmware.com, jeremy@goop.org
Subject: Re: tlb_gather_mmu() and semantics of "fullmm"
Date: Fri, 27 Mar 2009 17:10:35 +1100	[thread overview]
Message-ID: <1238134235.20197.64.camel@pasglop> (raw)
In-Reply-To: <20090326.225744.250374539.davem@davemloft.net>

On Thu, 2009-03-26 at 22:57 -0700, David Miller wrote:

> Good point.
> 
> Maybe it would work out correctly if I used current->mm?
> 
> Because if I tested it that way, only something really executing
> in userland could force the cpumask bit clears.
> 
> Any kernel thread would flush the TLB if and when it switched
> back into a real task using that mm.
> 
> Sound good?

/me thinks (not as late here but I'm getting tired regardless ;-)

So if you test current->mm, you effectively account for mm_users == 1,
so the only way the mm can be active on another processor is as a lazy
mm for a kernel thread. So your test should work properly as long
as you don't have a HW that will do speculative TLB reloads into the
TLB on that other CPU (and even if you do, you flush-on-switch-in should
get rid of any crap here).

Ben.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-03-27  6:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26  5:01 tlb_gather_mmu() and semantics of "fullmm" Benjamin Herrenschmidt
2009-03-26 14:08 ` Hugh Dickins
2009-03-26 16:38   ` Linus Torvalds
2009-03-26 23:13     ` Benjamin Herrenschmidt
2009-03-26 17:21   ` Jeremy Fitzhardinge
2009-03-26 20:39   ` David Miller
2009-03-26 22:33   ` Benjamin Herrenschmidt
2009-03-27  5:04     ` David Miller
2009-03-27  5:38       ` Benjamin Herrenschmidt
2009-03-27  5:44         ` David Miller
2009-03-27  5:54           ` Benjamin Herrenschmidt
2009-03-27  5:57             ` David Miller
2009-03-27  6:10               ` Benjamin Herrenschmidt [this message]
2009-03-27  8:05                 ` David Miller

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=1238134235.20197.64.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=hugh@veritas.com \
    --cc=jeremy@goop.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=torvalds@linux-foundation.org \
    --cc=zach@vmware.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 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.