Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5497864pxb; Mon, 7 Feb 2022 03:29:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyM+mOrhCIhbvD1DZK64FJ6P9trVk+BlAeKl3X+/hvd+AEZprDvjo9KRW8k87z7Leer7u2L X-Received: by 2002:a17:907:94d1:: with SMTP id dn17mr9441354ejc.79.1644233348471; Mon, 07 Feb 2022 03:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644233348; cv=none; d=google.com; s=arc-20160816; b=CVVSj9BrA6UAbW1vI8Peft+xFqi+yW9wXVyo6Ffycb4F6Me7+xyi557Mz03j2sBbkF vTC7+ezYD7e/K3/OqG2OWJ0Jx4zxL6q0gJc+PmmBNm+qSbre194eP4uwDcecsC21MABL jmIDDDZO8//ZJfqJcgqxj66aue9myNYzs5KR39ivuDMPRVFkC8vGDjq3CmE6LZcMK4Pg vXwkYBMbMQj3JcqB4ktDXmPEYZ38p47+h+9W1ma+8/xyc0RinF+QSC+NkT85WLbeSfJQ Rn7XDnx1/p5bXzkS/QUL8BDXX+Qghdtkk9WwQXBAdKKdXpna4xjL9t3cIAss9sTx9/5E F4+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=RqAWQmdoXqG0G2kwAD2e7NWcP4SlcibKebTgmg5BUJc=; b=gTmzpCSqNKGUzsHApvQQWPNp+cGvsP2SDfNhaiXcoN+Hrjb4NMaQVxw33/ysVy8uqj ErqJ1i0OarEVTD3eqI0TwUjDQo0MYqR05yhL/HnzYveWRVzQhTHcds9rWnoyrPl43ZJy Y7/O3BIOv2rMwDJoexYrQcaMBA8GDeQ2y8qWhzHaqjFKbJSM8Gx6Rcgv08oH8tq4IIXl EgJ/qnqtgAlXHxPAGgj8XVGzE0ZeS+enHAVBxNTs38gbbh3y9hwg3ujygh2XzqFjkmFr MJBjxt5m9VSU27C0dCdLEULfXZxWosqKavOBfVAXA39Kk9rvX9Mr+bmO9vhwKWhYleZD PMAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd37si823399ejc.568.2022.02.07.03.28.19; Mon, 07 Feb 2022 03:29:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377538AbiBDS3N (ORCPT + 99 others); Fri, 4 Feb 2022 13:29:13 -0500 Received: from mail-yb1-f170.google.com ([209.85.219.170]:34765 "EHLO mail-yb1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377528AbiBDS3M (ORCPT ); Fri, 4 Feb 2022 13:29:12 -0500 Received: by mail-yb1-f170.google.com with SMTP id v186so21328242ybg.1; Fri, 04 Feb 2022 10:29:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RqAWQmdoXqG0G2kwAD2e7NWcP4SlcibKebTgmg5BUJc=; b=Zm0l3IjTqEukeY0o6/T/SCAclek8V7MpbzXEgHBxNfVmP9rwFqvdx627TIXjpCruiE m/1QHVfd1fgqd+QPfMu9QRmlBtFSdmLh0aQg8PdYe4p7ZDz5QOCNxXMvU+93p7JdW16b w2KbtrqkJoIDeew/mth4VNcflmc9ZuTwVwtT+a/v/blzD81UQxpILMB5OVNUXUbb7dLW FCFMHos7UF0M1LytcEJRSMmrDBNOOT8LeKJ1vXLUQMVXHF2RvLzuVVGkQE3aS//LkURs 8ajgCeMM0YPgE2zaAiBEzSsw3gWFofCsHBqGmYzHKSSE8feDi87+KrJGnprOM1WUxIlS BObg== X-Gm-Message-State: AOAM533x6bw69EUBzGSmJapiBfGPDZOIkySNE+lWgQl7I6uzpUMHNxUp DTpCPIOyU0ae/sMbtNOijCuqz+VsIfrPK54WvNI= X-Received: by 2002:a25:180a:: with SMTP id 10mr492538yby.552.1643999351652; Fri, 04 Feb 2022 10:29:11 -0800 (PST) MIME-Version: 1.0 References: <20220123183925.1052919-1-yury.norov@gmail.com> <20220123183925.1052919-4-yury.norov@gmail.com> In-Reply-To: <20220123183925.1052919-4-yury.norov@gmail.com> From: "Rafael J. Wysocki" Date: Fri, 4 Feb 2022 19:29:00 +0100 Message-ID: Subject: Re: [PATCH 03/54] thermal/intel: don't use bitmap_weight() in end_power_clamp() To: Yury Norov Cc: Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , Linux Kernel Mailing List , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Sebastian Andrzej Siewior , Christophe JAILLET , Rikard Falkeborn , Linux PM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 23, 2022 at 7:39 PM Yury Norov wrote: > > Don't call bitmap_weight() if the following code can get by > without it. > > Signed-off-by: Yury Norov > --- > drivers/thermal/intel/intel_powerclamp.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c > index 14256421d98c..c841ab37e7c6 100644 > --- a/drivers/thermal/intel/intel_powerclamp.c > +++ b/drivers/thermal/intel/intel_powerclamp.c > @@ -556,12 +556,9 @@ static void end_power_clamp(void) > * stop faster. > */ > clamping = false; > - if (bitmap_weight(cpu_clamping_mask, num_possible_cpus())) { > - for_each_set_bit(i, cpu_clamping_mask, num_possible_cpus()) { > - pr_debug("clamping worker for cpu %d alive, destroy\n", > - i); > - stop_power_clamp_worker(i); > - } > + for_each_set_bit(i, cpu_clamping_mask, num_possible_cpus()) { > + pr_debug("clamping worker for cpu %d alive, destroy\n", i); > + stop_power_clamp_worker(i); > } > } > > -- Applied as 5.18 material, thanks!