Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4237192pxb; Tue, 25 Jan 2022 06:25:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxx3dtVss82UYbALERJskjAsscXaNSfwBm7rzina26Ac5yXttRQkMhjSb/zo32f09+VcySO X-Received: by 2002:a17:90a:8548:: with SMTP id a8mr3795075pjw.126.1643120746026; Tue, 25 Jan 2022 06:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643120746; cv=none; d=google.com; s=arc-20160816; b=lKinAQZ6qh/knF4w4KWNN56XIr9H3Anw9ETERRils5fugG4Zi2g3acWTVCd3nTrTFE Ql/6LuC1bpE3R8sbQ5rEbpcCYG0ElLSjWZ/XINsszOAvMU74sqc6YOJ8AAPrHYYzkSGE 3xzxhAe28rNSIA0bPGdnu64DMr1fzYlum+u78wBzsDr/ll+U4GZVcO+Ob/qeInjx9TmA 7/fnTo6ftyMrq4ZFdSWLg941F2NgYk1M3hIioL2Yq+HkMg+IMZlG3HcVGH5cLnjFIb7N rX5EIBfzEa8d81NnHlaFQHh5tqwCklU8XACoGuDytZHSrzCiVDGUy/dRFl4pQEQs1i3o ykNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=XZvysK/COYuP/tsdIKEk4aOA5GqYBNJdlRvc/pB3D48=; b=N8OD5mciEqiWEJbNCjEfgrzMhEKBRriy0JtkhTAr2y+s0MqoILE+FM+fTwTw3KL89k am7L53LI5R/3XS7npwuWEeRdnHY3abwYWLr171oPNeaac40CWAAj/8/3eZpEacgCuEcR WARhZmWBgE5x+TPYZWLeXCYvFHnN/0J+z4o2JqMDHSo4NI8gaJIxsq9tsnBa+Is2FIUC Aw7jSH2E/qL0euk4QHyzmbV6aPblXrHCT3nfc4ajEOWigtxd/j8P6HpCSmju8Dm707qR nheTMtI8Ky7GZPOVY1NObG2nxMq59JqNV1e4uGQBv5UFu6MAzTvhbyzJG0Ptjhj6iRf5 wwHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BTGEaOqB; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si18085821plf.139.2022.01.25.06.25.31; Tue, 25 Jan 2022 06:25:46 -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=@intel.com header.s=Intel header.b=BTGEaOqB; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574328AbiAYJdS (ORCPT + 99 others); Tue, 25 Jan 2022 04:33:18 -0500 Received: from mga09.intel.com ([134.134.136.24]:10422 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1456409AbiAYJ27 (ORCPT ); Tue, 25 Jan 2022 04:28:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643102939; x=1674638939; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=/3uEJq4zPTSgXMeNYS74/NJZJxAc2UOZUhqwmZmqIfw=; b=BTGEaOqB1W/J8BzO+bDSEQhZ9eEotYEsiXr959Z4Y3GDonZuHhKreqO6 RKkazeERMBnrziJ0G1rt6lJf2b1aMFI/4kTP0w8WwLVWfp4a49RIUrOhb 7gTl7csQW0jxBYjtSqkvW4H4SxIUDgWxzr5ibfRu/UiH0//Fcx91qE0Ob ffgmcZ75+hM10VQFDGYGP5pwZAWRqyJwr79KSVqh5iF1XjOH9fo2xkOZW cnL82tTuTXLbEPsloXQKlbFW74IpY2onR/RwqkK911lHisAwMqYQDTVWM 3eYK1jV2eQZ6mxFBc3GbswEY0xP3KQ0NJWE2tDMbTQE0GczJm9A3WX2Wh A==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="246044824" X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="246044824" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 01:28:55 -0800 X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="532366265" Received: from thpham-mobl1.amr.corp.intel.com (HELO [10.213.172.16]) ([10.213.172.16]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 01:28:51 -0800 Message-ID: Date: Tue, 25 Jan 2022 09:28:44 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: [PATCH 17/54] gpu: drm: replace cpumask_weight with cpumask_empty where appropriate Content-Language: en-US To: Yury Norov , 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@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org References: <20220123183925.1052919-1-yury.norov@gmail.com> <20220123183925.1052919-18-yury.norov@gmail.com> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: <20220123183925.1052919-18-yury.norov@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/01/2022 18:38, Yury Norov wrote: > i915_pmu_cpu_online() calls cpumask_weight() to check if any bit of a > given cpumask is set. We can do it more efficiently with cpumask_empty() > because cpumask_empty() stops traversing the cpumask as soon as it finds > first set bit, while cpumask_weight() counts all bits unconditionally. > > Signed-off-by: Yury Norov > --- > drivers/gpu/drm/i915/i915_pmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c > index ea655161793e..1894c876b31d 100644 > --- a/drivers/gpu/drm/i915/i915_pmu.c > +++ b/drivers/gpu/drm/i915/i915_pmu.c > @@ -1048,7 +1048,7 @@ static int i915_pmu_cpu_online(unsigned int cpu, struct hlist_node *node) > GEM_BUG_ON(!pmu->base.event_init); > > /* Select the first online CPU as a designated reader. */ > - if (!cpumask_weight(&i915_pmu_cpumask)) > + if (cpumask_empty(&i915_pmu_cpumask)) > cpumask_set_cpu(cpu, &i915_pmu_cpumask); > > return 0; > Reviewed-by: Tvrtko Ursulin I see it's a large series which only partially appeared on our mailing lists. So for instance it hasn't got tested by our automated CI. (Not that I expect any problems in this patch.) What are the plans in terms of which tree will it get merged through? Regards, Tvrtko