Re: [PATCH] mm/slab.c : prefetchw the start of new allocated objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Dumazet <[email protected]> wrote:
>
> Most of objects returned by __cache_alloc() will be written by the caller,
>  (but not all callers want to write all the object, but just at the begining)
>  prefetchw() tells the modern CPU to think about the future writes, ie start
>  some memory transactions in advance.

Sounds sensible enough..  slab does try to make sure it returns the
most-recently-freed object, so it's probably in cache already.  But in the
situation where we're allocating and using a lot of objects in succession
it might help.


>  Some CPU lacks a prefetchw() and currently do nothing, so I ask this question :
>  Should'nt make prefetchw() do at least a prefetch() ? A read hint is better than nothing.

Don't think so.  I was once told that if the cacheline is in local cache
for reading and the CPU decides to write to it, additional work is needed
for the write so the prefetch-for-read didn't buy you anything.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux