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


Groups > linux.kernel > #1602210

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

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4] statx: optimize copy of struct statx to userspace
Date 2017-03-16 12:50 +0100
Message-ID <tlC4O-684-9@gated-at.bofh.it> (permalink)
References <tkGNb-7uk-9@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


Eric Biggers <ebiggers3@gmail.com> wrote:

> stat() instead initializes its struct on the stack and copies it to
> userspace with a single call to copy_to_user().  This turns out to be
> much faster, and changing statx to do this makes it almost as fast as
> stat:

I wonder if we actually need to copy __spare2 at the end.  We could define any
future values added in there to be unset/undefined if the respective bits are
not set.

I would prefer it to be cleaner, however, and clear the unused space.

Another thought is does it make sense to rearrange struct kstat to mirror
the first part of struct statx so that this can be memcpy'd?

David

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


Thread

Re: [PATCH v4] statx: optimize copy of struct statx to userspace David Howells <dhowells@redhat.com> - 2017-03-16 12:50 +0100
  Re: [PATCH v4] statx: optimize copy of struct statx to userspace Eric Biggers <ebiggers3@gmail.com> - 2017-03-24 22:10 +0100

csiph-web