Re: Q: PREFETCH_STRIDE/16

David Mosberger (davidm@napali.hpl.hp.com)
Thu, 23 May 2002 10:02:33 -0700


>>>>> On Thu, 23 May 2002 09:34:16 -0700 (PDT), "David S. Miller" <davem@redhat.com> said:

DaveM> I mentioned this 1 or 2 days ago in the TLB thread with
DaveM> Linus, you pessimistically maintain a tiny bitmap per
DaveM> mm_struct which keeps track of where mappings actually are.
DaveM> You use some hash function on the virtual address to
DaveM> determine the bit. You clear it when the mm_struct is new,
DaveM> and you just set bits when mappings are installed. Very
DaveM> simple.

DaveM> Then all of these "walk all valid page tables" loops that
DaveM> scan entire mostly empty pages of pgd/pmd/pte entries for no
DaveM> reason can just check the bitmap instead.

DaveM> Most of the exit overhead is in clear_page_tables walking
DaveM> over entire pages. It effectively flushes the cache unless
DaveM> all you are doing is fork/exit/fork/exit

Sounds like something worth experimenting with. I doubt you could
really avoid (effectively) flushing the caches, but even if there are
just a few zero bits in the bitmap at the time of the tear-down, a
fair amount of time could be saved.

--david
-
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/