From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64C45C636D6 for ; Thu, 23 Feb 2023 19:04:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EEBA46B0072; Thu, 23 Feb 2023 14:04:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E9BEF6B0073; Thu, 23 Feb 2023 14:04:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D63D06B0074; Thu, 23 Feb 2023 14:04:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C70FD6B0072 for ; Thu, 23 Feb 2023 14:04:38 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A742CAB4ED for ; Thu, 23 Feb 2023 19:04:38 +0000 (UTC) X-FDA: 80499483036.04.A855BD2 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by imf01.hostedemail.com (Postfix) with ESMTP id AAF8B4002C for ; Thu, 23 Feb 2023 19:04:36 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=rryl29Z+; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.208.181 as permitted sender) smtp.mailfrom=axelrasmussen@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677179076; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gX7QhWX8iQivKPSPekH4AH3P6f8FH7Ng/txrWhsq3BI=; b=rdmeZOeZLxAXYbaQhO8FyThj/6LIvle9Cd10w8R16zTOsg7iAoM7X+Qkpocl5GHGDY2y3g hxFGaMyBzM7zcSm9uzWcZktAuiuanv5LYn3fh4VvYvqXZhtIrGuzC/VpGc+EkYB0/oJvRI WgqZlCZlDEGQytlzzSANpRd2XGibKys= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=rryl29Z+; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.208.181 as permitted sender) smtp.mailfrom=axelrasmussen@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677179076; a=rsa-sha256; cv=none; b=iOudyZZqziJDmUYLRzIB5wlNrVu9lAA7chwFDc6l1nQDHYf33bGJ9mB7a0WnR80rN69XQ5 toWcEpA7jzXHj0OiLrx9fGSGbHHaF6WZKyrArNOLRWurf3ZWwDVY8tDDDwMPyVEgw85mwN Heq0PsNqo1abPYrFLBIjIwaXGkfGya4= Received: by mail-lj1-f181.google.com with SMTP id y14so4717679ljq.4 for ; Thu, 23 Feb 2023 11:04:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gX7QhWX8iQivKPSPekH4AH3P6f8FH7Ng/txrWhsq3BI=; b=rryl29Z+VPN0/H7Xx2tRtQhAtWz+1bWdopkxj7YsNgAfMDH6XoykE2VF/qJrPvoQZ4 wMaL75cdyFi4FlzTMfr5HMRkv1/WwyvWpShSRUkUqYRxAq6oW4JI38zpKMK5C7QUpCNv j2oLuOYmQU9htXpps+UCrDAEoxMzFD3jSf8RQREUl94z4DqMuPeij1KWClWB60QwDD3w PXFIHhmiwpIpN1oAQqZ8ldYUVsLTO2Yk9gJx5ORzahZ1fHhA+uNrDBk5a4l05PBanIOJ YGlNwKL073WNmbFWhZ7gxtPAG6fdzLEoNaaPHjTzmSS5EyOeGaorKpiFagra5jwCSpnj hY8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gX7QhWX8iQivKPSPekH4AH3P6f8FH7Ng/txrWhsq3BI=; b=mVJ/iMH5JEoCmQEDnUQVgwKk/Aye3NRbXVEFQONTbQpdifEIg2O6xJrOQtKzH200bT +lvX0SByL0aCNr+Ef0XV811CXSa/9HPYygjtROQIjg4/zfAOMrZHnhlFHBRusH0Rylma dbxF8QNqFMuS+1Aclmh2IAnLb3O5Umw6M4N/Y99RhiTfM5Y5C+JY2uHVhKyl5AQML0n6 WFwK8emtU695q7lHsFficLQ84itLoleO+QAyTOrB8pYmuQujzqsnzYojxvPDl/0dHr+P o0lv+QSTEyQ1jFbBAIVi3FfqC2ZVLBphfwH7+TXIOVg+154g9ARyQ8bDrFg0u1FOc4dV g3WQ== X-Gm-Message-State: AO0yUKVcPh4DiN/ynFczxJjRlHXxYZFED6Wi4pDtY63y6lz6Et7g/gSn MEnrNm2J4fejOdaraf1k5V2jre1vwOm9WaKtAEZDoQ== X-Google-Smtp-Source: AK7set/5wjxRhOgUKDeWCKEsXZ58YkdXG/NZo9H3PQT6/dkYtyZwIuorwOkoEgM0jcsygHkOtz30w9CMZYXtRMP7b/I= X-Received: by 2002:a2e:aa1c:0:b0:293:4ed3:a404 with SMTP id bf28-20020a2eaa1c000000b002934ed3a404mr3984302ljb.2.1677179074637; Thu, 23 Feb 2023 11:04:34 -0800 (PST) MIME-Version: 1.0 References: <20230223005754.2700663-1-axelrasmussen@google.com> <20230223005754.2700663-4-axelrasmussen@google.com> In-Reply-To: From: Axel Rasmussen Date: Thu, 23 Feb 2023 11:03:58 -0800 Message-ID: Subject: Re: [PATCH v2 3/5] mm: userfaultfd: combine 'mode' and 'wp_copy' arguments To: Nadav Amit Cc: Alexander Viro , Andrew Morton , Hugh Dickins , Jan Kara , "Liam R. Howlett" , Matthew Wilcox , Mike Kravetz , Mike Rapoport , Muchun Song , Peter Xu , Shuah Khan , James Houghton , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kselftest@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: AAF8B4002C X-Stat-Signature: 97yhys9bqyrimwnic5xxj4xkix656rws X-HE-Tag: 1677179076-330567 X-HE-Meta: U2FsdGVkX1+xSUGdixy9QWgUuoIAcOpkqwF9VEkpQoJxUpbkDuwrrRRf9FhjFnQ/KUHOICqvmahqiItJ3WVWEm6dhVUllAknWC359zY0uDeVzZ1y23NAI8Yd1F5rAtXN/o8+dmDYE63oZIBGy9kar/1ZtFO822hkZBu8CbPwXRGFBC6XkuQfvcQa22VTXbXV5GRTviv9HBxNRObdg4HiRjeZvhacy5tYVtZ5kqrfAXX+xHTKHOwFGqrGFrudzqxUgCTq9rgueh/oHIDiRP7vyubS9Em7vRfs5xDPKOVEWyXUfYvQdWKWf2Cllau4XZmi1jVD4S8yoNTJ7z51TGJvOFTzV7ctny1tqauQb31vZsRW99o/xiatqeTzzfHs1BkF094ntId8hsh6RW98vdFTfxgJpDrSG4uuWD6uwjY54rAwJT6gkDIW6UHJnk1znKvWm8irztMBTv/GeKY9k99wyHQezgInl/Ux3Adzr3yYCnlTmu8X0uso77Qi8T7CfCS+ronU2f+XY+raI0nZ/7S+ySiLebXbtWnu66q63RJlUaEccWEptZajBEoRXKnK1atrpFIBqIzvTP62KFK241afaTqubMRX6hNOSaC/DmP6lrnKhKf0UBIfU1SV9fszPOCMbDK4NQs3rEglHktJ7CWXv4BudZPyYnLrbI9kzXp4CQ9MHukJuHE8RJST/A1GLVdwEWJKg/Pr9xSpGzStD8dIgL7nZ5sGVrkTLjPI7MDDVYZm7QpfyqCR+xh0DNz/SAWnLdUcIcTqrYYKfPgjz/BjZGkpBCdE5sut0tgRoVn3Njcqv6KVskltHH9dnHDQIPwyPrmB9PO8xY96zHBreuohCvzIeV8YJ2/FeDNB4Awe0MWXUwe9o9NvfaLI8MJshb2p/potwRwbpZU/PvVkKIj/gyJHxzYC0wz8QK82kKjNs2lIM78y3W+yCcjF9tDZhu1I4PZlX7TP68s0uyC7szF MxEUhemW qRtbaGeKiLGp/hYVavNY2q0xp6QIVmBYVMBcavfgSY74+CuK2/pZAbdYAnKWyEMNR9D01llxrJlygwVLh/d1NgDh4AGTpYGhQsXXRb9xPYKKaHJX5dkN+MjQrdrDKoGiW/MF9jHTznzaFn1pZc2wLCnO4uzaQh8ptZJZZEzjZyi/LBLdTW1KlgotYK13rKlS+p37TEz2d65iOFQi9SSaEySsy4Ipp6Y4999py7++jPCmCyzshiPyLoMgBcOh4KW14OtsF8kfGfB1sSe2SxxOLQ/TCtYqNhyg0LtBpzSx/oSG65E1hPUVk/pRnH/Rk1NlyC1upaW2oX5ypJXAnYNBxjcR4jFpu+mYl3NZCyidKDXhnJfkAFk5A3zADyztBWHrbcsCT X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 23, 2023 at 10:51 AM Nadav Amit wrote: > > > > > On Feb 22, 2023, at 4:57 PM, Axel Rasmussen = 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, stor= e > > 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 > > Hi Axel, > > I sent a patch a long time ago called =E2=80=9Cuserfaultfd: introduce uff= d_flags=E2=80=9D. > 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 =E2=80=9Cflags= =E2=80=9D is > a very generic name, perhaps you=E2=80=99d 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. >