Re: Make 2.5.17 TLB even more friendlier

Linus Torvalds (torvalds@transmeta.com)
Tue, 21 May 2002 21:04:03 -0700 (PDT)


On Wed, 22 May 2002, Paul Mackerras wrote:
>
> It seems to me that there is a race in this code in zap_pte_range,
> because there is a gap between when we read the pte and when we clear
> it:

Yes and no.

There is a race, and yes, another thread might mark it dirty.

However, I've not decided whether we care about it yet. I think we _do_
care, for people doing strange things with their own internal VM
management using mmap/munmap of shared mappings, but on the other hand it
_is_ fairly expensive to do a "ptep_get_and_clear()".

> Shouldn't we do this as "pte = ptep_get_and_clear(ptep)", at least in
> the case where we are unmapping stuff?

Yeah, I want to do it, but I also would really want to avoid the overhead
for the exit case. Which is another reason I'd like to have exit() not use
zap_page_range() at all.

But I'll make that change now, so that we don't lose it. We should just
remember to not do it if we split up exit.

Linus

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