Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1459869rdb; Sat, 10 Feb 2024 03:09:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX5XJi9UrKY/S0PF3agRH+veMDlcHUZpy/QsOTHTfo48MDamsB+8PbwV3NcYZS8QpnWTYkMAsbPwFfEywt4Y/otnL3mwrmxt1J+sy4w3w== X-Google-Smtp-Source: AGHT+IGQwy42LeQR/bRPnbGSWwGDhUm2i2BSaCqFENeE5ZSxvQvm9ZorpgD5M1g3qLmue3ABITZZ X-Received: by 2002:a05:6214:2a49:b0:68c:cf4d:87b7 with SMTP id jf9-20020a0562142a4900b0068ccf4d87b7mr2664577qvb.9.1707563375559; Sat, 10 Feb 2024 03:09:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707563375; cv=pass; d=google.com; s=arc-20160816; b=aMc0dQYQd29g5p7TRmJ/rn9KbJNZ6h4uX3tzULCPtkhSeSPBpHSCg6O8xST8MBX//Y ljDnKanZ6hgQEC4jCMo+Yk/wYSD6XCGjboyJYP1/rJGUSD7hbMXAEa0akpZdHlbAlHOQ vG8OpJ/PJtJWlt+AoFETUG+3UuWVfhm/XJ/E2EqevMVrhoemQcxjsocMMcV4bdlxv5BM f6iOdS3hHQ16kOn67gHS0/wN922MBwLDjcvebdX6bRvCk6FbWD76n8q4q47rAntvUMrX 3q7OEEJ2w6/pBuVrskBzYqEEH05CT/QGcukCzY3sXCH+SfRT6bSlAxkY7HzrAs1ksaJ3 nsiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=55RoOzZzrdE7x43zEUIFZoJrICBJ4MroOWStmhN2xms=; fh=hYgwFV6V8uxP30DH/ub4Eawz3ublry1WTGk1slwM7TU=; b=ob3d+OvJ660o3WHo1zXyFadur0bsPJ3jhGS/p9B3zNUwILaj7Hr3RN6JPZ0n/AylyJ iQdmwujgTaWkh/nTsBx4OZ3TiKupghcfKG7CnB7V6jPk0RaoClI+DJ+LpKepiLlmTMmo emSLLoLPynPeAU3ZKXMuKUFbNnFXD4MjJNn5GdYEIOBHFZIuWby32ddvURtzpMcKFyMT X2TmDymQEW0vxMFr7hWzNzTaT7FxMuLa5AZMeYRoFs1JayDEvDc4RuX8QktYr5Z1I/sV PfK1II9o5dgzFakHDW5uJkx3EMKZZHIBI0qb+lKVVtsCQ3RM5ESl7b3Wn5qDyHkYgd7N mZQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="WGC/SAai"; 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-60371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60371-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; AJvYcCWsQOlKWy2/LGTEjDkjuQBetU7Yra6ekKnXHfLzR8bvZWWa9Zn9vTXmdmlyOPRFiWRuSmvmU+nHFIJ0c7xwb2R9OjGlEY9YXFOs+zv+zg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e2-20020a0562141d0200b0068cc3b0f1e4si4519199qvd.411.2024.02.10.03.09.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 03:09:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="WGC/SAai"; 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-60371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60371-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 046E21C222B6 for ; Sat, 10 Feb 2024 11:09:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4782F376F2; Sat, 10 Feb 2024 11:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WGC/SAai" Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 87D0D376E6 for ; Sat, 10 Feb 2024 11:09:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707563366; cv=none; b=aTE3ZYPuBxs9wh4XXx/ZA9b17apD/IdvKrys30lv3NBs3S+lI+Aa3hAhUZEuX3D7eUlkHy1sj19gHHgU4hQ+DuFsVMEMs3uztrvPnwMqRAlZ1LSROGXnkhb3QnwNK8PhM2sP0ffoTVYiJ5sjQWYNLHYgfV63f1eMlJmFeMUEo5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707563366; c=relaxed/simple; bh=COtOtkKYIbOOJ7+Wq/bWqgQ2qdXBCUNh1bkqgvYzZNs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NRbrzNtYwb+CwKYASYpWU5DI8cnmGsqdsVlGp7wM+LIN0XsQrWydsmEOTyHlFi/eppxgT3IPhFDXisBVjiUOoz/+KSfcTvL+lop+mUMKtKx7bE2whXWOiSw4MIRAhPaCtfyyVCnRPBrOJkO7icKIZLEOlVODBFEhu90KMqGfj+Y= 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=WGC/SAai; arc=none smtp.client-ip=209.85.208.170 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-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d0d7985dfdso24006281fa.2 for ; Sat, 10 Feb 2024 03:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707563362; x=1708168162; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=55RoOzZzrdE7x43zEUIFZoJrICBJ4MroOWStmhN2xms=; b=WGC/SAaiPrxIc5QptTP86/Rnv2oDUP9Ua+8GUgLoNF+SFjLbxBJqTruNmfDNN+PBfY XATipSP/cfF6GVyOCF0UZ/xl6a1w4IF47xsPCnRFCxClLaYxs5AsOC8u4y7h/b7noIrf dI/uR61uoZmx08AIN5+xl70v3RMkRbnKEbpXsjLT1wysFtnVPnTKOxNB4C/g/2W5EKZh BCfLLRjlIjtfwapEC8zTvUfYU7ZD8vniXB+EgQwvuweCiqdhVOeRIRnVOuaMpiRx6xyc lEjXOuV44/aM1FZwkokzr8VslLBVi3I6kqMmXO0M0I2htxxVb0al3Dk9RvJuVbv58+dR zsgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707563362; x=1708168162; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=55RoOzZzrdE7x43zEUIFZoJrICBJ4MroOWStmhN2xms=; b=hQJOgBV5jpixYFL3tSc/Pxaom8WB/EuwS84SsLDa17tw0Pp/pwpYSVdt8JuXyqsQ9b Wk8ZHnet5Oe+TeQrNSdRxHyZzwGe/fhwqj626EvS+HJmh7jqYxinzONrgUMzXbS3Oafl GxwvY0Mvn6LMqbljCK/AIUxuMtv6G4syBnmXCl39rbtkqPPBgzIJVjo1ExomTrzOREWr 0vhB8JIOQXe/XlTVdUqT22e2rL5FlqNuG0rmHMCSuo32/hws1LVMh7bjD86Li0+dwEkw XiLMHtatuP1JTHdimuSVNfniDN+3GmeonrFPxiqWTa2Ai7jy3a3eMnmJzeb3rrC13CKz ambg== X-Forwarded-Encrypted: i=1; AJvYcCUMpVDTY7JOmbozpP4ShtP3+Qdr0Q8ilzqI4qGBSP9vqppkUmBF0X0PEQfdPHPTrkSDeev/G+81REMm6I6tznkVI0P40ql0+/wDjGRN X-Gm-Message-State: AOJu0YxEdWpSfxIfGUY11rcKkVl3mePyAht19fDjKzXu0tMN5droc3sk u9ufO6D2ZI/6fe+mdBUoD0f2WgrrWTaBM3iV+uBiT5xMX2MRcom5Q32i+nblDF2r7893oWLjQoQ idKYREARnNX/eR94e2svSstUcB2w= X-Received: by 2002:a2e:3013:0:b0:2d0:aa28:6f77 with SMTP id w19-20020a2e3013000000b002d0aa286f77mr1085899ljw.45.1707563362242; Sat, 10 Feb 2024 03:09:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240207034704.935774-1-alexs@kernel.org> <20240207034704.935774-4-alexs@kernel.org> <20240210011223.GA28896@ranerica-svr.sc.intel.com> In-Reply-To: <20240210011223.GA28896@ranerica-svr.sc.intel.com> From: Alex Shi Date: Sat, 10 Feb 2024 19:08:45 +0800 Message-ID: Subject: Re: [PATCH v4 4/4] sched/fair: Check the SD_ASYM_PACKING flag in sched_use_asym_prio() To: Ricardo Neri Cc: 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, yangyicong@hisilicon.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ricardo Neri =E4=BA=8E2024=E5=B9=B4= 2=E6=9C=8810=E6=97=A5=E5=91=A8=E5=85=AD 09:11=E5=86=99=E9=81=93=EF=BC=9A > > On Wed, Feb 07, 2024 at 11:47:04AM +0800, 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. > > Reviewed-by: Ricardo Neri > > Tested on Alder Lake and Meteor Lake, which use asym_packing. > > Tested-by: Ricardo Neri It's the best gift for my lunar new year! :) Next version with your Tested and Reviewed is coming. Thanks a lot! Alex > > > > > 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 =3D 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 !=3D CPU_NOT_IDLE && sgs->sum_h_nr_running && > > - sched_group_asym(env, sgs, group)) { > > + if (!local_group && env->idle !=3D CPU_NOT_IDLE && sgs->sum_h_nr_= running && > > + sched_group_asym(env, sgs, group)) > > sgs->group_asym_packing =3D 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 he= lp > > * 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 =3D=3D 1) > > + if (sched_asym(env->sd, i, env->dst_cpu) && nr_running = =3D=3D 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 !=3D CPU_NOT_IDLE && (env->sd->flags & SD_ASYM_P= ACKING) && > > - sched_use_asym_prio(env->sd, env->dst_cpu) && > > + return env->idle !=3D 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)); > > } > > -- > > 2.43.0 > >