Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3591221rdh; Thu, 28 Sep 2023 17:11:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmK1C1VIgv8Y2pNha9H0ujYsJCXtGdHSn7CGJhwEoyqVX4LB8RKHVOewZ6bGJXIIDc6ZIU X-Received: by 2002:a05:6808:3dc:b0:3ab:843f:76fd with SMTP id o28-20020a05680803dc00b003ab843f76fdmr2822227oie.19.1695946281886; Thu, 28 Sep 2023 17:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695946281; cv=none; d=google.com; s=arc-20160816; b=MiLNE1lC6WlGJSGnjTs1jnYHmU22Po+iU9fhJPNr8X74/lg6QXm52++c7qxY0YABPq rU3iLZlf9be2/t0kuKeOg6Obut3ys2MDpn7fYFBxSrPr0rHsHEFVARLZprKhX0QdSJBS Ez/tju+H9VHKfisSDR1aEPaASSZVxtZSlsC6kUtd/juAQ/tAYh5nXLkBBTDtC5wxMfAG 9fLzQ1Sz/TpQEmIgfo1UaUllyiNfpAeKW3Yg7tvI1oATrKVdOpZTN399mM1Hi1DRWPyN 76xVXU07VYD6qFDbDRYDOWpwu1HXXKmtaEXM6uOrE/H9xj4vrmOa4Jm1GKWYbjrytR+I YABg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2KC1i9gmPi0pVykTb1sHwPTC+2SqyufCO/Y0XxkrEko=; fh=AyWvM3f9tY8nvMDhVhguFfzmXBn7W0usRJNr1dEAeK4=; b=lxDlve193KMLqLezBXmK+nluen9J/tag4vjIW+vx0aFFO1br10JkGoUMz09csB8mJR xW+zj1wwFZ10yWexwMhOMYu2JI5qPDgs+Mz/2KWQ70IVMTCZGPUi2DuJU/mN+5G0SIJG lqk0B987SArBM9617cngZjUjQNRY8mqydqKwMRoJiClVJS5YiNnuP6vRlWWxDWIQ7sgl 5Glsd3aZtp294kuTgNYYkPlKzd6RkdTVrRR4CUT8n3Nd1iAOpMYtOH78VgCW0u29X5GV 2SZP3/Lp5xCy/Sr7cQEXH3lsPlV50MKXHdh47r6uC6bszht/kg43sKrjf/7x9sv1hCPa hOlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Byq60xxi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id bv8-20020a056a00414800b00690cc6f6f38si19139847pfb.76.2023.09.28.17.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 17:11:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Byq60xxi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7F40385062B3; Thu, 28 Sep 2023 09:38:18 -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 S230293AbjI1QiO (ORCPT + 99 others); Thu, 28 Sep 2023 12:38:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbjI1QiN (ORCPT ); Thu, 28 Sep 2023 12:38:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37464193; Thu, 28 Sep 2023 09:38:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6124EC433C7; Thu, 28 Sep 2023 16:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1695919090; bh=+pR8qTsnL2KdGPFPcXEQBLdZz545KfukXsurVyoKH7U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Byq60xxiXtkUaPao9CHLMM6/ZD4JUm1Fi51Ys170+hT7Jr9h8MLvsYenIUwL6QCLN /pvKH0udwL+Ie7QkkNcK9vJa2M54GwBOUdm1ShpLMLiN6cXCjc6an8WrE1qnXZKhdD 6liogk84HhVpZdEcYrUxIpAzIjGuochwQdz0SCpA= Date: Thu, 28 Sep 2023 09:38:09 -0700 From: Andrew Morton To: Suren Baghdasaryan Cc: Yang Shi , 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 Subject: Re: [PATCH] mm: mempolicy: keep VMA walk if both MPOL_MF_STRICT and MPOL_MF_MOVE are specified Message-Id: <20230928093809.75de08561b0fa1af03bf4a89@linux-foundation.org> In-Reply-To: References: <20230920223242.3425775-1-yang@os.amperecomputing.com> <20230925084840.af05fefd19a101c71308a8cf@linux-foundation.org> <90fc0e8d-f378-4d6f-5f52-c14583200a2e@os.amperecomputing.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 09:38:18 -0700 (PDT) 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). Thanks, I dropped "mm: lock VMAs skipped by a failed queue_pages_range()"