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

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

 



[MM] slab.c : prefetchw the start of new allocated objects

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.

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.


Signed-off-by: Eric Dumazet <[email protected]>

diff -Nru linux-2.6.13-rc4/mm/slab.c linux-2.6.13-rc4-ed/mm/slab.c
--- linux-2.6.13-rc4/mm/slab.c	2005-07-29 00:44:44.000000000 +0200
+++ linux-2.6.13-rc4-ed/mm/slab.c	2005-07-29 10:48:45.000000000 +0200
@@ -2166,6 +2166,7 @@
 	}
 	local_irq_restore(save_flags);
 	objp = cache_alloc_debugcheck_after(cachep, flags, objp, __builtin_return_address(0));
+	prefetchw(objp);
 	return objp;
 }
 

[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