Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4370541pxb; Tue, 2 Mar 2021 13:26:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxewoOuXQWLIJLSxQGKwawLbxSHE+7wGOFhomQbs/gqFYtnvtvUo+Oaw6aogdW/YltXbX1h X-Received: by 2002:a50:c00b:: with SMTP id r11mr22978244edb.35.1614720388414; Tue, 02 Mar 2021 13:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614720388; cv=none; d=google.com; s=arc-20160816; b=Vwvg29TJOqgWJqTeXHGXyli0uOWyUVzAE2wQvmh5/Zb7oYeR9KefbRslQVSd0igM7O 72GSKlyI6Kws9kJ7/E97lU3RgaApx0eKlpAwiRYNr61aFiDuqiCNCSNo9YQzoY7iAduB 8pypWGuL3KWd6/TayfuwZxRfFs832eEepmEd79U67JJiypvfLSry+7TUMcaHMCER+Qpe jF3DHJHW4xB1fXGr7yQd9d8n3oFNdATijxVKTGUgsKXaahLSceY58nKGTLBTUZvo9vlb t8m7FDTpuxWE5yRrRbGJ6onSwWIcW/rzqumL3AUJqA9WDATfEM5LdwNwW39TK8I/x/jd 3P/A== 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=JX1C5DGuVebGBtGesATRPTSUT33rJIsA6K22Xk8Yv98=; b=ed7LOApQUZTt26RN6BMzM9vOJDculGo0gStzMve1CpwVIP1JuYZct8einM0/yaG2/P B/F4s0oCMY9FXmAM5o+9ClXJd3pl6UBawvG/C2+2Wyu8pLc0VY1eH+mq7kwz2g8TwpfE kRAtwB/nSzIOOyeRFa1w7H8W+YXShenepA3sqm/VPJj/3QrhFI6gluBha6KsbjClIVmu p7mT5W1hFoC2lr/I3jq5HLki6qLm8gnTzxTuclLBYKA/j6lu+tMCkpOpsoVnQTi4n9L9 2yv5XHYce15v+reikbZUQ4PR7PyQW+d0s5SX7JB6Ga5GdthyHzUu4GkaqUWNJSWYiavO fIVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=a7YZbcDs; 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 e17si16167510edj.155.2021.03.02.13.26.05; Tue, 02 Mar 2021 13:26:28 -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=merlin.20170209 header.b=a7YZbcDs; 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 S1379042AbhCBJix (ORCPT + 99 others); Tue, 2 Mar 2021 04:38:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1837920AbhCBJL3 (ORCPT ); Tue, 2 Mar 2021 04:11:29 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E1C3C061756 for ; Tue, 2 Mar 2021 01:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; 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=JX1C5DGuVebGBtGesATRPTSUT33rJIsA6K22Xk8Yv98=; b=a7YZbcDsDOUveA3I4Y+6VqUd3W O1RTePZy5WpgcxfvRyDQ0uekheSN8gROr4PBlzBjFEMZ3AEVwYhd6RpyM2K6mpvoC9pkHy3zhy0WW GU+WkK0gidfJNlWdZzQeCDWTRy5QXCnhW645wlJIKm7dwtGgZAYwqEjQw2NWAOv8YTkT9u5zcqdKr RvLuRMmcLjKoX4jREuymY/LBDqAs+CIzVs88xhB/yyhTy32ccclezLL/fZ/j8fWWJjwFdKwTSQudz q6TOde15uhgOAI3cXxitn/WDeOyIwMTD9Wxv/KNSKhkq+7d4lrcXs0Je2DlS+zQmI5uPXgaC83Mrj EH706+3g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1lH135-00008O-IK; Tue, 02 Mar 2021 09:10:35 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2A8DD30018A; Tue, 2 Mar 2021 10:10:33 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E3A892215BD3B; Tue, 2 Mar 2021 10:10:32 +0100 (CET) Date: Tue, 2 Mar 2021 10:10:32 +0100 From: Peter Zijlstra To: Srikar Dronamraju Cc: Rik van Riel , Ingo Molnar , LKML , Mel Gorman , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Dietmar Eggemann , Michael Ellerman , Michael Neuling , Gautham R Shenoy , Parth Shah Subject: Re: [PATCH] sched/fair: Prefer idle CPU to cache affinity Message-ID: References: <20210226164029.122432-1-srikar@linux.vnet.ibm.com> <20210301170601.GJ2028034@linux.vnet.ibm.com> <20210302073946.GL2028034@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210302073946.GL2028034@linux.vnet.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 01:09:46PM +0530, Srikar Dronamraju wrote: > > Oh, could be, I didn't grep :/ We could have core code keep track of the > > smt count I suppose. > > Could we use cpumask_weight(cpu_smt_mask(this_cpu)) instead? cpumask_weight() is potentially super expensive. With CPUMASK_OFFSTACK you get at least one more cache miss and then the bitmap might be really long. Best to compute the results once and use it later.