Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1744257rdb; Thu, 7 Dec 2023 07:43:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEi/46Rxou0kPI9M8jHd2JRw1bPpkOv/ffzv03J+m7Tq8j52wnNh3E5LL6mZpEutX4WeY1L X-Received: by 2002:a05:6a00:3486:b0:6ce:55cd:88b8 with SMTP id cp6-20020a056a00348600b006ce55cd88b8mr3693884pfb.59.1701963821606; Thu, 07 Dec 2023 07:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701963821; cv=none; d=google.com; s=arc-20160816; b=SYTzO6ejy90tf4DqE9oW6kYtBGHpyc8/Gvod4poR55bGhigiiWQvUOdFxKdZpgMvxq 0t+WIucUctlrtA+U4nxLF8Nsakow8MBI+aDvRnL53PvLBN5CLM2UGXCt/xmjWQAa5+kH spq44Jb3ILoRBNYmkJApCtbxaS755Z+Wv2wnwA3nIfDe+GQIbpRRYEdjErfJRWppPl7D 3zdhJov33gIK0Yir8fE0W5xlGKs0Z0Xm/MBHGS1yhQMZ+03Xq2FTHvlhgYozVOQ3r7P1 mEPQyatxylJNPGI30o2xMfjh3WWX3bSFCzq94ukwkhcaeoIW/p62gLN7v4lXMHTbOFPf z+tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=kKDmIidL/tnOKURnMGeoV9D0OqdgpEUnz7ab3Y6ER9I=; fh=kl8qumCnakJl4NDnoyW6SGSmH7Q+LyqjLz4Frv6PrHw=; b=cT9MYAFV8bgtZf2NMa8T+tU470u2Afk3gCDUTXD2OFsLo0x4wDA3hizGQoo2WNf/cI 3LrfTxcBZ9pxyfCB1DgKpk1nX0eYgtT5yk3VhDfatlVFmjXbinVyy91LlqhC2kF2+ESa A106zZmn9tcxyZTyqnZSS7P/19Enf2voQu18Wy3mUhErT4Dwpgg05Y1zhS/PGxRGhriG R+0t2PGqIXiaHFVVfXUJmoQ7AiHmkq4sZbGAG7+mFch0XJDC8UJsGwMWpdQ9w7Qcb82/ MTwKENl9LqwnGxLTnVWo0W/xB6Xdp1H6lCQYro0BHn0XlRFHK+QsKueIpoOVs11zOs4A EppA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=enYVfsBH; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=h3uVDoUl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id a29-20020a62d41d000000b0068fe12b361dsi1401174pfh.249.2023.12.07.07.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=enYVfsBH; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=h3uVDoUl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D336C80BD533; Thu, 7 Dec 2023 07:43:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443495AbjLGPnZ (ORCPT + 99 others); Thu, 7 Dec 2023 10:43:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232946AbjLGPnY (ORCPT ); Thu, 7 Dec 2023 10:43:24 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5673810CA; Thu, 7 Dec 2023 07:43:29 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E103B5C010F; Thu, 7 Dec 2023 10:43:26 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Thu, 07 Dec 2023 10:43:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1701963806; x=1702050206; bh=kK DmIidL/tnOKURnMGeoV9D0OqdgpEUnz7ab3Y6ER9I=; b=enYVfsBH/ajHQbRk+Y 748qP1SgSEffOJ5hAXxyjXL79fyI6TSkDBSLYrNCmcVCq9v5FqtoqXQwOw5lasHn FdjfPgvi7JpLTfg/u5bs72AFRKuCXSYkzrte+625THB8YGyrU0JihPN0miNheqoS D0NH44LxD7N/1sobNw0Aqy1s6ZHn/UN0gbmPjh9mm7d5+vbrOSLLAiLUK0S0P4rf 34jHD8JOJaD+kmA/JtJS8HNws3R7fKWcZFWhqXHa5i0qhZKDLXx+5RDFDb7aZd6p SE7Vks6G0laiS/g2n6jj4Eq+j3nwhVdbsv3hWpdK6tutO7HMCyl1A6bJi8zSJbIV rYFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701963806; x=1702050206; bh=kKDmIidL/tnOK URnMGeoV9D0OqdgpEUnz7ab3Y6ER9I=; b=h3uVDoUlmP2wNbOIFulx31xrQpwen CLulfcqV4LLs/ZfG09NAuLrxZ20DgU994sXssFbwQFZNC/gutGZcX4WrybKiHidS npwYhQNy0OBZ7+XdwKQh+l37P9khQTd03fIAZgpnBU9YnkzQ7my3EiMVcs/UckaZ zfibqKZf3DUibCygSZs3dSQmqWfZowxwFWsakCyLAUwzQ5KaAebIO9ZsDMafwrDx aoI+Q3fr1PTB3EkNdddVmXIk7K2I7r2gVEPZImHXO3Cetg68FaozmclIfX+VFBy4 vndBJwldaNRMEz1o/rDNBtt4Ojs6bmGByaTe+V15v5B8pYnx/V9404ysw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudekfedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3BDB4B60089; Thu, 7 Dec 2023 10:43:24 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1178-geeaf0069a7-fm-20231114.001-geeaf0069 MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20231207002759.51418-1-gregory.price@memverge.com> <20231207002759.51418-8-gregory.price@memverge.com> <67fab0f1-e326-4ad8-9def-4d2bd5489b33@app.fastmail.com> Date: Thu, 07 Dec 2023 16:43:03 +0100 From: "Arnd Bergmann" To: "Gregory Price" Cc: "Gregory Price" , linux-mm@kvack.org, jgroves@micron.com, ravis.opensrc@micron.com, sthanneeru@micron.com, emirakhur@micron.com, Hasan.Maruf@amd.com, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, Linux-Arch , linux-kernel@vger.kernel.org, "Andrew Morton" , "Thomas Gleixner" , "Andy Lutomirski" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org, "H. Peter Anvin" , "Michal Hocko" , "Tejun Heo" , ying.huang@intel.com, "Jonathan Corbet" , rakie.kim@sk.com, hyeongtak.ji@sk.com, honggyu.kim@sk.com, vtavarespetr@micron.com, "Peter Zijlstra" , "Frank van der Linden" Subject: Re: [RFC PATCH 07/11] mm/mempolicy: add userland mempolicy arg structure Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:43:39 -0800 (PST) On Thu, Dec 7, 2023, at 15:58, Gregory Price wrote: > On Thu, Dec 07, 2023 at 08:13:22AM +0100, Arnd Bergmann wrote: >> On Thu, Dec 7, 2023, at 01:27, Gregory Price wrote: >> >> Aside from this, you should avoid holes in the data structure. >> On 64-bit architectures, the layout above has holes after >> policy_node and after addr_node. >> >> Arnd > > doh, clearly i didn't stop to think about alignment. Good eye. > I'll redo this with __u/s members and fix the holes. > > Didn't stop to think about compat pointers. I don't think the > u64_to_user_ptr pattern is offensive, so i'll make that change. > At least I don't see what the other options are beyond compat. Ok, sounds good. I see you already call wrappers for compat mode to convert iovec and nodemask layouts for the indirect pointers, and they look correct. If you wanted to do handle the compat syscalls using the same entry point, you could add the same kind of helper to copy the mempolicy args from user space with an optional conversion, but not having to do this is clearly easier. Arnd