Re: fix iounmap and a pageattr memleak (x86 and x86-64)

Andrea Arcangeli
2004-11-05T08:49:36Z

On Fri, Nov 05, 2004 at 09:31:02AM +0100, Andi Kleen wrote:
> At least the NX handling is still broken on i386 (when reverting
> back it doesn't clear the NX bit for kernel text)

I'd never use a 32bit kernel on a x86-64 box, so that's sort of low
interest bug to me, but acked.

> I still don't like how you remove the reversal handling completely.

that's to make it fully symmetric. If you're so attached to the old
API, I'm not going to care if you want it back, but if there are 3
symmetric users with the third going to work on a different page, my
code will work the previous code will corrupt the mapping due the
refcount going down too fast. If you could mention a single case where
it would make sense not to be symmetric, I would change my mind. I find
so much simpler to remember that as far as I'm always symmetric the
refcounting will go right no matter what the other tasks are doing
around. The below special case just complicates the API for no good
reason. My problem is that it requires somebody understanding pageattr.c
and fixing bugs on it daily to remember and to be able to use your below
API IMHO (I had no idea myself of this undocumented below subtle detail
until I read the code, infact it was the first thing I've removed after
I noticed the asymmetry it generated). Bug again no problem, I'll try
hard to remember it if we're going to keep it ;).

> > > - if (pte_same(old,standard))
> > > - get_page(kpte_page);