Message ID | 20220123183925.1052919-52-yury.norov@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A79B7C433F5 for <linux-mm@archiver.kernel.org>; Sun, 23 Jan 2022 18:42:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 219686B0081; Sun, 23 Jan 2022 13:42:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F0286B0083; Sun, 23 Jan 2022 13:42:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0927B6B0085; Sun, 23 Jan 2022 13:42:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id EF2576B0081 for <linux-mm@kvack.org>; Sun, 23 Jan 2022 13:42:29 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B4B228FD36 for <linux-mm@kvack.org>; Sun, 23 Jan 2022 18:42:29 +0000 (UTC) X-FDA: 79062422418.18.A6275E7 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by imf03.hostedemail.com (Postfix) with ESMTP id 5703120032 for <linux-mm@kvack.org>; Sun, 23 Jan 2022 18:42:29 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id h23so13125322pgk.11 for <linux-mm@kvack.org>; Sun, 23 Jan 2022 10:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Ouatn2R2XSrlqBb/cl6QBZlhDkWXWZjR0T2HBFMF8GM=; b=Pg+6hPzMUrdJ2L0XacgOuQCKjl4jmD1DkA4Uft+PyFR3TG54sPD+Vgh5++LQcbqVcV ylxUcOCGkUe7IWVmwD2RuZYGjfzClUYynm95FBXzxuFGgIkfqk4jW7AKoYK9A5FUGhuJ sVukEpWtFRuWctbRULsmwXelbY2fsOOfcIhFUJjs+cBsQM+cs6jGbbA2cbh5zVnDfKsu k9dmhPbTZOq7mJM6vn095szshkPUxZNrubKcCMQxWn/W19NNa79wsYTpwCY8ol+XoPgt 7DPidvWsROJ378WbseEcbhSy28SO0NcPuyDD1CYAhMjsFte3s3JcqDUnJ8tRB7EuhjY0 8hWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ouatn2R2XSrlqBb/cl6QBZlhDkWXWZjR0T2HBFMF8GM=; b=22yPezsU39EWXb9hDaNL4e3ufR3fEqEUO5Pjw8ivhsOeZgaurA+UQxoiI6em0KkgyR jZ8i7tYY+anwWAKtAKCvUjsM6wKu4SMYXT2ga5rKIjGLzdj7pNUoi+cp/a/PC2bKJOWR wEKMYwd1eJS2YBUx2j6a1woBqs7nRl60ICKWnYFr5r1n0K2Wjj2LJgQBu9ipV1+q+CaD XVT3DMFKBYyPtff+W0p2F9LOHXiDHn0t4CP6it75SNaTBJkmMjc+U7+IvlSNrFQl5El+ dCag1TU3y5Xa0j3UKT3nioXOENFZ5hr3+1nJKVeLfIfz047sCUI5Y0gsStiHz0sLpULS Zkvg== X-Gm-Message-State: AOAM532l3KTfg7q+V0vD3EdGKZijavNis6AZK3o8rNQqwGfhVqiZoA5/ fYmybwrVkDwWnwEGs4unS4o= X-Google-Smtp-Source: ABdhPJy0WTtp3rHcuax4YIT+LcH4DXFc3zkfPiLxk2xJ70kkMzrkhq/X13/68EEM7x8rgLqZZjwFPg== X-Received: by 2002:a63:b34c:: with SMTP id x12mr9392573pgt.541.1642963348406; Sun, 23 Jan 2022 10:42:28 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id y20sm2328066pfi.78.2022.01.23.10.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:42:28 -0800 (PST) From: Yury Norov <yury.norov@gmail.com> To: Yury Norov <yury.norov@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Andrew Morton <akpm@linux-foundation.org>, =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= <mirq-linux@rere.qmqm.pl>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Peter Zijlstra <peterz@infradead.org>, David Laight <David.Laight@aculab.com>, Joe Perches <joe@perches.com>, Dennis Zhou <dennis@kernel.org>, Emil Renner Berthing <kernel@esmil.dk>, Nicholas Piggin <npiggin@gmail.com>, Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>, Alexey Klimov <aklimov@redhat.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 51/54] mm: replace nodes_weight with nodes_weight_eq in mempolicy Date: Sun, 23 Jan 2022 10:39:22 -0800 Message-Id: <20220123183925.1052919-52-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220123183925.1052919-1-yury.norov@gmail.com> References: <20220123183925.1052919-1-yury.norov@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5703120032 X-Stat-Signature: xb6cgefguir6fojyu4mphtro1x46guns Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Pg+6hPzM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.215.178 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-HE-Tag: 1642963349-352357 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
None
|
expand
|
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index a86590b2507d..27817cf2f2a0 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1157,7 +1157,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, * [0-7] - > [3,4,5] moves only 0,1,2,6,7. */ - if ((nodes_weight(*from) != nodes_weight(*to)) && + if (!nodes_weight_eq(*from, nodes_weight(*to)) && (node_isset(s, *to))) continue;
do_migrate_pages() calls nodes_weight() to compare the weight of nodemask with a given number. We can do it more efficiently with nodes_weight_eq() because conditional nodes_weight() may stop traversing the nodemask earlier, as soon as condition is met. Signed-off-by: Yury Norov <yury.norov@gmail.com> --- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)