Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3499081pxb; Mon, 24 Jan 2022 10:50:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEs5noA7sxzF4RS2YXr/KhDywlR22WQYtSF/VGldPxHRryk24GdCv+Qlbfm84ugHZJPxwv X-Received: by 2002:a17:902:aa85:b0:149:4614:bc1f with SMTP id d5-20020a170902aa8500b001494614bc1fmr15257006plr.150.1643050209142; 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=Z64kYQytmPkhLY9XKhRmm8Qr7XvE045T6ER/rKkrjiU8NGd/ewY+5X8YHwxPbdC08t 3Tl89Z+PaHaoJ5poj2FdAxy2/du2FClg4ulAP9b9LPxSwBwgIdoVRfbetSs3mwvzGQGJ +Wc+pY8ariGo5zGha7xem+uj2v/qsIbEpVq+0hHX2Iypbrm3mTVNy9JefMxHDqcmLkFl Gi/Rm7VuoJriMQLDme6tUpGOo2Q6gl7tBdPw7tG3QxhZmbV3hgsE1mDxh+mWyyTqno8K DZuCziin8dyPOJbsvziFX0QAiXzsj7nBrXNqLLF3aWGfqA8yma0fVPJcCE2XZVhiT3Ki dDGw== 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=wJ6QD3BuoJQ8BQIzxedxfuDJJlPS03gECmKyQ57iA0U=; b=QRH+Hvu0RDHUNkSzfGj0GaTBfxRsQYGNtlM+14vVfpISJa2CzIYzkEYW1pTwdll3cy h79reVUbpWpX+M8ceGr5F2Jwn3UoDtT5bd0szGIq/i1WUOoleYoyW4hII+me0D3REKad IrCMpewWpUg19WrXc+wriBhpyk5YBr81tRKj3Bn4jzdfeIflAdoitvNEFQQoZlurvDZz jZSZ7n/rFs8vEFPVzBtLWA7DQGKt1Mft5O/7kq36H3bvARI5AQaYW5rtBixGcCAkEC7D MjIgH8Rh+Ef9Myneubm7bAQFHBphvjjMoScKLHuUq+XftpnO+qQUrttXXd1plwnOBAiB V87g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=fVYeADUe; 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 a13si14988086pls.14.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=fVYeADUe; 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 S240050AbiAXIGR (ORCPT + 99 others); Mon, 24 Jan 2022 03:06:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233770AbiAXIGQ (ORCPT ); Mon, 24 Jan 2022 03:06:16 -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 AB7E9C06173B for ; Mon, 24 Jan 2022 00:06:16 -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=wJ6QD3BuoJQ8BQIzxedxfuDJJlPS03gECmKyQ57iA0U=; b=fVYeADUeb5tqoelotfGdqOj7I5 3OlzpbFNKtPLJlZUzwDqvLGbdxieHpz5UrOuYKIeGtnPBqhMU7vvCmix75iz3Gddl3WLkflsN5CRl x/+oNuw+gudQ+qRyeP33dQkl25x8peTjRPVow/nEWWLynU1+9WSwXf0xXMYx35U6528klbQQkGtr6 sh7HguUVcUGp7h2TQKJVv+cNbFn4ENljT/1scj0/OAqufZ03qvfyF346VNNIShB/K9uHl6SX1XQ15 Bp/1Qb+f6p7LVDXRRn3gOdbD1CHtFdZUyWt1tzI/EjCewKB4Em9R/5sPvuFMRiyBWOcQpMSLXU17w kgy50vGA==; 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 1nBuMH-00374T-2Y; Mon, 24 Jan 2022 08:05:49 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id AD17598624A; Mon, 24 Jan 2022 09:05:48 +0100 (CET) Date: Mon, 24 Jan 2022 09:05:48 +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, Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira Subject: Re: [PATCH 47/54] sched: replace cpumask_weight with cpumask_weight_eq where appropriate Message-ID: <20220124080548.GJ20638@worktop.programming.kicks-ass.net> References: <20220123183925.1052919-1-yury.norov@gmail.com> <20220123183925.1052919-48-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220123183925.1052919-48-yury.norov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 23, 2022 at 10:39:18AM -0800, Yury Norov wrote: > kernel/sched code uses 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. > Same as with the other patch, you're just making the code more difficult to read for no reason.