All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gavin Shan <gshan@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org, peterx@redhat.com,
	alex@shazbot.org, berrange@redhat.com, philmd@oss.qualcomm.com,
	philmd@mailo.com, david@kernel.org, clg@redhat.com,
	pbonzini@redhat.com, phrdina@redhat.com, jugraham@redhat.com,
	liugang24219@sangfor.com.cn, dinghui@sangfor.com.cn,
	shan.gavin@gmail.com
Subject: Re: [PATCH v2 1/2] system/memory: Use qemu_ram_{copy, move}() in ram device region accessors
Date: Tue, 16 Jun 2026 01:32:29 -0400	[thread overview]
Message-ID: <20260616012616-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <07119a34-d8d2-4e52-b566-267830b51a09@redhat.com>

On Tue, Jun 16, 2026 at 03:21:58PM +1000, Gavin Shan wrote:
> On 6/16/26 3:17 PM, Michael S. Tsirkin wrote:
> > On Tue, Jun 16, 2026 at 02:55:52PM +1000, Gavin Shan wrote:
> > > On 6/16/26 2:49 PM, Michael S. Tsirkin wrote:
> > > > On Mon, Jun 15, 2026 at 09:48:00PM -0700, Richard Henderson wrote:
> > > > > On 6/15/26 21:23, Michael S. Tsirkin wrote:
> > > > > > B. Also on x86, I do not see why we should not use memcpy for large
> > > > > > accesses if we can. Better perf.
> > > > > 
> > > > > We have an example where memcpy writes to the same location 3 times.
> > > > > This is not appropriate for any host.
> > > > > 
> > > > > 
> > > > > r~
> > > > 
> > > > as in, same byte?  could you share the details pls?
> > > > 
> > > 
> > > This issue happened on aarch64 only.
> > > 
> > > https://lore.kernel.org/qemu-devel/CAFEAcA8dwHV8F48kb-013rxkG9kKcZhym9_qarKmoeUfeh0YWw@mail.gmail.com/
> > > 
> > > Thanks,
> > > Gavin
> > 
> > oh wow. thanks for sharing!
> > 
> > Still I think for sizes outside of 2,4,8 it's fine?
> > That is where the perf is.
> > 
> 
> For that point, I agree with you that it's fine to use memcpy/memmove
> when the length is 16-bytes or more,
> unless Richard is concerned by
> this.

yea size cutoff is a heuristic but i guess it's the best we can do.  or
disable memcpy completely if Richard feels strongly about it. But it
seems like a waste.


> I'm posting (v3) and lets continue the discussion on (v3) series. Sorry
> for taking your guys so many time to review and discuss ;-)
> 
> Thanks,
> Gavin
> 


pls do include the list of issues and high level solution in the cover
letter though.



  reply	other threads:[~2026-06-16  5:33 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15 10:01 [PATCH v2 0/2] system/memory: Make ram device region directly accessible Gavin Shan
2026-06-15 10:01 ` [PATCH v2 1/2] system/memory: Use qemu_ram_{copy, move}() in ram device region accessors Gavin Shan
2026-06-15 10:57   ` Peter Maydell
2026-06-15 14:48     ` Michael S. Tsirkin
2026-06-15 14:56     ` Michael S. Tsirkin
2026-06-15 15:12       ` Peter Maydell
2026-06-15 19:24         ` Gavin Shan
2026-06-15 19:42           ` Michael S. Tsirkin
2026-06-15 21:31             ` Gavin Shan
2026-06-16  4:22               ` Gavin Shan
2026-06-16  4:36                 ` Michael S. Tsirkin
2026-06-16  4:23               ` Michael S. Tsirkin
2026-06-16  4:48                 ` Richard Henderson
2026-06-16  4:49                   ` Michael S. Tsirkin
2026-06-16  4:55                     ` Gavin Shan
2026-06-16  5:17                       ` Michael S. Tsirkin
2026-06-16  5:21                         ` Gavin Shan
2026-06-16  5:32                           ` Michael S. Tsirkin [this message]
2026-06-16  4:59                   ` Michael S. Tsirkin
2026-06-16  5:07                     ` Gavin Shan
2026-06-16  5:25                       ` Michael S. Tsirkin
2026-06-15 19:52         ` Michael S. Tsirkin
2026-06-15 15:17   ` Richard Henderson
2026-06-15 16:33     ` Gavin Shan
2026-06-15 17:03       ` Richard Henderson
2026-06-15 18:09         ` Gavin Shan
2026-06-15 18:33           ` Richard Henderson
2026-06-15 19:40           ` Michael S. Tsirkin
2026-06-16  4:18             ` Gavin Shan
2026-06-15 16:35     ` Michael S. Tsirkin
2026-06-15 16:37       ` Michael S. Tsirkin
2026-06-15 17:05       ` Richard Henderson
2026-06-15 10:01 ` [PATCH v2 2/2] system/memory: Make ram device region directly accessible Gavin Shan

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=20260616012616-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex@shazbot.org \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=david@kernel.org \
    --cc=dinghui@sangfor.com.cn \
    --cc=gshan@redhat.com \
    --cc=jugraham@redhat.com \
    --cc=liugang24219@sangfor.com.cn \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@mailo.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=phrdina@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shan.gavin@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.