public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jon@solid-run.com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/28432] Aarch64 memcpy used on device-memory
Date: Wed, 13 Oct 2021 16:36:57 +0000	[thread overview]
Message-ID: <bug-28432-131-5ZLW2lMgDt@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28432-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28432

--- Comment #3 from Jon Nettleton <jon@solid-run.com> ---
(In reply to Wilco from comment #2)
> (In reply to Jon Nettleton from comment #0)
> 
> > This does fix the issue I was trying to solve in both my specific test case
> > as well as a few real world rendering failures.  Since we are only
> > re-ordering stp's there should be no functional or performance regressions,
> > and all the glibc test's do pass.
> 
> It's not clear what the underlying issue is, but I don't believe reordering
> stores would be sufficient - it might depend on alignment, state of the
> writebuffer, cache miss/hit and many other factors that software can't
> control.
> 
> So my first question is whether this works around the issue 100%, ie. for
> all possible combinations of src and dst alignment, overlap (for memmove)
> and sizes?

This fixes a singular issue that we were seeing and was reproducible with this
modified version of a previous test program that was done when the problem was
first detected on the Macchiatobin. 
https://gist.github.com/jnettlet/80f8d09d01c0dc0ffc0122f36ed78de6

The issue addressed here is purely overlapping writes to device memory of sizes
97-110 would have bytes starting or immediately after 64 bytes that would be
either zero'd or unchanged.

This behaviour could be successfully worked around by simple breaking up
memcpy's of that size range into smaller copies. 
https://gist.github.com/jnettlet/80f8d09d01c0dc0ffc0122f36ed78de6#file-fb_test-c-L98

This does not solve all GPU rendering issues, I have another patch for that but
this does resolve the issues in my test program, as well as rendering errors
that were seen in glmark2 -b terrain as well as the game minetest that still
existed with my mesa patch.  Because these issues still existing with my
patched mesa I believe this is a separate bug.

This is another developer that reported the issues to me testing my glibc with
this patch included. https://twitter.com/sahajsarup/status/1445813643744985093

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-10-13 16:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 12:39 [Bug libc/28432] New: " jon@solid-run.com
2021-10-07 12:59 ` [Bug libc/28432] " adhemerval.zanella at linaro dot org
2021-10-13 12:36 ` wdijkstr at arm dot com
2021-10-13 16:36 ` jon@solid-run.com [this message]
2021-10-13 18:28 ` nsz at gcc dot gnu.org
2021-10-14  4:15 ` jon@solid-run.com
2021-10-14  8:53 ` david at qore dot org
2021-10-25 16:46 ` nsz at gcc dot gnu.org
2021-10-26  7:01 ` jon@solid-run.com
2021-11-29 16:18 ` sam at gentoo dot org

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=bug-28432-131-5ZLW2lMgDt@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).