[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200903165559.GD14765@casper.infradead.org>
Date: Thu, 3 Sep 2020 17:55:59 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Zi Yan <ziy@...dia.com>, linux-mm@...ck.org,
Roman Gushchin <guro@...com>, Rik van Riel <riel@...riel.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Shakeel Butt <shakeelb@...gle.com>,
Yang Shi <yang.shi@...ux.alibaba.com>,
David Nellans <dnellans@...dia.com>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 00/16] 1GB THP support on x86_64
On Thu, Sep 03, 2020 at 01:40:32PM -0300, Jason Gunthorpe wrote:
> However if the sizeof(*pXX) is 8 on a 32 bit platform then load
> tearing is a problem. At lest the various pXX_*() test functions
> operate on a single 32 bit word so don't tear, but to to convert the
> *pXX to a lower level page table pointer a coherent, untorn, read is
> required.
>
> So, looking again, I remember now, I could never quite figure out why
> gup_pmd_range() was safe to do:
>
> pmd_t pmd = READ_ONCE(*pmdp);
> [..]
> } else if (!gup_pte_range(pmd, addr, next, flags, pages, nr))
> [..]
> ptem = ptep = pte_offset_map(&pmd, addr);
>
> As I don't see what prevents load tearing a 64 bit pmd.. Eg no
> pmd_trans_unstable() or equivalent here.
I don't think there are any 32-bit page tables which support a PUD-sized
page. Pretty sure x86 doesn't until you get to 4- or 5- level page tables
(which need you to be running in 64-bit mode). There's not much utility
in having 1GB of your 3GB process address space taken up by a single page.
I'm OK if there are some oddball architectures which support it, but
Linux doesn't.
Powered by blists - more mailing lists