Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp2018218rdb; Wed, 31 Jan 2024 17:12:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmP5EGrtRB3qbHR9d5cCxDt6oIRoQzUdnaJlR9DpGh/e8RNvEMU+vWUw7GB9Wjyv/aqkz6 X-Received: by 2002:a05:620a:12f1:b0:783:82af:f516 with SMTP id f17-20020a05620a12f100b0078382aff516mr1105971qkl.62.1706749970464; Wed, 31 Jan 2024 17:12:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706749970; cv=pass; d=google.com; s=arc-20160816; b=vXeJgYpcbdXD6O0xOjsjMcrEH+DdDJgqKFstumqRmdRsYI7oQ3mWTFztfDAEycSPXJ XsO4OPMOSPr57YJz4XZ1QcHy53ORzRn+Dq3Dmh0ctGlr/KNZVXAlImidYQFLUQXNoTwd /i1c4QGaQpwTnhX24yyCmCnzZamtASEOt8cfyrY4KB20gsO+gbnbWv+h7HGQKO/FiuKQ RlO/eJp9OXILR5sdwJ6uIIo4IFt36h/UUpoBhLUhI0DdiUDX6MKBjsL5tG2877cJS25n C+V6SZjkxEnKKTj9uuTx5jrzI34EXf45wjGyo36rnBEPiTLALuu6MYeENJxf2bjUlQp1 +I9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=9RrsO3zxZqMssQfyAg2nakVLy6YM4xiMzjf8nvW4tPo=; fh=lZAcx/9GMupdh8pAf6dmik4j8aJJghMoLCkehGKrlAo=; b=m4RUL8RGYnZOBV/l0AE0JD7QCIIFgdv+gwuTq/GhR0JPmNJJT1ADYyiQBnA4QILopa LTKHTecucjOQAD8icNMQq0xi1VepRz2Prsi+VdlIPPAyQfYESUPRZUFR0rxsTd3jr+9J 1KnzLdw25ftbvdDoDQGfaLUXQdjI59gcCPa0zhjrQwLVMhmp2uTQ+ubxD2Bv0IqdwA2v Erag0f8Ydx+jKtdv88Ooixr85HXIMG9r2E75IH8fvEHRYgEiIDVZ9vqZOVmRnzKJ+ipr LUKQPEzjGY8xqq/o7x14zxXBEyw/2kzLSB0Rce0bnAWcVLk9xDSTA5/WbIPW7t4nq+e3 CDDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="K/8GZyUj"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47479-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47479-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCU6ZFNK4xwadLZ0wVrhjhNPTLj3oQlUZLdhGhRN0YM925d5M6zREGZTozl+chSIfyK+iv6yHIqGRlAz5HR7Hzc+FZ4ee6aOt2axa8zdZA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a25-20020a05620a103900b00783e4b9e417si10396652qkk.397.2024.01.31.17.12.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:12:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47479-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="K/8GZyUj"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47479-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47479-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B69691C2A588 for ; Thu, 1 Feb 2024 01:12:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B93036118; Thu, 1 Feb 2024 01:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="K/8GZyUj" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69A7D2C1A7 for ; Thu, 1 Feb 2024 01:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749758; cv=none; b=l739gWv3A8lUWolRqgIfUhhYCwu7NRglCijs6yGq18W6Z/BTmJrxFETh4kW+XI4DDQRxbi1309tnA6C4NpZUq17kpx0aBgEapN/U8XDHzKlfmhO+lQXjrouGDNfM6wsrrNXvcXh6QMxPzJS11avETr4Qn/nVblZCK4g0JJOl108= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749758; c=relaxed/simple; bh=7fgLJaTz+fjvVRnJCmgZZzswtZ/OzmScjrU1Huk7Eh0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=st4TbSP7AHHLVQFT32hf9e9GHqRWmcwiyjMttN6zulgqTaJFtOt4sUJ03u4ghIO/CZtdPBwSV1bOM6jhUdBJqNg1+YvkkRnmb1nbv1G8WqXk8pYLDV7kDfZztf/FdznUpVRf5OlElIlGowfSRpV9W5ivINbn3G4aHlTKCA+lLWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=K/8GZyUj; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706749758; x=1738285758; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=7fgLJaTz+fjvVRnJCmgZZzswtZ/OzmScjrU1Huk7Eh0=; b=K/8GZyUj/UHTM+NjL+Ktt4VMOhQ76MwbOyVArCJ6PEAFs/Vq3rS5v9uU 1gzgd+4EyKeV5rGDAg9ug+fHq39y8PyK0ATgePbsPrn58kUbhEhrSMt+g MtJgHcL6HgNeoCwo2lxQ6VsMWccMPFswSv4M37ll5OKKKCP6gFzEMirZ4 yqhG5Zy2NR26qPxZgWqPCRj8FvnJfv7PY0FI+ivAKDo1uiVSg4oyS6ZQ8 2JbL+rf2r/taNPP6Ndw/nrN/anVigfG3j3K7GXxObRomLS+pwa95mMn+J jW/bwAJ448eWnR0y1gNpfZuCYmSkseRfN80T7KeeByQS/KGVeZgr/F7Vs A==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="10427927" X-IronPort-AV: E=Sophos;i="6.05,233,1701158400"; d="scan'208";a="10427927" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 17:09:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="878964939" X-IronPort-AV: E=Sophos;i="6.05,233,1701158400"; d="scan'208";a="878964939" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by FMSMGA003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 17:09:16 -0800 Date: Wed, 31 Jan 2024 17:10:38 -0800 From: Ricardo Neri To: alexs@kernel.org Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, sshegde@linux.ibm.com Subject: Re: [PATCH v2 6/6 RFT] sched/fair: change sched asym checking condition Message-ID: <20240201011038.GD18560@ranerica-svr.sc.intel.com> References: <20240130131708.429425-1-alexs@kernel.org> <20240130131708.429425-6-alexs@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240130131708.429425-6-alexs@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) On Tue, Jan 30, 2024 at 09:17:08PM +0800, alexs@kernel.org wrote: > From: Alex Shi > > Asym only used on SMT sd, or core sd with ITMT and core idled. > !sched_smt_active isn't necessary. sched_smt_active() is implemented as a static key. Thus, if SMT is not enabled, we can quickly return without having to check the rest of the conditions, as we should. > > Signed-off-by: Alex Shi > To: Ricardo Neri > To: linux-kernel@vger.kernel.org > To: Valentin Schneider > To: Daniel Bristot de Oliveira > To: Ben Segall > To: Steven Rostedt > To: Dietmar Eggemann > To: Vincent Guittot > To: Juri Lelli > To: Peter Zijlstra > To: Ingo Molnar > --- > kernel/sched/fair.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 6680cb39c787..0b7530b93429 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9744,8 +9744,8 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) > if (!(sd->flags & SD_ASYM_PACKING)) > return false; > > - return (!sched_smt_active()) || > - (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu); > + return (sd->flags & SD_SHARE_CPUCAPACITY) || > + (is_core_idle(cpu) && test_bit(cpu_core_flags(), (void *)&sd->flags)); cpu_core_flags() can contain more than one flag, AFAICS. Which bit should it check? Moreover, it is implemented differently for each architecture. Also, as stated, in x86 asym_packing is also used in domains other than MC.