Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Campbell <taniwha@gmail.com>
To: linux-riscv@lists.infradead.org
Subject: Re: prefetchw()
Date: Sun, 27 Jun 2021 15:44:28 +1200	[thread overview]
Message-ID: <2035172.PIDvDuAF1L@rata> (raw)
In-Reply-To: <2623321.7s5MMGUR32@rata>

On Sunday, 27 June 2021 3:31:18 PM NZST Paul Campbell wrote:
> i noticed today that __builtin_prefetch() emits nothing (at least in my gcc)
> 
> i wonder if it makes sense to do this for riscv linux?
> 
> static inline void prefetchw( volatile void  *addr)
> {
>         asm volatile("lb x0, 0(%0)" : : "r" (addr));
> }

I should add that gcc  __builtin_prefetch()  promises not to fault while the 
kernel prefetchw(), from my quick look through the code doesn't seem to depend 
on that (in fact loops get unrolled in places to make sure) 

	Paul



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2021-06-27  3:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-27  3:31 prefetchw() Paul Campbell
2021-06-27  3:44 ` Paul Campbell [this message]

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=2035172.PIDvDuAF1L@rata \
    --to=taniwha@gmail.com \
    --cc=linux-riscv@lists.infradead.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