linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Axel Rasmussen <axelrasmussen@google.com>
To: Nadav Amit <namit@vmware.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Hugh Dickins <hughd@google.com>, Jan Kara <jack@suse.cz>,
	 "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Matthew Wilcox <willy@infradead.org>,
	 Mike Kravetz <mike.kravetz@oracle.com>,
	Mike Rapoport <rppt@kernel.org>,
	 Muchun Song <muchun.song@linux.dev>,
	Peter Xu <peterx@redhat.com>, Shuah Khan <shuah@kernel.org>,
	 James Houghton <jthoughton@google.com>,
	 "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	 "linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH v2 3/5] mm: userfaultfd: combine 'mode' and 'wp_copy' arguments
Date: Thu, 23 Feb 2023 11:03:58 -0800	[thread overview]
Message-ID: <CAJHvVcj_NKp8wOUL5D2GX61xp0Rvzy6Z8gvL_G=qogsJreiGTQ@mail.gmail.com> (raw)
In-Reply-To: <F3D3DA6C-0AEC-4947-9E2F-7A9773296A5D@vmware.com>

On Thu, Feb 23, 2023 at 10:51 AM Nadav Amit <namit@vmware.com> wrote:
>
>
>
> > On Feb 22, 2023, at 4:57 PM, Axel Rasmussen <axelrasmussen@google.com> wrote:
> >
> > Many userfaultfd ioctl functions take both a 'mode' and a 'wp_copy'
> > argument. In future commits we plan to plumb the flags through to more
> > places, so we'd be proliferating the very long argument list even
> > further.
> >
> > Let's take the time to simplify the argument list. Combine the two
> > arguments into one - and generalize, so when we add more flags in the
> > future, it doesn't imply more function arguments.
> >
> > Since the modes (copy, zeropage, continue) are mutually exclusive, store
> > them as an integer value (0, 1, 2) in the low bits. Place combine-able
> > flag bits in the high bits.
> >
> > Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
>
> Hi Axel,
>
> I sent a patch a long time ago called “userfaultfd: introduce uffd_flags”.
> For some reason it does not appear on lore, but you were a recipient.
>
> It was pretty similar, but one thing that I preferred in my version is
> that it defined a different type to avoid confusion. Since “flags” is
> a very generic name, perhaps you’d like to adapt this approach.

Oh! I must have missed it, or just forgot. I'll take a look and see
about making some improvements. I'll also be sure to credit you in the
commit message.

>


  reply	other threads:[~2023-02-23 19:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  0:57 [PATCH v2 0/5] mm: userfaultfd: refactor and add UFFDIO_CONTINUE_MODE_WP Axel Rasmussen
2023-02-23  0:57 ` [PATCH v2 1/5] mm: userfaultfd: rename functions for clarity + consistency Axel Rasmussen
2023-02-23  0:57 ` [PATCH v2 2/5] mm: userfaultfd: don't pass around both mm and vma Axel Rasmussen
2023-02-23  0:57 ` [PATCH v2 3/5] mm: userfaultfd: combine 'mode' and 'wp_copy' arguments Axel Rasmussen
2023-02-23 17:31   ` James Houghton
2023-02-23 18:51   ` Nadav Amit
2023-02-23 19:03     ` Axel Rasmussen [this message]
2023-02-23 19:08       ` Nadav Amit
2023-02-23  0:57 ` [PATCH v2 4/5] mm: userfaultfd: don't separate addr + len arguments Axel Rasmussen
2023-02-23  0:57 ` [PATCH v2 5/5] mm: userfaultfd: add UFFDIO_CONTINUE_MODE_WP to install WP PTEs Axel Rasmussen

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='CAJHvVcj_NKp8wOUL5D2GX61xp0Rvzy6Z8gvL_G=qogsJreiGTQ@mail.gmail.com' \
    --to=axelrasmussen@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=jthoughton@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=muchun.song@linux.dev \
    --cc=namit@vmware.com \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --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