From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbdCPLls (ORCPT ); Thu, 16 Mar 2017 07:41:48 -0400 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 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BB6E6C208063 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dhowells@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BB6E6C208063 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 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> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 16 Mar 2017 11:41:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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