Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:41152 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbdCPLlo (ORCPT ); Thu, 16 Mar 2017 07:41:44 -0400 From: David Howells In-Reply-To: <20170313222836.105526-1-ebiggers3@gmail.com> References: <20170313222836.105526-1-ebiggers3@gmail.com> To: Eric Biggers Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, Al Viro , linux-kernel@vger.kernel.org, Eric Biggers Subject: Re: [PATCH v4] statx: optimize copy of struct statx to userspace MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3433.1489664501.1@warthog.procyon.org.uk> Date: Thu, 16 Mar 2017 11:41:41 +0000 Message-ID: <3434.1489664501@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Eric Biggers 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