From: Keith Busch <keith.busch@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Kirill Shutemov <kirill.shutemov@linux.intel.com>,
Dave Hansen <dave.hansen@intel.com>,
Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 1/6] mm/gup_benchmark: Time put_page
Date: Wed, 10 Oct 2018 16:40:51 -0600 [thread overview]
Message-ID: <20181010224051.GB11034@localhost.localdomain> (raw)
In-Reply-To: <20181010154111.e3b37422f31dcf3d6b73ebe0@linux-foundation.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 <keith.busch@intel.com> 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,
>
prev parent reply other threads:[~2018-10-10 22:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 19:56 [PATCH 1/6] mm/gup_benchmark: Time put_page Keith Busch
2018-10-10 19:56 ` [PATCH 2/6] mm/gup_benchmark: Add additional pinning methods Keith Busch
2018-10-10 19:56 ` [PATCH 3/6] tools/gup_benchmark: Fix 'write' flag usage Keith Busch
2018-10-10 19:56 ` [PATCH 4/6] tools/gup_benchmark: Allow user specified file Keith Busch
2018-10-10 22:31 ` Andrew Morton
2018-10-10 22:42 ` Keith Busch
2018-10-10 19:56 ` [PATCH 5/6] tools/gup_benchmark: Add MAP_SHARED option Keith Busch
2018-10-10 19:56 ` [PATCH 6/6] tools/gup_benchmark: Add MAP_HUGETLB option Keith Busch
2018-10-10 22:26 ` [PATCH 1/6] mm/gup_benchmark: Time put_page Andrew Morton
2018-10-10 22:28 ` Keith Busch
2018-10-10 22:41 ` Andrew Morton
2018-10-10 22:40 ` Keith Busch [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181010224051.GB11034@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).