Re: [RFC] non-refcounted pages, application to slab?

From: Nick Piggin
Date: Wed Jan 25 2006 - 04:55:00 EST


On Wed, Jan 25, 2006 at 10:54:08AM +0100, Eric Dumazet wrote:
> Nick Piggin a écrit :
>
> >@@ -2604,10 +2604,10 @@ static inline void *__cache_alloc(kmem_c
> >
> > local_irq_save(save_flags);
> > objp = ____cache_alloc(cachep, flags);
> >+ prefetchw(objp);
> > local_irq_restore(save_flags);
> > objp = cache_alloc_debugcheck_after(cachep, flags, objp,
> > __builtin_return_address(0));
> >- prefetchw(objp);
> > return objp;
> > }
>
> I'm not sure why you moved this prefetchw(obj) : This is not related to
> your 'non-refcounting' part, is it ?
>

Stray hunk. Thanks.

Nick

> When I added this prefetchw in slab code, I did place it *after* the
> local_irq_restore(save_flags); because I was not sure if the
> serialization/barrier (popf) would force the cpu (x86/x86_64 in mind) to
> either :
> - finish all the loads (even if they are speculative/hints) (so giving a
> bad latency)
> - cancel the speculative loads (so prefetchw() *before* the
> local_irq_restore() would be useless.
>
Makes sense.

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