[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYuZgZUznVxt1AHCSJa_GAXy8N0SduE5OrjDnE1s_L7Zg@mail.gmail.com>
Date: Thu, 19 Mar 2020 23:23:33 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Peter Maydell <peter.maydell@...aro.org>
Cc: "Suzuki K. Poulose" <suzuki.poulose@....com>,
"Theodore Ts'o" <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>,
QEMU Developers <qemu-devel@...gnu.org>,
Florian Weimer <fw@...eb.enyo.de>,
Andy Lutomirski <luto@...nel.org>,
stable <stable@...r.kernel.org>
Subject: Re: [PATCH] ext4: Give 32bit personalities 32bit hashes
On Thu, Mar 19, 2020 at 4:25 PM Peter Maydell <peter.maydell@...aro.org> wrote:
> On Thu, 19 Mar 2020 at 15:13, Linus Walleij <linus.walleij@...aro.org> wrote:
> > On Tue, Mar 17, 2020 at 12:58 PM Peter Maydell <peter.maydell@...aro.org> wrote:
> > > What in particular does this personality setting affect?
> > > My copy of the personality(2) manpage just says:
> > >
> > > PER_LINUX32 (since Linux 2.2)
> > > [To be documented.]
> > >
> > > which isn't very informative.
> >
> > It's not a POSIX thing (not part of the Single Unix Specification)
> > so as with most Linux things it has some fuzzy semantics
> > defined by the community...
> >
> > I usually just go to the source.
>
> If we're going to decide that this is the way to say
> "give me 32-bit semantics" we need to actually document
> that and define in at least broad terms what we mean
> by it, so that when new things are added that might or
> might not check against the setting there is a reference
> defining whether they should or not, and so that
> userspace knows what it's opting into by setting the flag.
> The kernel loves undocumented APIs but userspace
> consumers of them are not so enamoured :-)
OK I guess we can at least take this opportunity to add
some kerneldoc to the include file.
> As a concrete example, should "give me 32-bit semantics
> via PER_LINUX32" mean "mmap should always return addresses
> within 4GB" ? That would seem like it would make sense --
Incidentally that thing in particular has its own personality
flag (personalities are additive, it's a bit schizophrenic)
so PER_LINUX_32BIT is defined as:
PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
and that is specifically for limiting the address space to
32bit.
There is also PER_LINUX32_3GB for a 3GB lowmem
limit.
Since the personality is kind of additive, if
we want a flag *specifically* for indicating that we want
32bit hashes from the file system, there are bits left so we
can provide that.
Is this what we want to do? I just think we shouldn't
decide on that lightly as we will be using up personality
bug bits, but sometimes you have to use them.
PER_LINUX32 as it stands means 32bit personality
but very specifically does not include memory range
limitations since that has its own flags.
Yours,
Linus Walleij
Powered by blists - more mailing lists