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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48EF2C64ED8 for ; Thu, 23 Feb 2023 19:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230183AbjBWTEj (ORCPT ); Thu, 23 Feb 2023 14:04:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjBWTEi (ORCPT ); Thu, 23 Feb 2023 14:04:38 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B35F331E24 for ; Thu, 23 Feb 2023 11:04:36 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id j17so12007281ljq.11 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=lptor8AkdhhcI+5zzAdNugNuzLfjwqqNXQ04Njg9vDOmg3RdDg4TkPfOJ3YV0X4bCk k0rdFLd5F46IDi8ItMTwbN/q5RtvfwY+fnEqhFLp+iI4eCUMzNmtpdMWoWGS0jRMHOJe RlX+xvZ2eLMmXCPgw3LQWv1MulxzLBEHdF6gNnf7dfC4nbx5SGLxzR/geJ6P0Tp1/6Fe oZ5b8E9gcOeEf450j26pVXf9QZ6PTxiLs1Yp0CEMM5A7aIVdfxpJu8xYb88fJY7Tl5Zw u0bhxCToIH+y86cwriZKVa+l/pMCe2bkXR7qXzUHvK323hRnic9DNDjhb2ynNDGqlS+f zTEg== X-Gm-Message-State: AO0yUKXyJBjeJToxuFUTiF+agtMGSBGyA4aJRm6XGxRiUf+pynfLZMJ2 Wi3tJuGTamLbi3HrhYDSCJLiDs7ZRGz2FEgx76j0Qg== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >