From: Catalin Marinas <catalin.marinas@arm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>,
torvalds@linux-foundation.org, linux-arch@vger.kernel.org,
benh@kernel.crashing.org, rmk@arm.linux.org.uk
Subject: Re: Software prefetching considered harmful
Date: Fri, 20 May 2011 17:01:34 +0100 [thread overview]
Message-ID: <BANLkTikKSL8=wngi0ZvuRH4YOqe0FmWh2A@mail.gmail.com> (raw)
In-Reply-To: <20110519233400.GA1954@elte.hu>
On 20 May 2011 00:34, Ingo Molnar <mingo@elte.hu> wrote:
> * David Miller <davem@davemloft.net> wrote:
>
>> So, to reiterate, I think you should kill all the list handling
>> prefetches off.
>
> Agreed.
>
>> 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.
>
> I think the best 'interface' for that is to open-code the prefetch()
> right into the loop. This way it becomes well documented and very
> visible as well.
I talked to some of the CPU people in ARM and, while there are a
variety of ARM implementations, for many of them prefetch(0) would
result in a TLB miss and go for an expensive page table walk. For
mostly 1-element lists like hash table look-up it's not worth having
the prefetch (could make it worse).
Prefetch is indeed useful for traversing longer lists (and probably
more work inside the loop) but I guess we can code the prefetch()
explicitly as Dave and Ingo suggested.
--
Catalin
next prev parent reply other threads:[~2011-05-20 16:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 17:12 Software prefetching considered harmful Linus Torvalds
2011-05-19 19:05 ` Linus Torvalds
2011-05-19 19:28 ` Ingo Molnar
2011-05-21 3:37 ` Michael Cree
2011-05-21 4:18 ` Benjamin Herrenschmidt
2011-05-21 10:42 ` Ingo Molnar
2011-05-19 19:32 ` David Miller
2011-05-19 19:38 ` Linus Torvalds
2011-05-19 19:47 ` David Miller
2011-05-19 23:34 ` Ingo Molnar
2011-05-20 16:01 ` Catalin Marinas [this message]
2011-05-20 1:42 ` Benjamin Herrenschmidt
2011-05-20 8:34 ` Ingo Molnar
2011-05-20 9:13 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTikKSL8=wngi0ZvuRH4YOqe0FmWh2A@mail.gmail.com' \
--to=catalin.marinas@arm.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rmk@arm.linux.org.uk \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).