Re: Software prefetching considered harmful

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

 



From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 May 2011 12:38:40 -0700

> On Thu, May 19, 2011 at 12:32 PM, David Miller <davem@xxxxxxxxxxxxx> wrote:
>>
>> It's been my experience that prefetch hurts more than it ever helps
>> for these list traversal functions.
>>
>> In fact I had been looking at some assembler output for files in the
>> networking and noticed how all of these list prefetch turds just take
>> up I-cache space.
>>
>> Please kill them off, you have my utmost support :-)
> 
> Hmm. Networking tends to use both hlist and regular lists. Does it go
> for both for you, or is one or the other more of an issue?

I think you should kill them off for all kinds of lists.

Here is one example for the non-hlist cast.  In the routing tables
we have a trie datastructure and this leads to a "struct list_head"
list of aliases.

Except in obscure setups, this list is only ever 1 entry long.  So
every prefetch is completely spurious.

There are several of these "1 entry list" cases, so it's not just
hlist that runs into this scenerio a lot.

So, to reiterate, I think you should kill all the list handling
prefetches off.

What we can do is say "for this specific list use, prefetch does
in fact help".  And provide an interface for that.  I imagine there
are things like inode dirty writeback or some dcache stuff that
walks large lists and for which prefetch might be appropriate.
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux