Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3446656rdh; Thu, 28 Sep 2023 11:52:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkbVNtX89kYQ9c2FbpB13gzXpku3h+6MWO5bWuipqHG1jCHLlCtIEAyh01oTki+NkUHlmT X-Received: by 2002:a05:6a20:96cd:b0:161:2bed:6b36 with SMTP id hq13-20020a056a2096cd00b001612bed6b36mr1653299pzc.31.1695927147328; Thu, 28 Sep 2023 11:52:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695927147; cv=pass; d=google.com; s=arc-20160816; b=zl2OKJzRREof9bVedNZ47ESj0/O3Wj5N9W+BfddnaAuo7Xd0Qg619L2x8+tdZsf+1Q QM/aCN8mTZMOu878kHz7gzNGj+9zhdleUEq33LPDOYdYULeR0xAVGAp5gRfnQQ0WvORs Oumg+uM/Mt/o8Sz6ZphiQlfuj55syTpQzf7fC2V+wBvV6DuSKT+JGCAJP0eDkKmjnvLF B48o26k5rxCUSaxfbYXGXjlIuzh0UcInGkZuwSA+1LJvQu2lDZuuLeQ9HGsSbPd6UuSF ljpDDKsDEMpeyyUbk4WJQxxW8y9wGkoR+5UE6dbBd1PXqKOVz3mOx2ojtRaEdjZlrjka bLaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=DG5cZneviAYxigkN8R0RE2aUed0AecBs60inoKtF6Ss=; fh=rXcUKvuLdDNgScjQ8dTl5wvIGKu32NbonS0sSWhAoDc=; b=eKyNRMfH1ziHFay9sqUqMJ4G/UWQONFVAhOQ36BqpuJwrBtMyzDRGSt8qafkPJicXq Yt2yg5u0EepG1OVftzgUxCbDXV6SQllc+XrW8sWntax2cP/K1Gbe7145yBboIWWyMlvq GIjLqudIBVQJcFUqbb16KAgPGdG/Kn4QzCTL9CFRTGkoaQKV7v5fcZcCv/9YooyGKXgv LMf64VQIZUUnILc0S+vMQdzrFqIgsJyNYwyqDZrAnLuPeo11VYMuQmBFQdK0cLoAsMVy UB+GzGM2ASaB3kV3lYam3sYktBqHDHY0DdigJoEMLrt9FPkT9iAk8dwXrT44QUERToE/ WAQA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=EUpJ3+mr; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id b13-20020a056a000ccd00b0068fef37e5bdsi19903641pfv.244.2023.09.28.11.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 11:52:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=EUpJ3+mr; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id AC1E78056983; Thu, 28 Sep 2023 10:35:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231941AbjI1Rff (ORCPT + 99 others); Thu, 28 Sep 2023 13:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230503AbjI1Rfd (ORCPT ); Thu, 28 Sep 2023 13:35:33 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2101.outbound.protection.outlook.com [40.107.243.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 091C4E5; Thu, 28 Sep 2023 10:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1xaaJTaVdWbyoTq0g6xn1Nm849hXpYs83Xktcb8huq4uHphf56kxK7w+pr/+cvc+fDSNPfVIn4nvbROl7TQz3FRMzH38ouRyLINbuz7BluQ3JRqE24LpDRh8VFxr3BVHF3AtQ1Veck0FQEJiolfYNJzasD62LtXesdgxicttb4juuciHNXhxthjPjfMMhnnlmZd3+N2P7Ln1gmdNX+v6Qw2DYeezVwy6cgb+moagTszbCi/CdKCaE4z9y32SNqdzaSPnI8SLPchJzoBpcklJ64s6ur4XDktbdO/KlO2BpXq6bG3Ryo5HIRaKUcZ4j7I6El124nBqE9OqOW5AS1RBQ== 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=DG5cZneviAYxigkN8R0RE2aUed0AecBs60inoKtF6Ss=; b=T15fTA+YWBsYs3jKBEjVkrLaTY6hGrokSWc8QB0zZS02CwZdmTPjvjHJ/0Dx9AYo2YGrse0ELShve3LJslkTZerkYyeRmFSlSYWJfHeGn+QuuQrTldSaqztRTVtrd984y9gTPnCXjcj++GNGItlyuDmQEuZGr2sQ34mjN/CAytfBUsrYuJiugOTyUafpXGEmRGS2af+vX9I11+GSjgpNuUNsFafzHwRCsnS957JhYP593E74zCHgeqcp0l5u07ssme014U/v/QCutF6z7nUhNI5BnTzqWJbw8FOcsyLX7V9/qg0IEXwPr6KnG8G440Ji7MfU0YBPMO8ihUnmERKIHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DG5cZneviAYxigkN8R0RE2aUed0AecBs60inoKtF6Ss=; b=EUpJ3+mrTA+SFmTHthGEefKYORiiwX0SbU6iEFOYmzubmtwlOPS57XJJXq1/aJYr+Eg+myCYEcTtU++Gjffs1iv48ruQ/OagzleNyQiAqC6LCmHRp472eyO0mDgThDDoR8XhAa3NOfwat0SCiWLXnYGBwyuJgKlLvM5UOubEYaA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7492.prod.exchangelabs.com (2603:10b6:510:f3::6) by SJ0PR01MB6511.prod.exchangelabs.com (2603:10b6:a03:29f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.36; Thu, 28 Sep 2023 17:35:23 +0000 Received: from PH0PR01MB7492.prod.exchangelabs.com ([fe80::db82:aa53:7ce5:618f]) by PH0PR01MB7492.prod.exchangelabs.com ([fe80::db82:aa53:7ce5:618f%5]) with mapi id 15.20.6838.024; Thu, 28 Sep 2023 17:35:23 +0000 Message-ID: <868165e1-64d3-6241-c62e-19f0c91be64d@os.amperecomputing.com> Date: Thu, 28 Sep 2023 10:35:17 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] mm: mempolicy: keep VMA walk if both MPOL_MF_STRICT and MPOL_MF_MOVE are specified Content-Language: en-US To: Andrew Morton , Suren Baghdasaryan Cc: hughd@google.com, willy@infradead.org, mhocko@suse.com, vbabka@suse.cz, osalvador@suse.de, aquini@redhat.com, kirill@shutemov.name, rientjes@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20230920223242.3425775-1-yang@os.amperecomputing.com> <20230925084840.af05fefd19a101c71308a8cf@linux-foundation.org> <90fc0e8d-f378-4d6f-5f52-c14583200a2e@os.amperecomputing.com> <20230928093809.75de08561b0fa1af03bf4a89@linux-foundation.org> From: Yang Shi In-Reply-To: <20230928093809.75de08561b0fa1af03bf4a89@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH5P223CA0017.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:1f3::13) To PH0PR01MB7492.prod.exchangelabs.com (2603:10b6:510:f3::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7492:EE_|SJ0PR01MB6511:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d3957e8-e042-417a-171b-08dbc0494b5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WenD9SORYTMYVcINpkwmRVyWkBAogjrpdPVYrdVz8kPo1N6rHR/TZu56Op4rxrvcPhxVrCuXFGR+IZVnaqPz9fq8e0l2eSnJIeA9ylVAYAttM1+XqxKvqSf/Fo/ioEoDhxHvdwHhv1a2V7bkXjpQXPHbHQG7kizQnmL4HS6Q4Fx66l/EU7Wk7LFaxMRxWcxJ5n6V3+0T4zWJpZcrUtWymwJw9EaRbE8l83TTQ4dp8mm5vhMFOUHNZUhVa8YnKRz941UrJy2yJMKqN+CGb17JkeFZaS0z4ljSljFw5qvSSxGaw/y83XJ85eWhGlryjtkijbBksHPjsMVc58FaGLnxt0AGeMAhUxBrjur84dV6G2W1A59BVk5I9ijsfvj9ibK6bzvhsHs7OnLqYlHztseBiyIwhmiIasVKOp5P+U4qXI5kPPklZKrOaFSj57wamjGRAJT/EKwWGqVj1UbMKrv9zrStyufesogR5XXceCcs5OKu5ctbsWqTj4oQ4Dz2wNZzS8n6I+jT8FNyo9LhYW27f/RY4Sm0oJ3hQfKW1c3qzpSOAMPjMIExhBTB6ow7EPYDARpmh7m4fjtQT8wttY6x2by/oiqsZPT8IGo4K9tq9aqmvb7DdIZvGsb+EkaKZyX++aFoFUW2yTU1ChTG+Du0pg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7492.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39850400004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(31686004)(2906002)(7416002)(5660300002)(4326008)(8936002)(8676002)(41300700001)(110136005)(316002)(26005)(66556008)(66476007)(66946007)(966005)(478600001)(6486002)(6506007)(6666004)(52116002)(53546011)(6512007)(2616005)(83380400001)(38100700002)(31696002)(38350700002)(86362001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UGhnMG1GN084SEErR3JWeUtPT2VmaEU2N3ZxcHlEaFh0b084TDBSQVNoOU1V?= =?utf-8?B?Q1JrOS9acVRyN0JKWVdtb2NyZ0JRc3kxcjJtdll5OGhHTVF6eUZMRXI5TmJV?= =?utf-8?B?OHp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mlWSU41STBw?= =?utf-8?B?dVB3dUxWQnFVUmczYmJKNW9uWGp3QUtqbDQwQ2RDNHh3VXRrNXRXU3ZTZ0M4?= =?utf-8?B?TVN1M1VnbS9DSmlXc01MK3lvQVF1V1c1dVQySXRlS1ZqZ2wxN2hKVWZtdHVl?= =?utf-8?B?bG1LOStDMnhEUXFQQ2ZSMUVaTEM0MkdGMWhUSGppUDd5aGVSZ1RhUTV4dW82?= =?utf-8?B?QVVTOE5KQXo1N3BoNkRUL01iWUdobFZwY2NYcEdsOTV5VnJYZG1SRzkwNXVa?= =?utf-8?Q?i+V6osSxdwqQNMRb5+A7ajE=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d3957e8-e042-417a-171b-08dbc0494b5f X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7492.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 17:35:23.3951 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aQ/O5NtYHT4vzwsSNR1PsFo4/CNllHd1hGC4DoboVNtuFVzEKa+YJnmfQjei2nSMOmIJaSBYg7MQC+mGeyJN6L3IOm8uzIXgqrQfJq6wei8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6511 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 10:35:50 -0700 (PDT) On 9/28/23 9:38 AM, Andrew Morton wrote: > On Wed, 27 Sep 2023 14:39:21 -0700 Suren Baghdasaryan wrote: > >>>>> The code should conceptually do: >>>>> >>>>> if (MPOL_MF_MOVE|MOVEALL) >>>>> scan all vmas >>>>> try to migrate the existing pages >>>>> return success >>>>> else if (MPOL_MF_MOVE* | MPOL_MF_STRICT) >>>>> scan all vmas >>>>> try to migrate the existing pages >>>>> return -EIO if unmovable or migration failed >>>>> else /* MPOL_MF_STRICT alone */ >>>>> break early if meets unmovable and don't call mbind_range() at all >>>>> else /* none of those flags */ >>>>> check the ranges in test_walk, EFAULT without mbind_range() if discontig. >> With this change I think my temporary fix at >> https://lore.kernel.org/all/20230918211608.3580629-1-surenb@google.com/ >> can be removed because we either scan all vmas (which means we locked >> them all) or we break early and do not call mbind_range() at all (in >> which case we don't need vmas to be locked). Yes, we could just drop it. Keep the code not depend on the subtle behavior of queue_pages_range() by keeping it is ok to me either. I don't have strong preference. > Thanks, I dropped "mm: lock VMAs skipped by a failed queue_pages_range()" Thanks, Andrew.