Re: preempt bug in set_pmd_pfn?

From: Hugh Dickins
Date: Wed Mar 05 2008 - 15:41:39 EST


On Wed, 5 Mar 2008, Jeremy Fitzhardinge wrote:
>
> Fixmap slots are global, not percpu; you may be thinking of kmap_atomic, which
> reserves percpu fixmap slots for its use.

Ah yes, of course you're right, I was misremembering: thanks.

> Most uses of set_fixmap are early
> in boot, where preemption (or other CPUs) isn't a factor. The exception is
> mapping the compat vdso global mapping. However, that is special-cased
> anyway, since the set_fixmap is followed by an explicit all-cpu tlb flush.

Mmm, yes, I hadn't noticed that one: rather a weird case.

(If root had a mind to do so, she could be flipping compat_vdso
back and forth on all cpus concurrently; but I don't see an actual
problem of getting a worse outcome than she deserves for doing so -
the pages involved never get freed.)

> It seems to me that the correct fix is to just make __set_fixmap disable
> preemption for its duration; it probably doesn't make much difference for the
> native case, and it makes Xen happy.

I'd have thought it better done just in that one peculiar case,
with a comment that it's to keep Xen happy; but I'd better back
out now and leave it to you and Ingo.

Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/