Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3175941pxb; Mon, 24 Jan 2022 04:15:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyG3vJq3b71AdIR3ZmiX1tnu6xMjRvuntC9eZIVsdkVoxmzwnLkgwdbEvMwrIBZiukKhc+e X-Received: by 2002:a17:903:1c8:b0:14b:6b63:b3fa with SMTP id e8-20020a17090301c800b0014b6b63b3famr72876plh.156.1643026527461; Mon, 24 Jan 2022 04:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026527; cv=none; d=google.com; s=arc-20160816; b=S1iZVkAdhMV9L6kXO0EJxxLDTWF+q9roL6uyPR8xHt/oKYviQRyzZxO8igHKGHGOi6 SlsvI+ZxA0fKxsCCdU/NcEpqsNjIB+Q0TVJ++ipOr0Yy7tE4+k5qCKNTp9RiVW6BqGri OjWDaFyBDbXYVoCZpKAcHrM7Z2tkAEVJpv83/hQNqOo6pMfEIJHRmVtVsIMINNT8gEPJ 6rykPYPcJbs6E8Fzo7SQCsMNhOFNAGtdgHKzRdp+n/KFXz7+KX20GxDbaJ02nIKywcY7 KB4Cw9ekyak6HYD4r3VbA/IXhQrEToUButU7wqMZfjhXNuC21wgBKi+tmF1Mipyd98P8 nMow== 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:date:subject:to:from :dkim-signature; bh=Azd/w2Pv4tWIAvkFg87uiwY2Tzr35b3ymris6XNGI+U=; b=Ek9D04igCkx2cN7QJWT0xRXY7x1x1Vxd7ivpqrtOmKko/RpwjcvkvyoFcmL57LYCEB GS33WUF9Vb3XsNdtv5X+Q5kRdShhDeGW1cla07inZtUzpc42YTcvYfmYn5X/MJgnkOyk tmWuKoMeO7tElnsWza7jQ5YvJpw2rH2VCdIElN5bEonXInIe2hS7BJ5MRiME0vpIbV4r eqwAWHCaSvy2NUu0yCrGsTIIHjUgshyYAOBlhemE15PMaAjBiQuH1qoWXFxgTzVVsZQq crommGZ0hoB5DCE4xa4ME4nrv/Fq3TM2oE5bb+mNckxy2A6V+TS+G+doaVK4kpyGQuz3 BDDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IPyJfSxo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si11921720plq.82.2022.01.24.04.15.13; Mon, 24 Jan 2022 04:15:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IPyJfSxo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240219AbiAWSmo (ORCPT + 99 others); Sun, 23 Jan 2022 13:42:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239894AbiAWSlx (ORCPT ); Sun, 23 Jan 2022 13:41:53 -0500 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7737C061748; Sun, 23 Jan 2022 10:41:44 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id x37so9813297pfh.8; Sun, 23 Jan 2022 10:41:44 -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=Azd/w2Pv4tWIAvkFg87uiwY2Tzr35b3ymris6XNGI+U=; b=IPyJfSxowKcB1S3Q1A4DTZa7XdI3e/XLnFC7naVawaaQ+1a+LtUNQ+e7L1/yh1uVnU tJKAhbiAtQmE7P3de0oCrhKBgD83mkQONZzr24n6xdYLMwpBMQ4wjv6rDLtRwAinUqWj t+lS9kohf4hERa3Dcc5YBZXqRN5C2wf9P7AyvM1DqjJJTmRX/0pwnajQC0iWSf/TaORQ Kb9Rr8lYSFcs5alkmVEFbtbaUleUoZ5hcxIjxRshgTwzvy2Tf4ynKKCEExSxgj3kyb5c tCb/HyztCPdSBTHTBayp1FVJQdkzrDqOD+6gkbn9ctA5mbUNZqpD9qsgH5p/3gicHVGE 6Efw== 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=Azd/w2Pv4tWIAvkFg87uiwY2Tzr35b3ymris6XNGI+U=; b=41OZloVqGKlwUBz3536NGGdPlEZRQ932eSMZvCnE3jDwJj4pt/Qw7gTEDL4tccwLe/ ZaR+pI5rqxH8hucmmAz6ptwvGdtBtXnJXO5YyTw+VJ70wm7swauYLNmYApCN73+S6/IM Su+k9i0C2aNRkYsylaa2fTCD1iqIFniTHqGnyDCJWtOC/HzgL1qwTJkq4UIn/CwLqCKP VWMTo8kzOGTnYA0xX4xw9YioEH/++N0OOWXC6hBPisL4yY4rEVe6xzHltl1L9ZUm3FSf Kg2PHHOaq9B9nMnw8iwN+foRFk9LbO7OzpzQBQDcSnWdYwKoYU6Ws/x6Rerx/W5Si3jV hoVw== X-Gm-Message-State: AOAM530wun6cxDYGzTelbPwf6Eddbu1As3cILFbofHSmFl78C6trGqVQ EA7ndON38gxBD7CwMz6b6h8= X-Received: by 2002:a65:494f:: with SMTP id q15mr9457430pgs.333.1642963304207; Sun, 23 Jan 2022 10:41:44 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id z29sm7442507pfk.38.2022.01.23.10.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:41:43 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org Subject: [PATCH 37/54] arch/ia64: replace cpumask_weight with cpumask_weight_eq in mm/tlb.c Date: Sun, 23 Jan 2022 10:39:08 -0800 Message-Id: <20220123183925.1052919-38-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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __flush_tlb_range() code calls cpumask_weight() to compare the weight of cpumask with a given number. We can do it more efficiently with cpumask_weight_eq because conditional cpumask_weight may stop traversing the cpumask earlier, as soon as condition is met. Signed-off-by: Yury Norov --- arch/ia64/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c index 135b5135cace..a5bce13ab047 100644 --- a/arch/ia64/mm/tlb.c +++ b/arch/ia64/mm/tlb.c @@ -332,7 +332,7 @@ __flush_tlb_range (struct vm_area_struct *vma, unsigned long start, preempt_disable(); #ifdef CONFIG_SMP - if (mm != current->active_mm || cpumask_weight(mm_cpumask(mm)) != 1) { + if (mm != current->active_mm || !cpumask_weight_eq(mm_cpumask(mm), 1)) { ia64_global_tlb_purge(mm, start, end, nbits); preempt_enable(); return; -- 2.30.2