Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp860605rdb; Fri, 9 Feb 2024 03:33:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXt8aiFmXy9iGGqPLt1ihiwfFzSEbB9h9lC8q2/x0XgXqcREi3CP7RGCQh4oXauaGvvcMWJogIFiRiiXTqTEaVEO51po7LoqR4xi6vDuw== X-Google-Smtp-Source: AGHT+IHRbWRSJfwBEUVJCcN2j/FmitLI7vwsFwL0EtU1Zhp4bxfzT7OzMvaL25kc3v3/iViI2i7W X-Received: by 2002:a17:90a:cc18:b0:296:1cf3:e5b0 with SMTP id b24-20020a17090acc1800b002961cf3e5b0mr1069146pju.29.1707478432107; Fri, 09 Feb 2024 03:33:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707478432; cv=pass; d=google.com; s=arc-20160816; b=mXcW+cg6k11rDps/PiFwU/spMNR74Qn5DWjXt/dC7qlnCTl0cNtx3WKsfTJmxK+5L7 J8YcH6drSXc+z7XSf/9cyOPccIrH03VLAktIIrWVc0VoKynNWeUSMcDPi48JC9dt2tEO BWmewCvcovxYAQ78q4TuN328q9f5S/9dC2GYV8JuMRFQBtCX4kXoc90sqEh4FAGAI+3X PdOzalyX/n3OTQIxvwGHFthjqqVCU5jQbl03nhkhRwAw3PmGy6EMV9Ig1M/iDnqcWCY7 H2pbE6IaesIzumaIBluTqIeFE8xeZ6pAogWGtEIogJCAwCwRQdqS8mfeGNYC+PKtrJPq A+aA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1XXjDhP9nLtrxtdF4uU0uugVAt74PW9a05majkCSGnQ=; fh=QzL76OkPHySfgj3ORrp/5Z6eDJtlVseD81I7T54/Uok=; b=R261VCcIqh96uDtwm6beb3aNFFCguuSyGgUNc6R/lLslMjYjmKu02eAJbGYJB9bEGh zUv6ClSgFn44EFv8HM5CzeAOnyC/9pNLuo12+m80XisgjqwnEbA/uV9mJxTVx2KhpQPl jU35GDc5AF7ddPnegJKropa/1UcDIUdw6059uYcc2Z2XlJoONOx6fF6frB/FWVp5l2Cs QJjXTvE/XTp0UM6jfIDiXAnWIVHv4JyjwcHsAT7GdcxrZV+h9n5acannQvWT4t1V8UZb daV/fs5r8eFkWUHsqntr+QoR5yURqFlPBzs3gRus/EEVYrC1OWahQvTVcxarz81HQuDN 3IeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=miVWYdy6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCUQ/urjmkDONEUjYGQCxDZvVMjcfSPOJ/BqsdCcqn/nptQY1C08dLoo1JUA9CS/WdvwH19hnHUVkgrF8zl9Pg7wgaoAdCVQNYDAfFqLqQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s14-20020a65690e000000b005d8c07588basi1569053pgq.561.2024.02.09.03.33.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 03:33:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=miVWYdy6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D0F7EB22B52 for ; Fri, 9 Feb 2024 11:12:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68EFB28DBD; Fri, 9 Feb 2024 11:12:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="miVWYdy6" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A72225618 for ; Fri, 9 Feb 2024 11:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707477138; cv=none; b=upZWsPUbvUSz0OWNEfBJXa0lTzoRIMqBNWsJx0fe5wZC4HFDBFagi8pr7W4Pmb1J01bemoHkATHp3NUIeIHEVtccXkhlxbJCCCiZkHvrzwzSRP1wZaSgIpMLDDdZvqizjFoQjShPPdAds3OkvHosZtrriiMSx84t9NMFd8s119I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707477138; c=relaxed/simple; bh=HIYMrYtonymq7acf8E7e587AAl0PTQyop4vxHOQ4YRE=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=hoEgdpIK50Gk2KLM+DsXfhLfJN98YH0clinUFqbVLROvPcobtoJR49dVhFjxJhP/b+P66vAPIRMr6/temZQxMpj/etlDdabi+0m9FdgPfACjIfDncvpWfBEgBgDcP2gH5+LuAoCleEx+uOtEnrpNJiy94gIVUso+gFHBHGqo3Lo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=miVWYdy6; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d953fa3286so6358195ad.2 for ; Fri, 09 Feb 2024 03:12:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707477136; x=1708081936; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1XXjDhP9nLtrxtdF4uU0uugVAt74PW9a05majkCSGnQ=; b=miVWYdy6/CbR4erfUBywTOOZDYv5Q7JAaOjQEpXkR8XppDvQB/RgNj+q9rNLDe1SNP J4AVuJFsjpsK+8v1JPyyaV6UtsZbZ3vuY3TgmUYve99xhfFTdYQQlnrwRSxt+QyUaqGJ y95KofsW88a3c+UU4gsAs6/1FAj1CrvIU8n9m0z8Qx2wdfpOKljJezdMZgcild7Cl0b4 J1WOl0lLPX3nfq//0Ri4tB4tlwimUZ7aHDiTk/MbldNW/heuuzpDyOyGEQDk42V7cwS+ qyylILKAt51JNXJP+kyggBNIHiIEnInrXGRLWZZbDC5HUXQVMhW+6b0Z+oNxQx+OpTAU K2Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707477136; x=1708081936; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1XXjDhP9nLtrxtdF4uU0uugVAt74PW9a05majkCSGnQ=; b=L4SdZ2pHPS/HheiESGcRmpy14NKnB+oeaFAXV5FwYalM/aB5xHmVYjrhyLkEuHUPVg xRJhhYzTBCyXqikUxEX7HG/tKxxcvXUtJe7TJtyLKIyYx47ZbR9ST+m9xj5rBRqc+NkA aPmq87Z1mI6oOQGL9HaR/qMzvdfiB97xA9on8ZSrucHIY5lt4zXZGoDcR139aBJpmcLg Fa4qwuTjwiGsNfeoOg39tP/97AC1ZWH3gvsAZnBtI5FfvFpr94jJ0AaSid7DNeq5nCLt Xthxy9AXDI2EINKop0y+MjEuwXmFbz+Bfwhjo5Ay4nKKxpnDKMxsAQrfN7Y9rdIpP2/g Baqg== X-Forwarded-Encrypted: i=1; AJvYcCU8npm8gR8Gukod5QQOCaITrXvjurhsvsjqPUDqk5FXJr+2TP+ZznDjiUcn0pNB5RHA6gmz/0nT8h0WcIA5C9OiQnP/SNfE79ylegyG X-Gm-Message-State: AOJu0YwqXSY5MrYQQDCsJD+70G3dIXm4RRhnzi60p1MgQFue+cg8Rrbw YwmkroZcrOR9V1BDnREDIvN03+6bopSQsvuh+dZu+SpNgrLxoeY6 X-Received: by 2002:a17:902:e986:b0:1d9:803a:8b14 with SMTP id f6-20020a170902e98600b001d9803a8b14mr1222572plb.59.1707477136387; Fri, 09 Feb 2024 03:12:16 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWjEU9M1ho+pB48BzoXsHiPmI79MoppsWcrDD6dsDQRm8fnOL/oBiZip1m01bvzfwzJmUKs8VtDZBtMdZQmKhh6sRNqhQKaHNvaanHQjafy1VeBmw28LlZKOCr183gsM4F1iMiQcFFDdAZc6vcD/dxO78T7F4S5Ir9Cw8eNfCNycGk6yC/tMz8QwuPf3uV4knOI7LDl0wr2D0v1/6f5RnK11e/zcFclMJsCBN5jppshzFFIw5VEIAn/1kWpcTgTn5tP/NEeeReCZlmCdLUb3+lLko/txZesib70nxm22Z9K6wDoRzEvb8ngKeBcjuaAslnfAQ5T+livZgIhFIAybGUKqkx8Co3S0GPi88RmoGnigK4O2/HqWtagn6TwspiQgoXnwfPXn+xhVYXd37ZwXaSyRpFwCmwhmJ0BMGWPZisLsTUnwU8i4nohTU5jiE4iFdS1IQQN Received: from [192.168.255.10] ([58.32.33.209]) by smtp.gmail.com with ESMTPSA id n1-20020a170902d0c100b001d8b0750940sm1280590pln.175.2024.02.09.03.12.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Feb 2024 03:12:15 -0800 (PST) Message-ID: <4b0e6966-eb31-4d44-99e2-e33294c7e129@gmail.com> Date: Fri, 9 Feb 2024 19:12:10 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 4/4] sched/fair: Check the SD_ASYM_PACKING flag in sched_use_asym_prio() Content-Language: en-US To: alexs@kernel.org, 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, ricardo.neri-calderon@linux.intel.com, yangyicong@hisilicon.com References: <20240207034704.935774-1-alexs@kernel.org> <20240207034704.935774-4-alexs@kernel.org> From: kuiliang Shi In-Reply-To: <20240207034704.935774-4-alexs@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Valentin&Ricardo, Any more comment for this patch? or Reviewed-by from you as a Chinese new year gift for this patch? :) Thanks Alex On 2/7/24 11:47 AM, alexs@kernel.org wrote: > From: Alex Shi > > sched_use_asym_prio() checks whether CPU priorities should be used. It > makes sense to check for the SD_ASYM_PACKING() inside the function. > Since both sched_asym() and sched_group_asym() use sched_use_asym_prio(), > remove the now superfluous checks for the flag in various places. > > Signed-off-by: Alex Shi > To: linux-kernel@vger.kernel.org > To: Ricardo Neri > To: Ben Segall > To: Steven Rostedt > To: Dietmar Eggemann > To: Valentin Schneider > To: Daniel Bristot de Oliveira > To: Vincent Guittot > To: Juri Lelli > To: Peter Zijlstra > To: Ingo Molnar > --- > kernel/sched/fair.c | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 942b6358f683..10ae28e1c088 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9740,6 +9740,9 @@ group_type group_classify(unsigned int imbalance_pct, > */ > static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) > { > + if (!(sd->flags & SD_ASYM_PACKING)) > + return false; > + > if (!sched_smt_active()) > return true; > > @@ -9941,11 +9944,9 @@ static inline void update_sg_lb_stats(struct lb_env *env, > sgs->group_weight = group->group_weight; > > /* Check if dst CPU is idle and preferred to this group */ > - if (!local_group && env->sd->flags & SD_ASYM_PACKING && > - env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running && > - sched_group_asym(env, sgs, group)) { > + if (!local_group && env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running && > + sched_group_asym(env, sgs, group)) > sgs->group_asym_packing = 1; > - } > > /* Check for loaded SMT group to be balanced to dst CPU */ > if (!local_group && smt_balance(env, sgs, group)) > @@ -11041,9 +11042,7 @@ static struct rq *find_busiest_queue(struct lb_env *env, > * If balancing between cores, let lower priority CPUs help > * SMT cores with more than one busy sibling. > */ > - if ((env->sd->flags & SD_ASYM_PACKING) && > - sched_asym(env->sd, i, env->dst_cpu) && > - nr_running == 1) > + if (sched_asym(env->sd, i, env->dst_cpu) && nr_running == 1) > continue; > > switch (env->migration_type) { > @@ -11139,8 +11138,7 @@ asym_active_balance(struct lb_env *env) > * the lower priority @env::dst_cpu help it. Do not follow > * CPU priority. > */ > - return env->idle != CPU_NOT_IDLE && (env->sd->flags & SD_ASYM_PACKING) && > - sched_use_asym_prio(env->sd, env->dst_cpu) && > + return env->idle != CPU_NOT_IDLE && sched_use_asym_prio(env->sd, env->dst_cpu) && > (sched_asym_prefer(env->dst_cpu, env->src_cpu) || > !sched_use_asym_prio(env->sd, env->src_cpu)); > }