Re: [patch] mm: reduce pagetable-freeing latencies

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Benjamin Herrenschmidt
Date: Tuesday, July 24, 2007 - 2:29 pm

On Tue, 2007-07-24 at 14:13 +0200, Andi Kleen wrote:

First is to rework the batch structure to make it more manageable. That
is, patch #1 will keep the page list in per-cpu (and thus non-preempt),
but the batch "head" will be on the stack.

Now, there are two approaches regarding getting rid of the
get_cpu/put_cpu:

 - One is to have a small number of entries for the page list in the
batch structure on the stack, and attempt to gfp' a page for more. If
that fails, we can still free, though with less batching, using only the
few entries in the batch struct itself. That's Hugh initial appraoch
iirc.

 - Another is to hook up with those folks who've been asking for a
notifier that we are being preempted/scheduled out. In this case, I can
happily access the per-cpu list, and just trigger a batch flush if we
happen to be scheduled out.

I tend to prefer the former solution though, gfp should be fast, and
there is no need to force a flush if we get scheduled out. It would be
rare to hit the worst case scenario of falling back to the few page
heads in the batch itself. On the other hand, that solution has the
problem of bloating the stack a bit (with the few page pointers) even in
the case where I plan to use the extended batch outside of zap_*, such
as fork, mprotect, ....

So I'll first do patch #1, which will not fix the problem, but will make
the fix easier to fit in, in the meantime, please provide feedback of
your preferred solution for avoiding the get/put_cpu of the 2 above,
unless you find a good 3rd one.

Cheers,
Ben.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] mm: reduce pagetable-freeing latencies, Ingo Molnar, (Tue Jul 24, 1:38 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Andrew Morton, (Tue Jul 24, 1:54 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Tue Jul 24, 2:40 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Tue Jul 24, 2:40 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Ingo Molnar, (Tue Jul 24, 4:22 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Andi Kleen, (Tue Jul 24, 5:13 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Tue Jul 24, 2:29 pm)
Re: [patch] mm: reduce pagetable-freeing latencies, Peter Zijlstra, (Tue Jul 24, 11:44 pm)
Re: [patch] mm: reduce pagetable-freeing latencies, Andi Kleen, (Wed Jul 25, 2:46 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Wed Jul 25, 3:08 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Andi Kleen, (Wed Jul 25, 3:26 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Wed Jul 25, 3:46 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Hugh Dickins, (Thu Jul 26, 10:11 am)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Thu Jul 26, 2:35 pm)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Fri Jul 27, 6:36 pm)
Re: [patch] mm: reduce pagetable-freeing latencies, Hugh Dickins, (Fri Jul 27, 10:54 pm)
Re: [patch] mm: reduce pagetable-freeing latencies, Benjamin Herrenschmidt, (Sat Jul 28, 3:36 pm)