From: Andi Kleen <ak@suse.de>
To: Andi Kleen <ak@suse.de>
Cc: Dave Hansen <haveblue@us.ibm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
akpm@digeo.com
Subject: Re: 4level page tables for Linux II
Date: Tue, 12 Oct 2004 21:08:02 +0200 [thread overview]
Message-ID: <20041012190802.GA14821@wotan.suse.de> (raw)
In-Reply-To: <20041012190346.GA705@wotan.suse.de>
On Tue, Oct 12, 2004 at 09:03:46PM +0200, Andi Kleen wrote:
> On Tue, Oct 12, 2004 at 11:48:22AM -0700, Dave Hansen wrote:
> > @@ -110,13 +115,18 @@ int install_file_pte(struct mm_struct *m
> > unsigned long addr, unsigned long pgoff, pgprot_t prot)
> > {
> > ...
> > + pml4 = pml4_offset(mm, addr);
> > +
> > + spin_lock(&mm->page_table_lock);
> > + pgd = pgd_alloc(mm, pml4, addr);
> > + if (!pgd)
> > + goto err_unlock;
> >
> > Locking isn't needed for access to the pml4? This is a wee bit
> > different from pgd's and I didn't see any documentation about it
> > anywhere. Could be confusing.
>
> No, the lock is still needed. Thanks for catching this, that was indeed
> wrong.
Actually on second though - the code was actually ok. The reason is
that the highest page table level never goes away while the process
exists, and holding a pointer into it is always valid.
Only referencing it needs a lock, but pml4_offset doesn't reference
anything yet.
The same used to hold for pgds, but the 4level page tables change that.
However there was at least one bug in the patchkit in this area
which I now fixed.
-Andi
next prev parent reply other threads:[~2004-10-12 19:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-12 13:59 4level page tables for Linux Andi Kleen
2004-10-12 18:48 ` Dave Hansen
2004-10-12 19:03 ` Andi Kleen
2004-10-12 19:08 ` Andi Kleen [this message]
2004-10-13 18:41 ` Andrea Arcangeli
2004-10-13 19:35 ` Andi Kleen
2004-10-13 20:04 ` Andrea Arcangeli
2004-10-18 17:02 ` Christoph Lameter
2004-10-18 17:21 ` Andi Kleen
2004-10-18 17:38 ` Andrea Arcangeli
-- strict thread matches above, loose matches on Subject: below --
2004-10-13 3:36 4level page tables for Linux II Albert Cahalan
2004-10-13 7:22 ` Andi Kleen
2004-10-13 21:42 ` Albert Cahalan
2004-10-14 16:57 ` Matthias Urlichs
2004-10-15 1:55 ` Andrew Grover
2004-10-15 13:28 ` Jörn Engel
2004-10-15 13:55 ` Matthias Urlichs
2004-10-15 23:39 ` Jörn Engel
2004-10-17 5:54 ` Ingo Molnar
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=20041012190802.GA14821@wotan.suse.de \
--to=ak@suse.de \
--cc=akpm@digeo.com \
--cc=haveblue@us.ibm.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