Messages in this thread | | | Subject | Re: PTE access rules & abstraction | From | Benjamin Herrenschmidt <> | Date | Thu, 25 Sep 2008 07:20:48 +1000 |
| |
On Wed, 2008-09-24 at 19:45 +0100, Hugh Dickins wrote:
> The powerpc bug whereof you write appears to have been there since ... > linux-2.4.0 or earlier: > entry = ptep_get_and_clear(pte); > set_pte(pte, pte_modify(entry, newprot)); > > But perhaps powerpc was slightly different back in those days. > It sounds to me like a bug in your current ptep_get_and_clear(), > not checking if already hashed?
Yes, I figured out the bug was already there. And no, it's not the right approach to have ptep_get_and_clear() flush because it would mean that call cannot batch flushes, and thus we would lose ability to batch in zap_pte_range().
> Though what we already have falls somewhat short of perfection, > I've much more enthusiasm for fixing its bugs, than for any fancy > redesign introducing its own bugs. Others have more stamina!
Well, the current set accessor, as far as I'm concerned is a big pile of steaming shit that evolved from x86-specific gunk raped in different horrible ways to make it looks like it fits on other architectures and additionally mashed with goo to make it somewhat palatable by virtualization stuff. Yes, bugs can be fixed but it's still an horrible mess.
Now, regarding the above bug, I'm afraid the only approaches I see that would work would be to have either a ptep_get_and_clear_flush(), which I suppose x86 virt. people will hate, or maybe to actually have a powerpc specific variant of the new start/commit hooks that does the flush.
Ben.
| |