Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1484694imm; Wed, 10 Oct 2018 15:41:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV633nME+6dY0mG29oTrnQoeXpJjyFLiC8aOi8GEnfg6ZCrBJ0lxl4Y18U3XBqWcZpKHMhnx4 X-Received: by 2002:a63:9712:: with SMTP id n18-v6mr13625036pge.182.1539211318584; Wed, 10 Oct 2018 15:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539211318; cv=none; d=google.com; s=arc-20160816; b=ap1wXP6qWUoRnAPIPstuaAj15mOR/IOWjJWgk5Vtt3pqu+3aa2VHIfj/o1lOIIakQp kM4WQbtHQPlQ2Pq7W91IbVLsjXyNt7kJwCmUf+GGCPmfyxTCsxws/5TADga4v5kK7s/P ho+0fDwSJA9ddv3oMpF2FDhgBh6xaWf3ZVa2Bc6VwfiCeGqeNzpX0+wMH/oBGTKGe2Z2 Ud6bFQDKus5VwOhbrsjLgrXNLcrXaFUXpmiPuMVddj19HyEvwaMY/rN1mBTAjkCQavnk Ys4YSeVmt1AcRYvOHR1KOZ5kBEnWyQmClKeOn6qXTar41V6ZJKdcyHdC4iD6nlNG2NSm WNrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=CkJ4RvgGlwtx/pTSZ+iIxBNEEisUUlFfGJBXpNTtTDo=; b=QXGw/KZU+FQFD7p0xNOEdrOA8ftBiNowOyrurn34qj7qvTnRjDdeF53rTdMFRRPcK0 1i4nz0KSCgNrx+XKjsqRBOw/dS3zHkCYpT2UErvAfrf9ga8Nm4Q/zNwGMOOANJYCujDA 4V8evFxfdFoF1nEk/Xhv6TtWhSrtw2r06eHXItdZndSJDoRh7VjQQna7n6Tre8vi/YgX 9EKdtepibvP66eBXkXw1Ui8/erCiDJiczNXt3IPYpf8p1pceyidrq5jukyuDFuxn7QiE GF7DtqI/flKRZJIfiAW1chFERBnlp4XEYkTFdHdK2NOeKhWvEMFMcyTny/TRMNQqzxbw Mlkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s64-v6si27710542pfi.134.2018.10.10.15.41.43; Wed, 10 Oct 2018 15:41:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726016AbeJKGF1 (ORCPT + 99 others); Thu, 11 Oct 2018 02:05:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45366 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725968AbeJKGF1 (ORCPT ); Thu, 11 Oct 2018 02:05:27 -0400 Received: from localhost.localdomain (c-24-4-154-175.hsd1.ca.comcast.net [24.4.154.175]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 238F88D4; Wed, 10 Oct 2018 22:41:12 +0000 (UTC) Date: Wed, 10 Oct 2018 15:41:11 -0700 From: Andrew Morton To: Keith Busch Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kirill Shutemov , Dave Hansen , Dan Williams Subject: Re: [PATCH 1/6] mm/gup_benchmark: Time put_page Message-Id: <20181010154111.e3b37422f31dcf3d6b73ebe0@linux-foundation.org> In-Reply-To: <20181010222843.GA11034@localhost.localdomain> References: <20181010195605.10689-1-keith.busch@intel.com> <20181010152655.8510270e5db753f6666f12d3@linux-foundation.org> <20181010222843.GA11034@localhost.localdomain> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Oct 2018 16:28:43 -0600 Keith Busch wrote: > > > struct gup_benchmark { > > > - __u64 delta_usec; > > > + __u64 get_delta_usec; > > > + __u64 put_delta_usec; > > > __u64 addr; > > > __u64 size; > > > __u32 nr_pages_per_call; > > > > If we move put_delta_usec to the end of this struct, the ABI remains > > back-compatible? > > If the kernel writes to a new value appended to the end of the struct, > and the application allocated the older sized struct, wouldn't that > corrupt the user memory? Looks like it. How about we do this while we're breaking it? --- a/mm/gup_benchmark.c~mm-gup_benchmark-time-put_page-fix +++ a/mm/gup_benchmark.c @@ -14,6 +14,7 @@ struct gup_benchmark { __u64 size; __u32 nr_pages_per_call; __u32 flags; + __u64 expansion[10]; /* For future use */ }; static int __gup_benchmark_ioctl(unsigned int cmd,