Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Nov 2016 21:03:44 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Adrian Chadd <adrian.chadd@gmail.com>
Cc:        Juli Mallett <jmallett@freebsd.org>, Warner Losh <wlosh@bsdimp.com>, Warner Losh <imp@bsdimp.com>, "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   Re: svn commit: r307626 - head/sys/ufs/ffs
Message-ID:  <20161113190344.GM54029@kib.kiev.ua>
In-Reply-To: <CAJ-Vmo=C-pqY4o-r2RXD-m0OxWeDaLpm_zUroeMpwZvLLuuZdg@mail.gmail.com>
References:  <20161113065851.GD54029@kib.kiev.ua> <CANCZdfreg9wD-2pdGtzgeO86BptSE4M7LnLFTC09K3RHyHR8cQ@mail.gmail.com> <20161113071911.GF54029@kib.kiev.ua> <CANCZdfpC6smeNSPKzpbX8aAnF8CZ%2BSEFQmQ74jqvWUVXrttM%2BQ@mail.gmail.com> <20161113075557.GH54029@kib.kiev.ua> <71C512CD-0FB6-40D8-B46C-30467A245693@bsdimp.com> <CACVs6=_zmjJhMzmyFGJGHK1RAguQ_fZUcd94ZEmVEnTXBiOSdQ@mail.gmail.com> <20161113161548.GK54029@kib.kiev.ua> <CAJ-VmomG6e8WVyyuqAkC20fwZ5wX2hnwSE7T4r%2BTSDF%2BOzLCNQ@mail.gmail.com> <CAJ-Vmo=C-pqY4o-r2RXD-m0OxWeDaLpm_zUroeMpwZvLLuuZdg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 13, 2016 at 10:50:19AM -0800, Adrian Chadd wrote:
> Ok, so after talking with others, my questions are:
> 
> * I thought our VM was supposed to not be doing double mapping like
> this. warner's comment on irc was:
> 
> ===
> 13:39 < bsdimp> adrian the VM isn't supposed to do it at all.
> 13:39 < bsdimp> adrian that is, double map on purpose.
> 13:40 < bsdimp> though there's some exceptions to the rule
> 13:40 < bsdimp> since kernel mappings go away in userland, and
> userland doesn't execute while you're in kernel mode, you can do the
> flushing
>                 game in busdma to prevent most issues.
> 13:41 < bsdimp> which is what we do. Generally, though, our VM doesn't
> do it in-kernel.
> ===
> 
> * is this still the case? or are there places in the VM where we are doing this?
> * can we introduce a machdep/pmap capability check to see if aliasing
> is allowed and if so, turn this feature on?
This never was the case, and never will.  VM establishes mappings as
requested by the userspace and kernel, and n-times mapping for the same
page is always legitimate.  It is the pmap duty to handle that.

If you cared to read my previous mail, I already explained that besides
the userspace asking for n-mapping, there is at least buffer cache which
also maps the same page into KVA, from the times when unified buffer
cache/page cache was introduced.  Same is true for n-mapping of shared
anon pages.

> 
> Adding a pmap capability and turning it on for say, i386/amd64/arm64
> would allow for this new feature as well as the previous behaviour on
> older platforms.
> 
> I don't think I have the time to fix mips pmap to support this new
> feature, so if you want to turn it on for all features, we should
> really fix/test pmap on said platforms first.
This is not a new feature, this is the old bug on that platform.

> 
> Final comment: I'd really like to see a sort of "tested on" for things
> like this, because it's not clear which platforms/architectures it was
> tested on.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161113190344.GM54029>