mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@bonn-fries.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Rik van Riel <riel@conectiva.com.br>,
	Hugh Dickins <hugh@veritas.com>, <dmccr@us.ibm.com>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<linux-mm@kvack.org>, Robert Love <rml@tech9.net>,
	<mingo@redhat.co>, Andrew Morton <akpm@zip.com.au>,
	<manfred@colorfullife.com>, <wli@holomorphy.com>
Subject: Re: [RFC] Page table sharing
Date: Tue, 19 Feb 2002 04:45:59 +0100	[thread overview]
Message-ID: <E16d1E8-00010D-00@starship.berlin> (raw)
In-Reply-To: <Pine.LNX.4.33.0202181908210.24803-100000@home.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0202181908210.24803-100000@home.transmeta.com>

On February 19, 2002 04:22 am, Linus Torvalds wrote:
> On Mon, 18 Feb 2002, Linus Torvalds wrote:
> >
> > We can, of course, introduce a "pmd-rmap" thing, with a pointer to a
> > circular list of all mm's using that pmd inside the "struct page *" of the
> > pmd. Right now the rmap patches just make the pointer point directly to
> > the one exclusive mm that holds the pmd, right?
> 
> There's another approach:
>  - get rid of "page_table_lock"
>  - replace it with a "per-pmd lock"
>  - notice that we already _have_ such a lock
> 
> The lock we have is the lock that we've always had in "struct page".

Yes, I even have an earlier version of the patch that implements a spinlock
on that bit.  It doesn't use the normal lock_page of course.

> There are some interesting advantages from this:
>  - we allow even more parallelism from threads across different CPU's.
>  - we already have the cacheline for the pmd "struct page" because we
>    needed it for the pmd count.Y
> 
> That still leaves the TLB invalidation issue, but we could handle that
> with an alternate approach: use the same "free_pte_ctx" kind of gathering
> that the zap_page_range() code uses for similar reasons (ie gather up the
> pte entries that you're going to free first, and then do a global
> invalidate later).
>
> Note that this is likely to speed things up anyway (whether the pages are
> gathered by rmap or by the current linear walk), by virtue of being able
> to do just _one_ TLB invalidate (potentially cross-CPU) rather than having
> to do it once for each page we free.
> 
> At that point you might as well make the TLB shootdown global (ie you keep
> track of a mask of CPU's whose TLB's you want to kill, and any pmd that
> has count > 1 just makes that mask be "all CPU's").
> 
> I'm a bit worried about the "lock each mm on the pmd-rmap list" approach,
> because I think we need to lock them _all_ to be safe (as opposed to
> locking them one at a time), which always implies all the nasty potential
> deadlocks you get for doing multiple locking.
> 
> The "page-lock + potentially one global TLB flush" approach looks a lot
> safer in this respect.

How do we know when to do the global tlb flush?

-- 
Daniel

  reply	other threads:[~2002-02-19  3:41 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-16 18:07 Daniel Phillips
2002-02-16 20:21 ` Linus Torvalds
2002-02-16 21:08   ` Daniel Phillips
2002-02-17  6:23     ` Linus Torvalds
2002-02-17 19:39       ` Daniel Phillips
2002-02-17 20:16         ` Daniel Phillips
2002-02-17 22:16         ` Hugh Dickins
2002-02-18  1:35           ` Daniel Phillips
2002-02-18  8:09             ` Hugh Dickins
2002-02-18  9:41               ` Daniel Phillips
2002-02-18 11:32                 ` Daniel Phillips
2002-02-19  0:01                   ` Daniel Phillips
2002-02-18 19:04                 ` Hugh Dickins
2002-02-18 23:37                   ` Daniel Phillips
2002-02-19  0:56                     ` Linus Torvalds
2002-02-19  1:22                       ` Rik van Riel
2002-02-19  1:29                         ` Daniel Phillips
2002-02-19  1:48                         ` Linus Torvalds
2002-02-19  1:53                           ` Rik van Riel
2002-02-19  2:05                             ` Linus Torvalds
2002-02-19  2:22                               ` Daniel Phillips
2002-02-19  2:35                                 ` Linus Torvalds
2002-02-19  2:55                                   ` Daniel Phillips
2002-02-19  3:11                                   ` Daniel Phillips
2002-02-19  3:22                                   ` Linus Torvalds
2002-02-19  3:45                                     ` Daniel Phillips [this message]
2002-02-19 17:29                                       ` Linus Torvalds
2002-02-19 18:11                                         ` Hugh Dickins
2002-02-20 14:18                                           ` Daniel Phillips
2002-02-20 15:30                                             ` Hugh Dickins
2002-02-20 14:10                                         ` Daniel Phillips
2002-02-20 14:38                                           ` Hugh Dickins
2002-02-20 14:57                                             ` Daniel Phillips
2002-02-19 11:39                                     ` Daniel Phillips
2002-02-19 12:22                                       ` Hugh Dickins
2002-02-19 12:43                                         ` Daniel Phillips
2002-02-19 10:02                                   ` Roman Zippel
2002-02-22  5:29                               ` Daniel Phillips
2002-02-22  6:32                                 ` Daniel Phillips
2002-02-22  9:21                                   ` [RFC] Page table sharing, leak gone Daniel Phillips
2002-02-19  1:57                           ` [RFC] Page table sharing Daniel Phillips
2002-02-19  1:23                       ` Daniel Phillips
2002-02-19  1:50                       ` Daniel Phillips
2002-02-19  1:53                         ` Linus Torvalds
2002-02-19  2:12                           ` Daniel Phillips
2002-02-18 23:48                   ` Daniel Phillips
2002-02-18 23:59                   ` Daniel Phillips
2002-02-19  0:03                     ` Hugh Dickins
2002-02-19  0:27                       ` Daniel Phillips
2002-02-19  4:27                         ` Eric W. Biederman
2002-02-19 17:30                           ` Linus Torvalds
     [not found] <Pine.LNX.4.33.0202182000320.5124-100000@coffee.psychology.mcmaster.ca>
2002-02-19  1:11 ` Daniel Phillips
2002-02-19 18:18 Qing Huang

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=E16d1E8-00010D-00@starship.berlin \
    --to=phillips@bonn-fries.net \
    --cc=akpm@zip.com.au \
    --cc=dmccr@us.ibm.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=manfred@colorfullife.com \
    --cc=mingo@redhat.co \
    --cc=riel@conectiva.com.br \
    --cc=rml@tech9.net \
    --cc=torvalds@transmeta.com \
    --cc=wli@holomorphy.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

all inboxes | Powered by JetHome®