mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
To: linux-kernel@vger.kernel.org
Cc: ak@suse.de, Ian.Pratt@cl.cam.ac.uk, Keir.Fraser@cl.cam.ac.uk
Subject: Incorrect comment in leave_mm()?
Date: Thu, 31 Mar 2005 17:14:30 +0100	[thread overview]
Message-ID: <E1DH2JS-00021o-00@mta1.cl.cam.ac.uk> (raw)


Hi,

I have a question regarding the per-cpu tlbstate logic that is used to
lazily switch to the swapper_pgdir when running a process with no
mm_struct of its own.

There is a comment in arch/i386/kernel/smp.c:leave_mm() that
states 'We need to reload %cr3 since the page tables may be going away
from under us'. AFAICT this is not true -- the currently-running task
holds a reference on the active_mm until it is context-switched off
the CPU, at which point the reference is dropped in
sched.c:finish_task_switch(). Until that point the pgd cannot be
freed and so kernel mappings should remain valid to use. 

Although the corresponding function in arch/x86_64 doesn't include
this comment, Andi Kleen recently modified it to switch to the
swapper_pg_dir, instead of doing a simple __flush_tlb. Does this mean 
that I am missing something, and the comment in arch/i386 is in fact
correct? 

 Thanks,
 Keir

             reply	other threads:[~2005-03-31 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-31 16:14 Keir Fraser [this message]
2005-03-31 19:20 ` Andi Kleen

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=E1DH2JS-00021o-00@mta1.cl.cam.ac.uk \
    --to=keir.fraser@cl.cam.ac.uk \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --cc=ak@suse.de \
    --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

all inboxes | Powered by JetHome®