Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2125897rdb; Tue, 3 Oct 2023 10:58:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpoFXAaF/vP/itRIi+Gk/4MDqiaW0rauCQi6g1obUuWVB2S/8spaMluFZ47ek1Tza5mQWm X-Received: by 2002:a17:902:c946:b0:1c3:e3b1:98df with SMTP id i6-20020a170902c94600b001c3e3b198dfmr276148pla.52.1696355924618; Tue, 03 Oct 2023 10:58:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696355924; cv=pass; d=google.com; s=arc-20160816; b=spICuQcerD5FKZ8qUgOX8mMky6sqJL4eHrpG/jUHIfbY3cfVV/559GeoUHlTIPzXc+ g75fwaJbI35VK7FO398vaJqplgR364eNZ6pOgXtjaHLF5OGVF3yY6YVuXBBTCa+P8Rvn fO/SEsxqTTUIUoWOgDMKKpUy5DyVHHoGR1rTaMd7ZSMRR+HhF/+BVgC0FxGdMseeDMKZ gOz2ntxeXXFm7a8Hwt5zgLSjpRYbD3pArtlY7eCLr+d5pSf08BamPz4UYqLGW4ii0ONU VOA0Jydn3AjMDWoxPb0XeeIf44iSzxKb8pNCmOx2ZiOryDBBn4z6QN76vaJcR4tM+6b0 Ertw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+czx7X/JUK7vjfiuJrF6CjADJVnyrInu6F/zpc5mZPQ=; fh=PdKkFy1IXO8i2n/jggLosxr3G4iOywyoO5S/wyv0/Co=; b=AWdxcuWEFJcG7s62AUCZNlCeNn/v7tooE52tKA2qd1o0FhhtgDWvPqpu05o22EDCij CXfc51ODv0cpazHABXXEXsDIWVnvR/j+fTnlt924mDhI64eBQjqnKEiwoO06ncd3RHHH zbGRXwb+42syBxVLngvlZvUzsWW1TjcT949qWYqSf4me9cQGyHtWjUDIVUN9KKJZ+6IF YBdmaZLw/3Qw7tbrAUNzbergw93XZCJRTIhgs4//j/NsQaS0WHZV28d5lnhth/uf/quY q6gSFm8olHHrflqeePYZvqKsJ51/CLgQRpgntCgUPtF2d8tMqfUs+FAPYSHRWnF5z0fy +s+Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b=NAmIzY27; arc=pass (i=1 spf=pass spfdomain=memverge.com dkim=pass dkdomain=memverge.com dmarc=pass fromdomain=memverge.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f4-20020a170902684400b001c746bca061si1936998pln.74.2023.10.03.10.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 10:58:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b=NAmIzY27; arc=pass (i=1 spf=pass spfdomain=memverge.com dkim=pass dkdomain=memverge.com dmarc=pass fromdomain=memverge.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A4D95814595C; Tue, 3 Oct 2023 10:58:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240726AbjJCR63 (ORCPT + 99 others); Tue, 3 Oct 2023 13:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240690AbjJCR62 (ORCPT ); Tue, 3 Oct 2023 13:58:28 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2071.outbound.protection.outlook.com [40.107.237.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97FF3A6; Tue, 3 Oct 2023 10:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ngmmfHgbdjNCDI3Hk/Yd9DoTr3ZaC73rGaMU4n260Xl3wAKklH4U2dY0Z5nlV0h086KeJhvOKOuojPrpS/smlyvAlXf2yHyzENvb48aglULDzwNLWZdXIDZwuIcYU9XP8Ya9zsordRNKWrh8Q8wTdu9T5fD3Tr4IGRQzWlxlzA/qi1IPz1SBz6EI2GaOIYklJa7bGtfe59AvNzqBxgpTIb2Exqcc7kOfKtPG+jbnIFaqeY+43mtpz4pGQFINlmJOebTEdqM8jGHxgtsBkTIz24RjQBuSX+bYXgiYxU1bjyMhIt02oZLNf+AfuOGAq4RL1JqdRyHgCNLGld9i/tdP/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+czx7X/JUK7vjfiuJrF6CjADJVnyrInu6F/zpc5mZPQ=; b=ONwa8a0seFpU+03tOtxqUepaJP2HhJCgzbzx3FMcPRjjmRLG4jyI6v82odgtg2gLw/lWB51ijKQMu4QE2rgfwcJV0l8czkEa4HcPA+4Wes6jy7o2QhsqZan/6vNcHwrYDl3yx96lB/eTmnRk9P9SkM+947jcwYliMPtxLVoprQtEa9Yly7pknhsc6bBedJnXIbgoodwOymKINSGQgPXdFHYmKfugE1mTswvLG1oq8WdgpQxYpFDRXg5h2TpRGVvZCkoRohVo1WSg2+lEThbPvmUjFJ1kmZXUtaSyFzzrT3bN4rbvwI+w7DuOMUsVQaM/YllyMvu9ZFFPcDPay2mZCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=memverge.com; dmarc=pass action=none header.from=memverge.com; dkim=pass header.d=memverge.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=memverge.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+czx7X/JUK7vjfiuJrF6CjADJVnyrInu6F/zpc5mZPQ=; b=NAmIzY27Wf43zRFy91uxURizmdGYG0V1wW0GhYTTNMjtQdFbg5Q6JDLBGN0vA4viNtLcp6kK7SQiBbEor1hp47tJZAUENPEJ77Tx9l+cd71T6+yfNROsrWiAMRXsKM8nvJAvluwQS7fT0tTT3D/hO6DvW8gBRFByTeQgzjforN0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=memverge.com; Received: from SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) by SA1PR17MB5139.namprd17.prod.outlook.com (2603:10b6:806:1c2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.27; Tue, 3 Oct 2023 17:58:20 +0000 Received: from SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::5565:d559:61b0:e2df]) by SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::5565:d559:61b0:e2df%6]) with mapi id 15.20.6813.027; Tue, 3 Oct 2023 17:58:20 +0000 Date: Tue, 3 Oct 2023 13:58:12 -0400 From: Gregory Price To: Jonathan Cameron Cc: Gregory Price , linux-mm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-cxl@vger.kernel.org, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, arnd@arndb.de, akpm@linux-foundation.org, x86@kernel.org Subject: Re: [RFC v2 4/5] mm/migrate: Create move_phys_pages syscall Message-ID: References: <20230919230909.530174-1-gregory.price@memverge.com> <20230919230909.530174-5-gregory.price@memverge.com> <20231002150746.00007516@Huawei.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231002150746.00007516@Huawei.com> X-ClientProxiedBy: BY5PR13CA0015.namprd13.prod.outlook.com (2603:10b6:a03:180::28) To SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR17MB5512:EE_|SA1PR17MB5139:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c5b887f-507d-45fc-be2a-08dbc43a5437 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ga+aIiLikx1I79diPTUvvwjQ6EwL3DBCqi8E0XtQxsyKg7+cNc9Bu5qFGqcOaYHYJUZroOAIrkfTcuSxYyyMVmpWKHMzlzvzvDd6mXBdDAyJm9JWPzXjex0OTtFuBhvq8hXf/BSF/QeBEOsgHbrvlwxZlv5wNEfZ16JacBdxj/3/zgbIJIsVyakE9jWMpWQQcHkfAf+zifcb9QuYoMUJ181QUSneQHDgoXTr5pGfR9vFRUS5oTF0WZJzloTWeEpnQq5hOJlD1KcAK/+now/gfS0i4/ezQK47As/DgjZbCW92W2VLTP2+wGscp32LIcGNi4xC3R5VN+S1YoqDN2zBo5pp+y/gSp+sowmrhmRAqpTWGvZXlZOx5/CztE02Y6DaXBcVRIGlpufiQU31tNsNUMUp5sFqVqYHH1LF0yU1Ae4/gBfnPT4ho+qbOUFG2pcv2D2v+b66Xo74+kXwyBiQ7s6XM9WMYkWc0GkKPsmPKy8oSBkyaH0hxBIUC2eXZs20YkMoEQUU2BFDkMbqHSdsCztZaj5Ev7O6+gsFXYPKEyLRa69ElVMcQ1VuTzVr5FRu X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR17MB5512.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39840400004)(136003)(346002)(396003)(366004)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6666004)(6512007)(6506007)(6486002)(478600001)(38100700002)(86362001)(2906002)(6916009)(83380400001)(2616005)(26005)(36756003)(8676002)(66946007)(66476007)(66556008)(4326008)(44832011)(5660300002)(7416002)(316002)(41300700001)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6mscAyz5jzEA3eaFFW/pEbNgmUrYaRjcH1/ea3e+fAymoW04vjnNpo4zW4Jb?= =?us-ascii?Q?Wo7BKAUyftZNo5jD+Qq+jK4zts7GRkPsd3ttZ2LhsytZwmUYDR5rWeQbndzu?= =?us-ascii?Q?C2D1n9tyMy9Nmj2Ww7ogVFLsNT8p4X3lFQBg/kfWpA6wjmNhziOLj/yIpFbc?= =?us-ascii?Q?Advyvb4kT6y2E7VdLmx8lGqXr0Sx4jdpEKYxoKtQXxY/7jiEBsK1/XP9Lay1?= =?us-ascii?Q?n8bfFEnwGpWqPyrL1F7y5lCcwrsrCIFt56qwv3OiVGNczuc9H6P46ql9S4rb?= =?us-ascii?Q?Gz0JNEQYTWtpzvVfSlQamsR7QaFQeL/EVaSCWQN7/2HoEx0XjEWkVe2qwwPL?= =?us-ascii?Q?5g/2gJQlln87bw99I/pX9YzTRAvRKCizHInn4XC34LCQ+eu5QAuQAH8qq3L+?= =?us-ascii?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k08sFvFWeYpRC2i?= =?us-ascii?Q?crqAbtSurXIJXa4o4UsFs7zWXMKd2yEz0JgJkLTLGi3YVuIzfVpNvCffxe6s?= =?us-ascii?Q?UYzLzHqJa1JHjvn6dadXu91M9qljhqi6BQJAmez9Odff4SXgSaM9/RUAc/4c?= =?us-ascii?Q?yy2mvs5jYozhl+ZQ+CQDpiIupNsNknmQpRDspRRczUnWJ9Oqk+8xfBGBSx6C?= =?us-ascii?Q?xltg22zUfu9ck/0sWC4ijARaspY1ivtPBfJFDpKLbhApqM2bazijnM34wyCW?= =?us-ascii?Q?Qmt8IRA0KSpMFEjpJLGEfWgHwPxe97TTh4KPMl0oh34rtYta8Hx3IsDRmcW9?= =?us-ascii?Q?oA=3D=3D?= X-OriginatorOrg: memverge.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c5b887f-507d-45fc-be2a-08dbc43a5437 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR17MB5512.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2023 17:58:20.5766 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5c90cb59-37e7-4c81-9c07-00473d5fb682 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JnG6TzgTqLblkbecGnC6eEIKY4u0M0sdsKtPCAOPR47eUjJo2+BAGgqtGIPCD9/UOVsmXlBxrsjBy6zEQZ8lERvUU2i6FBKYeyvml2TdfVg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR17MB5139 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 10:58:35 -0700 (PDT) On Mon, Oct 02, 2023 at 03:07:46PM +0100, Jonathan Cameron wrote: > On Tue, 19 Sep 2023 19:09:07 -0400 > Gregory Price wrote: > > > @@ -2181,6 +2290,10 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, > > int start, i; > > int err = 0, err1; > > > > + /* This should never occur in regular operation */ > > + if (!mm && nodes_weight(task_nodes) > 0) > > You document below that task_nodes isn't used if !mm but it is used > to indicate this condition... > good point, and in fact the code below does ignore the contents of nodes_weight if mm is null, so i can just drop this check. > > +set_status: > > + *status = err; > > Given you update it unconditionally this seems to wipe out earlier > potential errors with the nid. > > > + > > + pages++; > > + status++; > > + } > > +} > status is a list, the status++ increments the list pointer. > > + /* > > + * When the mm argument to do_pages_move is null, the task_nodes > > + * argument is ignored, so pass in an empty nodemask as a dummy. > > If ignored, why bother clearing it? Looks like you are using it as > as signal rather than ignoring it. So not sure this comment is correct. > > > + */ > > + nodes_clear(dummy_nodes); I'm a bit of a stickler around uninitialized memory, seemed better to ensure the nodelist was empty to force errors associated with an empty nodelist should future updates break do_pages_move to remove the ignoring mechanism. That said, I updated the function such that it does actually ignore it, but I'll leave the here since there's no harm in clearing the nodemask and leads to more predictable behavior. Unless there is particularly strong feelings about this, then i'm fine to remove it.