Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599669

Re: [PATCH v2] statx: optimize copy of struct statx to userspace

From Eric Biggers <ebiggers3@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] statx: optimize copy of struct statx to userspace
Date 2017-03-13 19:20 +0100
Message-ID <tkCJz-4on-3@gated-at.bofh.it> (permalink)
References (3 earlier) <tk1Al-3lE-5@gated-at.bofh.it> <tk2Zr-4xK-3@gated-at.bofh.it> <tk4RA-5Pv-15@gated-at.bofh.it> <tkpW1-3nD-5@gated-at.bofh.it> <tkvoJ-7zi-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Mar 13, 2017 at 11:27:32AM +0100, Florian Weimer wrote:
> On 03/13/2017 05:34 AM, Andreas Dilger wrote:
> >Not that it is a huge deal either way, but I'd think it is harder for the
> >compiler to optimize across a function call boundary like memset() vs. a
> >struct initialization in the same function where it can see that all but
> >a few of the fields are being overwritten immediately before they are used.
> 
> GCC treats memset as a function call only if options such as
> -ffreestanding or -fno-builtin are enabled, or if memset is
> redefined in a header file.  Does the kernel do this?
> 

No, it does not.  So gcc treats memset() as a request to clear memory, not as a
request to call a function called "memset()" specifically.  On x86_64 it's
compiling it into a "rep stos" instruction.

- Eric

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] statx: optimize copy of struct statx to userspace Eric Biggers <ebiggers3@gmail.com> - 2017-03-11 22:50 +0100
  Re: [PATCH v2] statx: optimize copy of struct statx to userspace Al Viro <viro@ZenIV.linux.org.uk> - 2017-03-12 02:30 +0100
    Re: [PATCH v2] statx: optimize copy of struct statx to userspace Eric Biggers <ebiggers3@gmail.com> - 2017-03-12 03:20 +0100
      Re: [PATCH v2] statx: optimize copy of struct statx to userspace Al Viro <viro@ZenIV.linux.org.uk> - 2017-03-12 03:40 +0100
        Re: [PATCH v2] statx: optimize copy of struct statx to userspace Eric Biggers <ebiggers3@gmail.com> - 2017-03-12 05:10 +0100
          Re: [PATCH v2] statx: optimize copy of struct statx to userspace Eric Biggers <ebiggers3@gmail.com> - 2017-03-12 07:10 +0100
            Re: [PATCH v2] statx: optimize copy of struct statx to userspace Andreas Dilger <adilger@dilger.ca> - 2017-03-13 05:40 +0100
              Re: [PATCH v2] statx: optimize copy of struct statx to userspace Florian Weimer <fweimer@redhat.com> - 2017-03-13 11:30 +0100
                Re: [PATCH v2] statx: optimize copy of struct statx to userspace Eric Biggers <ebiggers3@gmail.com> - 2017-03-13 19:20 +0100

csiph-web