Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3499080pxb; Mon, 24 Jan 2022 10:50:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9+cH/C0bt8nh193weSgyhsFVisRy65J9GmSRF+gc6OVHwM1vssj0LfmlPJAJeHnsRTBW7 X-Received: by 2002:a17:902:680c:b0:149:8222:54b8 with SMTP id h12-20020a170902680c00b00149822254b8mr15903224plk.104.1643050209114; Mon, 24 Jan 2022 10:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050209; cv=none; d=google.com; s=arc-20160816; b=cNEfNc9UFHMWjPOO1ITHET7yEzu33vJq9h/3w//5SYwJwQ1v2pApZBBMIyn7EJp5o7 jSfYUkoVvyFXcGZoXjxSoC0sGhDORB0ijuAJLJDIWrq7iXsKJpiKo/WLaB/TzVdVQO1J Iwan3M8jf0nz23YuviAItO/yCmOQaaA63mdb6q3AknS6I2cu4gGnUtgECfpgYKNAG+Sc PutibKezXaNWU238khRBhS4MH5RnE5CCqGFVv5Xkkq4248xZpFNk5LUX2F2EAidwWuJV VhGu5I/pUviEK2lT3jKdiXPEnuQYmiGGW6LYSEK3PYJaRNB83eL5Wksi3HB9IphN7Gwu Jcbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=l7vj3bqDeqqqQNc8THrJbak7O/EIdT8VwyiXzgQX1uU=; b=NBah8t/DBA9xg5KPG20SGwwDLRMGuwBC1JjR2XHGJExVroLhsBfp3nwCjxtkNvYJcM JepnjKBoxfkOMJqeS0ovA4X8ddEU0vjoioE5xJSjv4xHQU1jMqz4BBbAkHCakLwRwO9L LfwIgjJkL+ulY082XYwNEpoPetEY34mUdsEBP0u8g5qQsmI9ia5LLit8IJTkfP4aM0Kw PzWF63InaOpgwwsdLzsc9wKcXtKb7m4S9oGT3ymHK5yNrOG4aDBC0Fw18GqqVRGpdSAa pRuJuosOwdwOVfGJVHo22aztRN9dC6NF7qi8hrsnzcAQxHv7yokTJeiSQC0n2A4PlG9R AIlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Z94PNBFd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si17771774pls.143.2022.01.24.10.49.53; Mon, 24 Jan 2022 10:50:09 -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=@infradead.org header.s=desiato.20200630 header.b=Z94PNBFd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236209AbiAXIF7 (ORCPT + 99 others); Mon, 24 Jan 2022 03:05:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233770AbiAXIF5 (ORCPT ); Mon, 24 Jan 2022 03:05:57 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3042DC06173B for ; Mon, 24 Jan 2022 00:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=l7vj3bqDeqqqQNc8THrJbak7O/EIdT8VwyiXzgQX1uU=; b=Z94PNBFdv24ZIwwujUERibQscT gv5D6k+HGZtQ8wQY4EcAkeNlepwLwqx8998CDbOX4AByqGHjvFhGHU6FZTvxiF9oGXhoTJuX5GNPo zSp8NtuY9ivaA33Ey2U5hIG5woeYpZeHlPauYbCI4N5tbJNO20q3HvdTFN4SagL+97cQL5nJHM8c9 LxwM49anHeeHn2vrr8OOn6chhYOpyqesCZ752qvLhUAicc7yQ7kZLWDg0drqHMhwKIhJa0YEGjMIn V+42XnsGn90kpGYacJ8XO08wTcGuubbJoFMu5hSLCyQTWm7hQEfBkrj+yc0oiSRWbs5YiMshykRNs wpCBMgQA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBuLb-00373q-Hg; Mon, 24 Jan 2022 08:05:08 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 9E42B98624A; Mon, 24 Jan 2022 09:05:05 +0100 (CET) Date: Mon, 24 Jan 2022 09:05:05 +0100 From: Peter Zijlstra To: Yury Norov Cc: Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Greg Kroah-Hartman , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , Vitaly Kuznetsov , Tim Chen , Alison Schofield , Boris Ostrovsky Subject: Re: [PATCH 41/54] arch/x86: replace cpumask_weight with cpumask_weight_eq where appropriate Message-ID: <20220124080505.GI20638@worktop.programming.kicks-ass.net> References: <20220123183925.1052919-1-yury.norov@gmail.com> <20220123183925.1052919-42-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220123183925.1052919-42-yury.norov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 23, 2022 at 10:39:12AM -0800, Yury Norov wrote: > smpboot code in somw places 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. Why use a more complicated API for code that has no performance requirements? From where I'm sitting this is a net negative for making the code harder to read.