Re: [PATCH] Remove implicit list prefetches for most cases

From: Paul Moore
Date: Wed Sep 08 2010 - 08:33:15 EST


On Wed, 2010-09-08 at 10:59 +0200, Andi Kleen wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> We've had explicit list prefetches in list_for_each and friends
> for quite some time. According to Arjan they were originally
> added for K7 where they were a slight win.
>
> It's doubtful they help very much today, especially on newer CPUs with
> aggressive prefetching. Most list_for_eachs bodies are quite short and
> the prefetch does not help if it doesn't happen sufficiently in advance
> or when the data is not really cache cold.
>
> The feedback from CPU designers is that they don't like us using explicit
> prefetches unless there is a very good reason (and list_for_each* alone
> clearly isn't one)
>
> Also the prefetches cause the list walks to generate bad code,
> increase the number of registers needed.

If prefetch() is generally considered a "Bad Thing", I'm OK with just
removing them from NetLabel; no need to rename and conditionalize. I
put them in the netlbl_af[4,6]list_*() routines because those routines
were modeled after the normal list routines which had prefetches and I
just assumed someone much smarter had found them to be a win.

--
paul moore
linux @ hp


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