From: John Hubbard <jhubbard@nvidia.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Peter Collingbourne <pcc@google.com>,
"Kirill A . Shutemov" <kirill@shutemov.name>,
Andrew Morton <akpm@linux-foundation.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Evgenii Stepanov <eugenis@google.com>,
Jann Horn <jannh@google.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
<linux-mm@kvack.org>, kernel test robot <lkp@intel.com>,
Linux API <linux-api@vger.kernel.org>,
<linux-doc@vger.kernel.org>
Subject: Re: [PATCH v4] mm: introduce reference pages
Date: Tue, 29 Jun 2021 10:48:20 -0700 [thread overview]
Message-ID: <3c77290d-3a79-9f41-f4ba-7eda399df150@nvidia.com> (raw)
In-Reply-To: <YNsK8bZ+S3VtsK9g@casper.infradead.org>
On 6/29/21 4:58 AM, Matthew Wilcox wrote:
> On Tue, Jun 29, 2021 at 12:19:22AM -0700, John Hubbard wrote:
>>> +SYSCALL_DEFINE2(refpage_create, const void *__user, content, unsigned long,
>>> + flags)
>>
>> From the API discussion (and using a simpler syntax to illustrate this), it
>> seems like the following would be close:
>>
>> enum content_type {
>> BYTE_PATTERN,
>> FOUR_BYTE_PATTERN,
>> ...
>> FULL_4KB_PAGE
>> };
>>
>> int refpage_create(const void *__user content, enum content_type, unsigned long flags);
>>
>> ...and if content_type == BYTE_PATTERN, then content is a pointer to just one byte of
>> data, and so forth for the other enum values.
>
> That seems a little more complicated and non-extensible.
This is true. I wasn't sure I liked it all that much, either, when I wrote
it. haha.
>
> int refpage_create(const void *__user content, unsigned int size,
> unsigned long flags);
>
That does seem better. The key is to have at least one more parameter.
Actually I forgot to include pattern data. In both of the approaches above,
flags is probably used for that, but if we already know that patterns
are being passed, then how about add a "pattern" arg? I think it's
good to leave a little room for flexibility and future extensions:
int refpage_create(const void *__user content, unsigned int size,
unsigned long pattern, unsigned long flags);
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2021-06-29 17:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-19 9:20 Peter Collingbourne
2021-06-28 12:24 ` Kirill A. Shutemov
2021-07-17 2:58 ` Peter Collingbourne
2021-06-28 13:10 ` Matthew Wilcox
2021-07-17 2:58 ` Peter Collingbourne
2021-06-28 19:33 ` Matthew Wilcox
2021-06-28 19:44 ` John Hubbard
2021-06-28 19:56 ` Matthew Wilcox
2021-07-17 2:58 ` Peter Collingbourne
2021-06-29 7:19 ` John Hubbard
2021-06-29 11:58 ` Matthew Wilcox
2021-06-29 17:48 ` John Hubbard [this message]
2021-06-29 18:21 ` Matthew Wilcox
2021-06-29 18:28 ` John Hubbard
2021-07-17 2:59 ` Peter Collingbourne
2021-07-19 20:47 ` David Hildenbrand
2021-07-19 20:50 ` David Hildenbrand
2021-07-19 22:26 ` Peter Collingbourne
2021-07-19 22:30 ` John Hubbard
2021-07-20 7:28 ` David Hildenbrand
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=3c77290d-3a79-9f41-f4ba-7eda399df150@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=eugenis@google.com \
--cc=jannh@google.com \
--cc=kirill@shutemov.name \
--cc=linux-api@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=pcc@google.com \
--cc=willy@infradead.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