Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1486748imm; Wed, 10 Oct 2018 15:44:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dvMOOEeq9jlTm4It3LUh6dDQyx/oPgh59l5uFu3DsdgfxkW6ZlP/ZH22CyvHkxMruRGoz X-Received: by 2002:a62:9951:: with SMTP id d78-v6mr36093009pfe.239.1539211487940; Wed, 10 Oct 2018 15:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539211487; cv=none; d=google.com; s=arc-20160816; b=lJhrLHWgyjfw9gfz8oHqmZwSuD+Yw5lOWIG8iCkmUFnBVRc2GzNRIE3EBHb9uE5FBr TIDUUGQssekv3MMWK3oFFFjrubztsfJ6QN0/H0QjM3f36XAAHmD7HhxHoqBibnSz5TKf AOoPb/wbx8G8DxJkJc3dEMQQ3yPKyx9Af0J6KaPQLpNCgxnnUzHkDmjChmuhzHVm+TTB kSAB81lSO+w6eApwAUKkw57p3/Whvtb4uye114GLtWUEcSNTLhIZtnF1loCGBMqzT7+5 ZUu4lmXNj8WkruNCzYWXORQcir/oMj6FlhfD5G6GZIEbY1lRUDO2P3sCWI9T5qla3EyT aWSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=W6b71SJVto8mrs5Eq4Ni0g3t7f/NzP6WoINnaOVYMUA=; b=nlhN9c2wm1KPDNWceiK3asxWktEUjsIsI3VGvGP9T73CCdMGvDiWlULsCUrakXqXIB R8l5IrG0WUWcuK41eRRq+TQeshnCVZzYrYL7D2btMPcrN3wiSpQUS5lcsYleBSUL24oo yU1waq+oCiMMuX1S+owIorqDcy71ulFDyzMnx8zlh1GllFJ9LfnEwv5l2bYpKppwGNg5 KlO2KB2DacjQxo2iwzGHy2RsfXUyT882g1YnFxWPF0hRkdyc/aEtpS6gqJ7k2no6SLV0 AWyYa5IoOje0pec0/vtHgs94s2waNzaNB1hzVq/c7iOFp5GJE+jQAYc/qCU875wvm60e lulA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si26405378pll.381.2018.10.10.15.44.32; Wed, 10 Oct 2018 15:44:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726016AbeJKGIY (ORCPT + 99 others); Thu, 11 Oct 2018 02:08:24 -0400 Received: from mga12.intel.com ([192.55.52.136]:65173 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725968AbeJKGIY (ORCPT ); Thu, 11 Oct 2018 02:08:24 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2018 15:44:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,366,1534834800"; d="scan'208";a="264651589" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by orsmga005.jf.intel.com with ESMTP; 10 Oct 2018 15:43:53 -0700 Date: Wed, 10 Oct 2018 16:40:51 -0600 From: Keith Busch To: Andrew Morton 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: <20181010224051.GB11034@localhost.localdomain> References: <20181010195605.10689-1-keith.busch@intel.com> <20181010152655.8510270e5db753f6666f12d3@linux-foundation.org> <20181010222843.GA11034@localhost.localdomain> <20181010154111.e3b37422f31dcf3d6b73ebe0@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181010154111.e3b37422f31dcf3d6b73ebe0@linux-foundation.org> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 10, 2018 at 03:41:11PM -0700, Andrew Morton wrote: > 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? Yep, that sounds good to me! > --- 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, >