From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 1289615748F for ; Thu, 13 Mar 2025 17:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885226; cv=none; b=rsLUA820fBBD4aXrrDgvabHZzZgnHsbTEFvzUojFyzTA3XJu8KWsjN5U23/aqNEA0RfFDXOyZR4IlucZPcY9Fa3cAsX7ZmGp3OTMlHdiLsOIc/G71Ke4lvcxFRreAMFQ5frUc3WLZrpjxzTe/8/nc5XODE8ocsy9W1BEfphEj9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885226; c=relaxed/simple; bh=hPgfIteAKRae6Xb9DtmO3KzHb+o6HvFeO+EvqotCUBk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rq4R58fKqJ0HtmyE3iCmaUmJBmj9GMO6/tRV4fzsnqvtlk8uuZM7TmYyG2xaiVVA6/s+b6v8mcF/jcQEPHAvezaa1omrEcV3X3BYbSHaAoO64vYwJSKbI82J9iscJOyNVar0b/BTM7wDDXo2952rV9FKcac+4fF0nD0YHERJnIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PUTzMvfb; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PUTzMvfb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741885222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j8YjG5ItqH/53cxab3vJ+AAYA8I/sog4WfKqtRusAYQ=; b=PUTzMvfbcSCBI49oVy2UZHZ6gF0FU6i7brc4EztVNV96WEqfUXYoi2sQ2t8WrX+u6Pyje8 h+80Jnkj6ceXpBaTpQQZE4gKqJssZgpCmAK1cNVWz+L3nztOZHEVT0HrdBzlX6Q7C06W9g Za66uExUV6ZZUYZ8HI28WHazy1G6kWI= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-227-PXJzaSreOlGlPRH__s98Ug-1; Thu, 13 Mar 2025 13:00:21 -0400 X-MC-Unique: PXJzaSreOlGlPRH__s98Ug-1 X-Mimecast-MFC-AGG-ID: PXJzaSreOlGlPRH__s98Ug_1741885220 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-391459c0395so532991f8f.2 for ; Thu, 13 Mar 2025 10:00:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741885217; x=1742490017; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j8YjG5ItqH/53cxab3vJ+AAYA8I/sog4WfKqtRusAYQ=; b=APafp0CZ8g5AKjkbzlIJ9BlE2Z6144t7msTZSRGg0VZKfMvudEgMuo8f6yoDQuyyfP jNzKplTPp4ikRlRJrKB3gOdo0+ZBBwJkCcjEKLHOIIl2GpMkAyIkRMlCB5YC92hUX+Ym rc4WFiNrPNwpb7xUJ3kltc0No9rmcDY8HD0TAaP7OLCl7f/qgByg8wfMpiIpdQPtOsvV m9mH41EInBRvYLdfYB/0IIYxXrSEPephL06DkJIHJ3jx8VEKheQJHc680x0EAGBaq9QX l9YPwofXT1Drsetscq3GS3ILTBA9Tv4C1EQ/4Yb7oVoXkSqdJgHVc+3P8uryc6pmnMkL OREg== X-Gm-Message-State: AOJu0YwLwZWYihf3X2XP6y6lzdjTF/ssuCsrzWa+wR59RM++vkI8g7EC 7MEIzZlLybxSjNThRp2esyAFSTdWubssfHSYQrecnsltDb11vl8YjFqQtLRSjf+hubxinFlwocn Od89gnjbFYuDuN5jxmFHpwbSboTYJBN/KS1UVZqz2Md/53u4EBRH2JTEBAc/ox4bQvWOtgZuT2M g8q/dmreRuaO4wiSGtrsjTgd01B4wqHjQGWTY+2bv/eJog11Pd X-Gm-Gg: ASbGncuAfUNROZbp4bC2kVc5vYY5WUMEOROqj1x6jic6Ok/Yx0K3c7z4BEpE2rNE6rx LYU1SiHMvEBigRI7r6kdiCID2HJvG3qvhd85QE1YhaDyCrJ2fYhS2oDOsNcADaXalyW50seWk3h K4/v/RvNriQtnnjuMMD+m2lYkebYOnHJuV6FR8pmoP2AwzqbPZxRn01rTFwNiXclHzK516AnyAJ UnNhe76N8oUfSHC+ulbvFmFprly63VvsxEPuFwhbF+M/2blZa2tn5X8pg8Ar3ul3gV/vj6i0EbF UbNxUrjmIcp0uJpyLyWgBnxMiKiz8VbgbY80Jau7FLw= X-Received: by 2002:a05:6000:23c2:b0:391:122c:8ab with SMTP id ffacd0b85a97d-396c1c207bcmr188059f8f.22.1741885216935; Thu, 13 Mar 2025 10:00:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkUvqQ4kZQgkVidzMwhKp3X0BWVh24OqT8ruMci31YdZKf7dZODGUNpYgkn2DkAYcJwNHbWw== X-Received: by 2002:a05:6000:23c2:b0:391:122c:8ab with SMTP id ffacd0b85a97d-396c1c207bcmr188002f8f.22.1741885216374; Thu, 13 Mar 2025 10:00:16 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d18a2aaa6sm25912475e9.25.2025.03.13.10.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:00:16 -0700 (PDT) From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 1/8] sched/deadline: Ignore special tasks when rebuilding domains Date: Thu, 13 Mar 2025 18:00:04 +0100 Message-ID: <20250313170011.357208-2-juri.lelli@redhat.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" SCHED_DEADLINE special tasks get a fake bandwidth that is only used to make sure sleeping and priority inheritance 'work', but it is ignored for runtime enforcement and admission control. Be consistent with it also when rebuilding root domains. Reported-by: Jon Hunter Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow earlier for = hotplug") Tested-by: Waiman Long Tested-by: Jon Hunter Reviewed-by: Valentin Schneider Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- kernel/sched/deadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index ff4df16b5186..1a041c1fc0d1 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2956,7 +2956,7 @@ void dl_add_task_root_domain(struct task_struct *p) struct dl_bw *dl_b; =20 raw_spin_lock_irqsave(&p->pi_lock, rf.flags); - if (!dl_task(p)) { + if (!dl_task(p) || dl_entity_is_special(&p->dl)) { raw_spin_unlock_irqrestore(&p->pi_lock, rf.flags); return; } --=20 2.48.1 From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 63107269812 for ; Thu, 13 Mar 2025 17:03:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885425; cv=none; b=sWlOQB6EHZZUfqJA2c2gLQ8BB0c/f5DsapTRoeoMGrtnP7wkWsYfJ0r2VmdNzLI2wl4ZK9ZsmJay4/Revu/FCHoDruuCYWK/FA8h3+fuoRi1B4YZX8s71AFjfAiDMzvjCug9YHsv5slR6SVfWM39uQ/E3AA5UTvUi091EdK5L4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885425; c=relaxed/simple; bh=rWzzcRlgHWgNn6FgV0nYpza0tAY2jpiBU7Yx3Kp/uJ0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hTf9FDQYt/wwAWFhYBeP3drp954vP4CIV0n6zL+StHcNERNdE4q8susuWRuVfzjBWSmJpI03GmxQZSDHAtKOoBwKWhE2X62vnD7dHu0578MEup0kugRoGCNCnC3BKlM21viDF1r0CocyYTesi7d3XUdZ68BGz2jCYXj590fOo6c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XJyuB84h; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XJyuB84h" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741885422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EpKB27UpoppNUohxUmSpnADUhWYwKjiQjBLjD49aA4Q=; b=XJyuB84hGZfvpYalPB/YVMfjRbQhbWwe4hZmZKYkwibqd3LyRgw5tBTFSpEinE8R/7DjJ6 1FB8Id9HOfNzbE1Txg1gx5HAXHamU9h4l8sn/dTc11+0TeQRbuUBQEpgvbjPwk94GnqV1W /4KVaCtgN2afvBF0Wpz46xFPZ53ZzTo= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-gbnkQrdUPkWnU_b5nEyKtg-1; Thu, 13 Mar 2025 13:03:41 -0400 X-MC-Unique: gbnkQrdUPkWnU_b5nEyKtg-1 X-Mimecast-MFC-AGG-ID: gbnkQrdUPkWnU_b5nEyKtg_1741885420 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-43cf172ffe1so8505835e9.3 for ; Thu, 13 Mar 2025 10:03:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741885418; x=1742490218; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EpKB27UpoppNUohxUmSpnADUhWYwKjiQjBLjD49aA4Q=; b=WeKhH6GZppPgC+KnFstF121N8ujcrBJ+Ej9A5wlfdhm6MI6N3r04gqr/MfJ2xhvsFx xtyzG/iULc4Rx/51OXWIMsmFpndtqEjhLV1k4jjrEJzaRKQxxn/B2xd6sOCpIuUgIrmW YOlaWh4AEcP8JmDRg7ftH3TB0ptyt8l5NtAwoOCj5qDuIAfTGLkQPWxyFN8xiilETuU7 YlaOB7SecrsS+Y6kXdaD+hlBr5mdDqvq5/9ZabQolNXIVOKvRVMXlBow1h7B3ryhOiCt UJldWsAIFORCK67FHPM00ZtlOGJvhcAHync01bOUP5errcix8bHR5rEcFI8/vOer4O4R zLvQ== X-Gm-Message-State: AOJu0YxG8F6nrvNd2XhMsQsyJ5mIJ5oueAJJhMbPwEN9nI2Cq0xu91QS NgXrKdYLTojJ1QZsx0vPqQYjQf+mNXEJsoQfSJbddpRwAFw7HoNOUkHobLQmUb0+KdIKZ3o9ezT JrnbcfdmWXgWg8BBjYLyrgujz1Tt35u8OV+Cv/jIAu2sE2g9hty3TuhkOcFHPN8nNC5ketap0Ul 7tVCv9Eq66TM2Zo1nAqkBIW+NmrQ6l9oxpImpDm9uFy3lJ4xI+ X-Gm-Gg: ASbGnctC9z4//PQtvJhEfmxF9c0FIKQcOSJByoU+o+Gb0WF1kEELVYlX9VX1oZTcykn y4KRxFwgBpbdbqGWiOBHHRzffIA8YdKfBJuUHeOfafsVjRVCokZ2a8pCr1CLMJWJMMhPJe0gSGw +4yYVzOwGyBp60/BFFkc5SeyOVNhXhQaVavN/OGL+qDbvsu6djRPxsAmL7J2OwgyeaG1VY02bqN PntY1wNe6yeyGr7iCmv7J3O8BRuqbum8A7nrFtOJ3W55ek7n6JlJd9K6hCh0fpsuBqA3b8L1se/ yxG8+x3dO6FVKgu9Nwwwja2okoGiSOuqMRK70QCuqZU= X-Received: by 2002:a05:600c:1ca4:b0:43c:f575:e305 with SMTP id 5b1f17b1804b1-43d1d897558mr4273375e9.8.1741885417546; Thu, 13 Mar 2025 10:03:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE30aiOWpsPCl2pqvgKR9tHw0iFo0nuAsz0qQ6ZBddzYfWJm0vgp05kaC7GI1re3vo/9t8k9g== X-Received: by 2002:a05:600c:1ca4:b0:43c:f575:e305 with SMTP id 5b1f17b1804b1-43d1d897558mr4272595e9.8.1741885416975; Thu, 13 Mar 2025 10:03:36 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395cb3189absm2737097f8f.71.2025.03.13.10.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:03:35 -0700 (PDT) Date: Thu, 13 Mar 2025 18:03:32 +0100 From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 2/8] sched/topology: Wrappers for sched_domains_mutex Message-ID: References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Create wrappers for sched_domains_mutex so that it can transparently be used on both CONFIG_SMP and !CONFIG_SMP, as some function will need to do. Reported-by: Jon Hunter Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow earlier for = hotplug") Tested-by: Waiman Long Tested-by: Jon Hunter Reviewed-by: Valentin Schneider Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- include/linux/sched.h | 5 +++++ kernel/cgroup/cpuset.c | 4 ++-- kernel/sched/core.c | 4 ++-- kernel/sched/debug.c | 8 ++++---- kernel/sched/topology.c | 12 ++++++++++-- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 9c15365a30c0..4659898c0299 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -382,6 +382,11 @@ enum uclamp_id { #ifdef CONFIG_SMP extern struct root_domain def_root_domain; extern struct mutex sched_domains_mutex; +extern void sched_domains_mutex_lock(void); +extern void sched_domains_mutex_unlock(void); +#else +static inline void sched_domains_mutex_lock(void) { } +static inline void sched_domains_mutex_unlock(void) { } #endif =20 struct sched_param { diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 0f910c828973..f87526edb2a4 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -994,10 +994,10 @@ static void partition_and_rebuild_sched_domains(int ndoms_new, cpumask_var_t doms_new[= ], struct sched_domain_attr *dattr_new) { - mutex_lock(&sched_domains_mutex); + sched_domains_mutex_lock(); partition_sched_domains_locked(ndoms_new, doms_new, dattr_new); dl_rebuild_rd_accounting(); - mutex_unlock(&sched_domains_mutex); + sched_domains_mutex_unlock(); } =20 /* diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 67189907214d..58593f4d09a1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8424,9 +8424,9 @@ void __init sched_init_smp(void) * CPU masks are stable and all blatant races in the below code cannot * happen. */ - mutex_lock(&sched_domains_mutex); + sched_domains_mutex_lock(); sched_init_domains(cpu_active_mask); - mutex_unlock(&sched_domains_mutex); + sched_domains_mutex_unlock(); =20 /* Move init over to a non-isolated CPU */ if (set_cpus_allowed_ptr(current, housekeeping_cpumask(HK_TYPE_DOMAIN)) <= 0) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index ef047add7f9e..a0893a483d35 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -292,7 +292,7 @@ static ssize_t sched_verbose_write(struct file *filp, c= onst char __user *ubuf, bool orig; =20 cpus_read_lock(); - mutex_lock(&sched_domains_mutex); + sched_domains_mutex_lock(); =20 orig =3D sched_debug_verbose; result =3D debugfs_write_file_bool(filp, ubuf, cnt, ppos); @@ -304,7 +304,7 @@ static ssize_t sched_verbose_write(struct file *filp, c= onst char __user *ubuf, sd_dentry =3D NULL; } =20 - mutex_unlock(&sched_domains_mutex); + sched_domains_mutex_unlock(); cpus_read_unlock(); =20 return result; @@ -515,9 +515,9 @@ static __init int sched_init_debug(void) debugfs_create_u32("migration_cost_ns", 0644, debugfs_sched, &sysctl_sche= d_migration_cost); debugfs_create_u32("nr_migrate", 0644, debugfs_sched, &sysctl_sched_nr_mi= grate); =20 - mutex_lock(&sched_domains_mutex); + sched_domains_mutex_lock(); update_sched_domain_debugfs(); - mutex_unlock(&sched_domains_mutex); + sched_domains_mutex_unlock(); #endif =20 #ifdef CONFIG_NUMA_BALANCING diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index c49aea8c1025..296ff2acfd32 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -6,6 +6,14 @@ #include =20 DEFINE_MUTEX(sched_domains_mutex); +void sched_domains_mutex_lock(void) +{ + mutex_lock(&sched_domains_mutex); +} +void sched_domains_mutex_unlock(void) +{ + mutex_unlock(&sched_domains_mutex); +} =20 /* Protected by sched_domains_mutex: */ static cpumask_var_t sched_domains_tmpmask; @@ -2791,7 +2799,7 @@ void partition_sched_domains_locked(int ndoms_new, cp= umask_var_t doms_new[], void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], struct sched_domain_attr *dattr_new) { - mutex_lock(&sched_domains_mutex); + sched_domains_mutex_lock(); partition_sched_domains_locked(ndoms_new, doms_new, dattr_new); - mutex_unlock(&sched_domains_mutex); + sched_domains_mutex_unlock(); } --=20 2.48.1 From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 B90D315747D for ; Thu, 13 Mar 2025 17:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885557; cv=none; b=gL0+lYwtgVIN5zxZDbMKGpv6BXW7ds+m3yECkTVR3LaWFiW55ptWxs6345V37vY4dM+jaUl2fPLHtgBjmgWl7FVRIFZ0gxJBf+w1hbX3KPf1C1EODtT5PfwTfzq9LnvmTGfy9nR0I1pzq5pW34+3Ka14WM1ka7SLfuZVdxQ7qQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885557; c=relaxed/simple; bh=KQiXIn2VlukWSexqG6FOkdHHd1iYI73n5V5ly7rktl0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VRiRgy5Gu99pzypyKNQ1qjLEugOpgx9lmfKCxZyb633SNbVV0dq78sEuI3Wu9rMsjn51bXlhfEzvPO8J4VDbs3IbclZcV/ArI5D7/DQp0wxkC/UtzfcQiBInETgT6eEjOati3GOyjh5UeKLE56dGVMZQbH7/N6vhDrAx4K+NqEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Q0fuwfQH; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q0fuwfQH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741885554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lRaM/X3X7FwnRVTV/8ABm5Bv6FFz4nCJnFljDa4QIJg=; b=Q0fuwfQHAY/SBhjVmQUqIZ7jqfX4vMcxlEf2DDgoZKnq4ADgqV1YwMmnRBnHGTWiTLnSgR RorT+7rCLsOSaa1lu6ijI6qpvImKuhuzyXF5MqwjtMc4V+RcGiTMtxPAsa6lNP2ZkEy+Fu Qd5/vOSG3/xDS54gUc2vfx+HIDGH88g= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-R7cq-YC4PnabO9YB5MZFmA-1; Thu, 13 Mar 2025 13:05:53 -0400 X-MC-Unique: R7cq-YC4PnabO9YB5MZFmA-1 X-Mimecast-MFC-AGG-ID: R7cq-YC4PnabO9YB5MZFmA_1741885552 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-43bd0586b86so8827965e9.3 for ; Thu, 13 Mar 2025 10:05:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741885551; x=1742490351; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lRaM/X3X7FwnRVTV/8ABm5Bv6FFz4nCJnFljDa4QIJg=; b=MpGjU5zefI9BLkJs9g0V/dApQX4RiT5AecbFt4s/tDJDqttY/nFluJdyKNOeXeWcRS c0LFgyhipnONYb3+tu/Tz/CGLowc54F4Rs6csT8GOEz3556Qedt1nWMn1lXGybF8Z8Ro Vu2nFyHKotYC4ZYAuAImGTvfl1jQZxB/HTbzdG0PEiTm68IGOtq/YD+wnPSTse+GHKkH 4jLhSjwdGZYEP+wGp6nfkDN3aJjxzmySo2SX2xp50f6rvTeTufjAXKHSJKPDQrUeIgkp ns2KHTmXWItpEOJhkNbL90R/7ONk4cTxhAOENAZ25Cf9Qnk7ZtqCOhpPDc/4Yhp9fAqm Xakg== X-Gm-Message-State: AOJu0Yz7L6QXLZlsN00hKoGB68cyfhiX6KsiDIHFPXbMFYr4KjND+Fxu OEqPEh03tbRj7NZM/fzvwkpqOvsz0E0bkft4/Uu8tewzGFgbhIQhePlDaAsOeJJTZ6WaGyXzAyo NGaLsYJBDpbcz8q526rXrIe6W7mpBlwWgBtnfOa3qQLrrjFDRAlLFSulJBqqjFS5sIZ06rfNVBD j7Xcg687G7mw+AosK4d3bE6OXDZDsqf1HEvCaNUcfp/9ZgV6rB X-Gm-Gg: ASbGnctDhpgXyIhaQlXbCzAQ9Gt+XS7VPGFpvj1Xgv2AI+f6NPniRiL8NifBnPa25c2 VGHC5R3Op6LToF5zDD/KvPZw3UTYUpNndiCBRDZfkS3rJm2B6hmXUCle9ECKOuo9mQDO/7juoC/ MhzXUOh26K6R3nP0CErvieq6F97KIV40rjSuzr9J56qTFJKDLIn0mRTNhWWD8/Gupn5xWukwsvQ 22xFHYkf4RCgen4VaWxuxPD1ZBGgb33i2e3yQjhxNemk4YpTBksYf0Fc77oVDUi5WJ8klLniF7z ad5yPdc0sZ42eJ52tmv3luOSiPjUTW6PEUhs6wLBMLU= X-Received: by 2002:a05:600c:4690:b0:43c:f1cd:3d78 with SMTP id 5b1f17b1804b1-43d1d8996e4mr4685655e9.12.1741885551233; Thu, 13 Mar 2025 10:05:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFqSLsuGYqiWNcWGFhLHtrkt0oSv3EpUnzUFYIX8R0rzU3ce//LTSI6J0Klt+PSgxhr6Qokw== X-Received: by 2002:a05:600c:4690:b0:43c:f1cd:3d78 with SMTP id 5b1f17b1804b1-43d1d8996e4mr4684875e9.12.1741885550619; Thu, 13 Mar 2025 10:05:50 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395c83b6e87sm2849628f8f.32.2025.03.13.10.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:05:49 -0700 (PDT) Date: Thu, 13 Mar 2025 18:05:46 +0100 From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 3/8] sched/deadline: Generalize unique visiting of root domains Message-ID: References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Bandwidth checks and updates that work on root domains currently employ a cookie mechanism for efficiency. This mechanism is very much tied to when root domains are first created and initialized. Generalize the cookie mechanism so that it can be used also later at runtime while updating root domains. Also, additionally guard it with sched_domains_mutex, since domains need to be stable while updating them (and it will be required for further dynamic changes). Reported-by: Jon Hunter Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow earlier for = hotplug") Tested-by: Waiman Long Tested-by: Jon Hunter Reviewed-by: Valentin Schneider Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- include/linux/sched/deadline.h | 3 +++ kernel/sched/deadline.c | 23 +++++++++++++---------- kernel/sched/rt.c | 2 ++ kernel/sched/sched.h | 2 +- kernel/sched/topology.c | 2 +- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h index 3a912ab42bb5..6ec578600b24 100644 --- a/include/linux/sched/deadline.h +++ b/include/linux/sched/deadline.h @@ -37,4 +37,7 @@ extern void dl_clear_root_domain(struct root_domain *rd); =20 #endif /* CONFIG_SMP */ =20 +extern u64 dl_cookie; +extern bool dl_bw_visited(int cpu, u64 cookie); + #endif /* _LINUX_SCHED_DEADLINE_H */ diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 1a041c1fc0d1..3e05032e9e0e 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -166,14 +166,14 @@ static inline unsigned long dl_bw_capacity(int i) } } =20 -static inline bool dl_bw_visited(int cpu, u64 gen) +static inline bool dl_bw_visited(int cpu, u64 cookie) { struct root_domain *rd =3D cpu_rq(cpu)->rd; =20 - if (rd->visit_gen =3D=3D gen) + if (rd->visit_cookie =3D=3D cookie) return true; =20 - rd->visit_gen =3D gen; + rd->visit_cookie =3D cookie; return false; } =20 @@ -207,7 +207,7 @@ static inline unsigned long dl_bw_capacity(int i) return SCHED_CAPACITY_SCALE; } =20 -static inline bool dl_bw_visited(int cpu, u64 gen) +static inline bool dl_bw_visited(int cpu, u64 cookie) { return false; } @@ -3171,15 +3171,18 @@ DEFINE_SCHED_CLASS(dl) =3D { #endif }; =20 -/* Used for dl_bw check and update, used under sched_rt_handler()::mutex */ -static u64 dl_generation; +/* + * Used for dl_bw check and update, used under sched_rt_handler()::mutex a= nd + * sched_domains_mutex. + */ +u64 dl_cookie; =20 int sched_dl_global_validate(void) { u64 runtime =3D global_rt_runtime(); u64 period =3D global_rt_period(); u64 new_bw =3D to_ratio(period, runtime); - u64 gen =3D ++dl_generation; + u64 cookie =3D ++dl_cookie; struct dl_bw *dl_b; int cpu, cpus, ret =3D 0; unsigned long flags; @@ -3192,7 +3195,7 @@ int sched_dl_global_validate(void) for_each_online_cpu(cpu) { rcu_read_lock_sched(); =20 - if (dl_bw_visited(cpu, gen)) + if (dl_bw_visited(cpu, cookie)) goto next; =20 dl_b =3D dl_bw_of(cpu); @@ -3229,7 +3232,7 @@ static void init_dl_rq_bw_ratio(struct dl_rq *dl_rq) void sched_dl_do_global(void) { u64 new_bw =3D -1; - u64 gen =3D ++dl_generation; + u64 cookie =3D ++dl_cookie; struct dl_bw *dl_b; int cpu; unsigned long flags; @@ -3240,7 +3243,7 @@ void sched_dl_do_global(void) for_each_possible_cpu(cpu) { rcu_read_lock_sched(); =20 - if (dl_bw_visited(cpu, gen)) { + if (dl_bw_visited(cpu, cookie)) { rcu_read_unlock_sched(); continue; } diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 4b8e33c615b1..8cebe71d2bb1 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2910,6 +2910,7 @@ static int sched_rt_handler(const struct ctl_table *t= able, int write, void *buff int ret; =20 mutex_lock(&mutex); + sched_domains_mutex_lock(); old_period =3D sysctl_sched_rt_period; old_runtime =3D sysctl_sched_rt_runtime; =20 @@ -2936,6 +2937,7 @@ static int sched_rt_handler(const struct ctl_table *t= able, int write, void *buff sysctl_sched_rt_period =3D old_period; sysctl_sched_rt_runtime =3D old_runtime; } + sched_domains_mutex_unlock(); mutex_unlock(&mutex); =20 return ret; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index c8512a9fb022..c978abe38c07 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -998,7 +998,7 @@ struct root_domain { * Also, some corner cases, like 'wrap around' is dangerous, but given * that u64 is 'big enough'. So that shouldn't be a concern. */ - u64 visit_gen; + u64 visit_cookie; =20 #ifdef HAVE_RT_PUSH_IPI /* diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 296ff2acfd32..44093339761c 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -568,7 +568,7 @@ static int init_rootdomain(struct root_domain *rd) rd->rto_push_work =3D IRQ_WORK_INIT_HARD(rto_push_irq_work_func); #endif =20 - rd->visit_gen =3D 0; + rd->visit_cookie =3D 0; init_dl_bw(&rd->dl_bw); if (cpudl_init(&rd->cpudl) !=3D 0) goto free_rto_mask; --=20 2.48.1 From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 183CC13AA2F for ; Thu, 13 Mar 2025 17:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885831; cv=none; b=mVYqp63mNX3x2n/9dWd9fHQn6buQcogooFE/J2cazcSlGdQ0Fc8BaLpSXIVjwq8+MoQ7qsmn7bAyRhCqXa7Z9ODzDg7vyrW+Z+nbW/BuQgyHYC56rCeCrYDguil2rLu+cP9ppwS9/12dM8KaIlgmFmSi+x/1Z5ikR6pJRUzqA+k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885831; c=relaxed/simple; bh=nR1ob2cQONENW8eUXzLTE8w0E2+3XPvDjEWYcWYXJ6M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GT8LXojRreLHcBzliywrAwuZrTpR0DHMhK/aTZSZWFgIlcYu/mTdy9pbt93uKD/FYkqwIWkImj0bAb5P1qDqa0mt/kb9HlFaMbtvz/QvRyw8j1PA2T0GYPEjDyNhVViobQATczGivF+US5PxFR5FSKgf5K9aJAZzZ+H3tV3u5kA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XYGhcjnY; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XYGhcjnY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741885828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=13IrME9qVH+0+hXjGK6BJyrl1EowiQUElDsQf/trHmI=; b=XYGhcjnYAfj60ayuKX7zQjBrvdp9HcNry2sYd8r+FrWI48v/TxqzVm+M2cMnnhRoDuwNLo YDnOtPV3l5LggC5WXaxMPVuIgGCLpGR+rMOb10EwHZazXZX96PXiOuXQPoO+EjkkmX5/+d q0ruzZkOsypAmYbmK25gQ8NnFVQknh0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-yta8zfQ9P-OtK4fPYtbBpA-1; Thu, 13 Mar 2025 13:10:27 -0400 X-MC-Unique: yta8zfQ9P-OtK4fPYtbBpA-1 X-Mimecast-MFC-AGG-ID: yta8zfQ9P-OtK4fPYtbBpA_1741885826 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3913aea90b4so535248f8f.2 for ; Thu, 13 Mar 2025 10:10:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741885825; x=1742490625; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=13IrME9qVH+0+hXjGK6BJyrl1EowiQUElDsQf/trHmI=; b=uHOv9dKvmlpy8FHCB2UbzBrM7DPQU2Q34f/MnW7h272prA4CvKylthgJFqEfy4aDhv /fJUhkOAVvwArRBZtBGTssKlcNy3xy6AsPmkrI4HMoLtbz8GEimPw9jn6iSzF3ze4jHF VLiL8JKZ151tVCGYSvblEAwDaYmnTdXiXW9Kapt5pRxl/br1XRRkxu0GxCipS40z0Xfl mId0CnMmAdex81QRRXC8xqrTZkqmL9gFSzAsn/dn7h0JH3a/y2nqBYTVzg/sYLtdnArT xkK+y6rzv2jZgvSvP/RJxAGnwvNc84n+78KEumvr5aC6mqX1wi+f4HhhRophB7ssJq5e dgCg== X-Gm-Message-State: AOJu0YyjFAqGjKyLUOP6xbSeky2vtwECkcmvmzu0uRdFCPbE1ptY3jRw sSD7+HPP/hR8EHFoRPFlZGR6wOMgaKykOJFSIuwr9UZCfIsfbyuWS33mSEdjgQah+X5PJBYnOoT 51AIsHlTWfQo1NyOb2DZWhYOJbYzP7UcU31Ag03VRS2rCEYrD/sLA04hXLBp8iNhVdhGBPEQM/V KH4M+ZN6kb/rmykkmfE6yGkKD1a5GiMHXn76w/AhnhPRtglC6/ X-Gm-Gg: ASbGnct/9s0m01g+9E7HKe6tFMZIc2wqe3DTyxf7hI742T3KcOk+J3ITYG37jDtFKmT pG+W5b2MbUeMq17JgJ/12F5synN8ZA+szKhSAYXlClYkpAI0quZSdlL10WxCghUTUb1OxyzNgaA oK16vvLSP5hF13Pgs+Nwg1uDm2Kj2WODtIiC3yP5ZkWBgtlTvDagKjSwNFiRkGw8nxN3teG/pFf Op64AAEnjPgp8bEiMjjwKryTncOAhhDff+X7Rkk+YGH4IEN3xd9mopEN7OmmL2edhhsdnde3UC9 jgPfZXtFvTbgg5DmRpZe6p4Bc9NClG+4rzaYDY53ujs= X-Received: by 2002:a5d:598f:0:b0:391:2e97:577a with SMTP id ffacd0b85a97d-396c3e16586mr352404f8f.55.1741885824808; Thu, 13 Mar 2025 10:10:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+lg8zlUlXluRXE6AcisRhjeRo0PjZSFqibrRBKyIRUbuHm3FBSBZu6OcQAhW2z6WDs92D3g== X-Received: by 2002:a5d:598f:0:b0:391:2e97:577a with SMTP id ffacd0b85a97d-396c3e16586mr352346f8f.55.1741885824314; Thu, 13 Mar 2025 10:10:24 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395cb7eb92csm2752500f8f.91.2025.03.13.10.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:10:23 -0700 (PDT) Date: Thu, 13 Mar 2025 18:10:21 +0100 From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 4/8] sched/deadline: Rebuild root domain accounting after every update Message-ID: References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rebuilding of root domains accounting information (total_bw) is currently broken on some cases, e.g. suspend/resume on aarch64. Problem is that the way we keep track of domain changes and try to add bandwidth back is convoluted and fragile. Fix it by simplify things by making sure bandwidth accounting is cleared and completely restored after root domains changes (after root domains are again stable). To be sure we always call dl_rebuild_rd_accounting while holding cpuset_mutex we also add cpuset_reset_sched_domains() wrapper. Reported-by: Jon Hunter Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow earlier for = hotplug") Co-developed-by: Waiman Long Signed-off-by: Waiman Long Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- v3 -> v4: add cpuset_reset_sched_domains wrapper so that we always call partition_sched_domains holding cpuset_mutex (Waiman) --- include/linux/cpuset.h | 6 ++++++ include/linux/sched/deadline.h | 1 + include/linux/sched/topology.h | 2 ++ kernel/cgroup/cpuset.c | 23 ++++++++++++++++------- kernel/sched/core.c | 4 ++-- kernel/sched/deadline.c | 16 ++++++++++------ kernel/sched/topology.c | 1 + 7 files changed, 38 insertions(+), 15 deletions(-) diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 835e7b793f6a..17cc90d900f9 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -128,6 +128,7 @@ extern bool current_cpuset_is_being_rebound(void); extern void rebuild_sched_domains(void); =20 extern void cpuset_print_current_mems_allowed(void); +extern void cpuset_reset_sched_domains(void); =20 /* * read_mems_allowed_begin is required when making decisions involving @@ -264,6 +265,11 @@ static inline void rebuild_sched_domains(void) partition_sched_domains(1, NULL, NULL); } =20 +static inline void cpuset_reset_sched_domains(void) +{ + partition_sched_domains(1, NULL, NULL); +} + static inline void cpuset_print_current_mems_allowed(void) { } diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h index 6ec578600b24..f9aabbc9d22e 100644 --- a/include/linux/sched/deadline.h +++ b/include/linux/sched/deadline.h @@ -34,6 +34,7 @@ static inline bool dl_time_before(u64 a, u64 b) struct root_domain; extern void dl_add_task_root_domain(struct task_struct *p); extern void dl_clear_root_domain(struct root_domain *rd); +extern void dl_clear_root_domain_cpu(int cpu); =20 #endif /* CONFIG_SMP */ =20 diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 7f3dbafe1817..1622232bd08b 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -166,6 +166,8 @@ static inline struct cpumask *sched_domain_span(struct = sched_domain *sd) return to_cpumask(sd->span); } =20 +extern void dl_rebuild_rd_accounting(void); + extern void partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[], struct sched_domain_attr *dattr_new); diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index f87526edb2a4..1892dc8cd211 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -954,10 +954,12 @@ static void dl_update_tasks_root_domain(struct cpuset= *cs) css_task_iter_end(&it); } =20 -static void dl_rebuild_rd_accounting(void) +void dl_rebuild_rd_accounting(void) { struct cpuset *cs =3D NULL; struct cgroup_subsys_state *pos_css; + int cpu; + u64 cookie =3D ++dl_cookie; =20 lockdep_assert_held(&cpuset_mutex); lockdep_assert_cpus_held(); @@ -965,11 +967,12 @@ static void dl_rebuild_rd_accounting(void) =20 rcu_read_lock(); =20 - /* - * Clear default root domain DL accounting, it will be computed again - * if a task belongs to it. - */ - dl_clear_root_domain(&def_root_domain); + for_each_possible_cpu(cpu) { + if (dl_bw_visited(cpu, cookie)) + continue; + + dl_clear_root_domain_cpu(cpu); + } =20 cpuset_for_each_descendant_pre(cs, pos_css, &top_cpuset) { =20 @@ -996,7 +999,6 @@ partition_and_rebuild_sched_domains(int ndoms_new, cpum= ask_var_t doms_new[], { sched_domains_mutex_lock(); partition_sched_domains_locked(ndoms_new, doms_new, dattr_new); - dl_rebuild_rd_accounting(); sched_domains_mutex_unlock(); } =20 @@ -1083,6 +1085,13 @@ void rebuild_sched_domains(void) cpus_read_unlock(); } =20 +void cpuset_reset_sched_domains(void) +{ + mutex_lock(&cpuset_mutex); + partition_sched_domains(1, NULL, NULL); + mutex_unlock(&cpuset_mutex); +} + /** * cpuset_update_tasks_cpumask - Update the cpumasks of tasks in the cpuse= t. * @cs: the cpuset in which each task's cpus_allowed mask needs to be chan= ged diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 58593f4d09a1..dbf44ddbb6b4 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8183,7 +8183,7 @@ static void cpuset_cpu_active(void) * operation in the resume sequence, just build a single sched * domain, ignoring cpusets. */ - partition_sched_domains(1, NULL, NULL); + cpuset_reset_sched_domains(); if (--num_cpus_frozen) return; /* @@ -8202,7 +8202,7 @@ static void cpuset_cpu_inactive(unsigned int cpu) cpuset_update_active_cpus(); } else { num_cpus_frozen++; - partition_sched_domains(1, NULL, NULL); + cpuset_reset_sched_domains(); } } =20 diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 3e05032e9e0e..5dca336cdd7c 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -166,7 +166,7 @@ static inline unsigned long dl_bw_capacity(int i) } } =20 -static inline bool dl_bw_visited(int cpu, u64 cookie) +bool dl_bw_visited(int cpu, u64 cookie) { struct root_domain *rd =3D cpu_rq(cpu)->rd; =20 @@ -207,7 +207,7 @@ static inline unsigned long dl_bw_capacity(int i) return SCHED_CAPACITY_SCALE; } =20 -static inline bool dl_bw_visited(int cpu, u64 cookie) +bool dl_bw_visited(int cpu, u64 cookie) { return false; } @@ -2981,18 +2981,22 @@ void dl_clear_root_domain(struct root_domain *rd) rd->dl_bw.total_bw =3D 0; =20 /* - * dl_server bandwidth is only restored when CPUs are attached to root - * domains (after domains are created or CPUs moved back to the - * default root doamin). + * dl_servers are not tasks. Since dl_add_task_root_domain ignores + * them, we need to account for them here explicitly. */ for_each_cpu(i, rd->span) { struct sched_dl_entity *dl_se =3D &cpu_rq(i)->fair_server; =20 if (dl_server(dl_se) && cpu_active(i)) - rd->dl_bw.total_bw +=3D dl_se->dl_bw; + __dl_add(&rd->dl_bw, dl_se->dl_bw, dl_bw_cpus(i)); } } =20 +void dl_clear_root_domain_cpu(int cpu) +{ + dl_clear_root_domain(cpu_rq(cpu)->rd); +} + #endif /* CONFIG_SMP */ =20 static void switched_from_dl(struct rq *rq, struct task_struct *p) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 44093339761c..363ad268a25b 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2791,6 +2791,7 @@ void partition_sched_domains_locked(int ndoms_new, cp= umask_var_t doms_new[], ndoms_cur =3D ndoms_new; =20 update_sched_domain_debugfs(); + dl_rebuild_rd_accounting(); } =20 /* --=20 2.48.1 From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 86D96201025 for ; Thu, 13 Mar 2025 17:11:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885890; cv=none; b=JLUaXxtXcC6k1TneWErbVi7kosBIufqzVfxK4pXBXszLqAoG7rupEg5OzPtj1gMVuGYSAjrbKo4Qa4OWOHNEb6cwMsLDFclCMw9KNuSxFbparZkGeRULAC+BQPDJ0TX5ollEOyKQag7/B5Gc/Tc+Iub6ioaFCKpAyYtba0J81c4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885890; c=relaxed/simple; bh=lb+ZbAQnclNwseWR5txyK6ca+JbKI+Yza7gQXBm7aCg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hFmwFZ5s0KQ/3+gXYc/8/jYHlnaiMMP82XzdpVSQa+MXXO/5v+WeZL7gdA7R8PpoMZMYdWJL41vLTlC9J5LkVCLP22krXKeTe+hBqQ3DSvAn9qJd5EJMR4LPVjsVwKuy3MkoqzswvCJ1AD+FGUh9EOTYm8uH8VUcG9jroqWKhFc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=h5+SdwBN; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h5+SdwBN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741885887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=toM7pu0/nKvqJbZZIzL7Jc4TbRaykE4Ah5TJhKkkzP8=; b=h5+SdwBNrYbFoJhfZV/aI6mSFK72LjOhJnn4clOZ/RwXMAnAq82RlPAFxPO5cbGEHDy2e8 ad8A3T9HED/rq/h7SibJ8pxxMIT4hPOcUDZLS0VMvAJkGZ7AD/nu7HQKL7n8SBuAX/YkiV oTxejdCWHycFu32hsHqk+kTaWISpUeU= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-V43gB0QzNDOKLIe-FY6J3w-1; Thu, 13 Mar 2025 13:11:25 -0400 X-MC-Unique: V43gB0QzNDOKLIe-FY6J3w-1 X-Mimecast-MFC-AGG-ID: V43gB0QzNDOKLIe-FY6J3w_1741885884 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-39135d31ca4so650007f8f.1 for ; Thu, 13 Mar 2025 10:11:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741885883; x=1742490683; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=toM7pu0/nKvqJbZZIzL7Jc4TbRaykE4Ah5TJhKkkzP8=; b=qPUVCLDJEm8160q0tRpR1MiZyk6IgyotAS38khFXYeNZJsvXM5TCLzk+udfZD8j/NU Vbgy410MVM5WO1kgXZUPanj7s/Ozu0Vzu5xZzJrvgRLnBeLg8rvizrSzD3tktAuWF3kf JvpdlXoi73cZs5U+QH5k+D8qPfE9N8RBXkajfxoAd5qMdQ/xIkFJ6kj/HfnofgI/XSTf wpj/yupDrNS5xnRDwNq8dVsLUZ7E3bnB/xArh1W63e4YZHMOYYg5PKeAPG6uzgJ7bQXb GMmB+5AFV/9fd0l7UqnYRcMdjD4tXhgR+scRxyqwLqqz18LTstPdjn9uD640v+R2fMIX 3d/A== X-Gm-Message-State: AOJu0YxWoFrkwtwA3RUvJHpn3/OZLxF17kPXzYZd6wm4WKjYFrc4eM7h QbdJ4xw2n+HS48mgw/4YwMH0k7JBXQ7mbdL3RF18zFgCkAsCO84tcGndvRqSvyiJubBk26t+36O 0pgKqGXY3KxI5xIcFgLB301MW/ngII9pLrFCGpN+BP2/oXuM0jCoTfZtmN5XvV4dHCbHM4Nvn7D zaiMep7C/778cgHa5Wgz3AoTbL5Y4fHihnUqNMBCs8xqof7CBc X-Gm-Gg: ASbGncsSiNKA3l4nGwlAzIL3YDnwBEgK0ew4CPAtANes7ywSXyb0NxeTtrMBEy+n/Z3 lbW1LXAUYNZFab5pR+peNEU9wj7pNn1iW3CLe4HfXZ/oPCnzMqwsTr3OfY0gFHC92hp6og7vZrX QS609/Gk0NiTqJsqj6nZnWgElovUkZ9wEi37qtJmQ4ZDyqAKhL7zkdqebjGnjR7murmg9VvJJo3 GD+nvLPr5k2JQ5F7UeegkTJrKErWVzOGfKwVrYtu6hnG+2ZaBixNDj1+ESRM9ljtdPQXnTBK9u/ hW9X0Okqo7xuqlha6nPHiBYnlMT3YOfjxDXuJuroCGM= X-Received: by 2002:a05:6000:4026:b0:391:a74:d7e2 with SMTP id ffacd0b85a97d-395b9b10d93mr3353487f8f.26.1741885882642; Thu, 13 Mar 2025 10:11:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrw1KHuvAQ5Oit6WEwU940Ut+Qi7Yu7A4vk0V+1jznfYA+D03YAhRUY0Z/WYBn49xltnyVOQ== X-Received: by 2002:a05:6000:4026:b0:391:a74:d7e2 with SMTP id ffacd0b85a97d-395b9b10d93mr3353290f8f.26.1741885880667; Thu, 13 Mar 2025 10:11:20 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a75b0f6sm59705935e9.22.2025.03.13.10.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:11:20 -0700 (PDT) Date: Thu, 13 Mar 2025 18:11:17 +0100 From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 5/8] sched/topology: Remove redundant dl_clear_root_domain call Message-ID: References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We completely clean and restore root domains bandwidth accounting after every root domains change, so the dl_clear_root_domain() call in partition_sched_domains_locked() is redundant. Remove it. Reviewed-by: Waiman Long Reviewed-by: Shrikanth Hegde Reviewed-by: Valentin Schneider Tested-by: Waiman Long Tested-by: Jon Hunter Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- kernel/sched/topology.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 363ad268a25b..df2d94a57e84 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2720,21 +2720,8 @@ void partition_sched_domains_locked(int ndoms_new, c= pumask_var_t doms_new[], for (i =3D 0; i < ndoms_cur; i++) { for (j =3D 0; j < n && !new_topology; j++) { if (cpumask_equal(doms_cur[i], doms_new[j]) && - dattrs_equal(dattr_cur, i, dattr_new, j)) { - struct root_domain *rd; - - /* - * This domain won't be destroyed and as such - * its dl_bw->total_bw needs to be cleared. - * Tasks contribution will be then recomputed - * in function dl_update_tasks_root_domain(), - * dl_servers contribution in function - * dl_restore_server_root_domain(). - */ - rd =3D cpu_rq(cpumask_any(doms_cur[i]))->rd; - dl_clear_root_domain(rd); + dattrs_equal(dattr_cur, i, dattr_new, j)) goto match1; - } } /* No match - a current sched domain not in new doms_new[] */ detach_destroy_domains(doms_cur[i]); --=20 2.48.1 From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 DA7A3269CF8 for ; Thu, 13 Mar 2025 17:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885932; cv=none; b=Ixcey3+/virrJYlqASUlIBOa098S42SGZpm/1+38lZvzOyejL6dCnsMaDjA3Tw2lkuOZafbTdslLXbtHlNMda5OJ6a4IlsaT4m01kzXK2fsv26VnnMUAZXuDqLie0mdZgXCQLXvQ5LHb/Ux2aXHQhyWV6POQDfZLCTBjljL1lG4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885932; c=relaxed/simple; bh=+eE9WT0Gb1oQ7l+5iK4YZ/BXWxyzhii5ao/7GfKePmg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MdVedb8ixKYIc8B1DGueoRXw+dEX6coil0oTmP8LyxcyaVJiMsoNTfLb6h33L5dmYxgqeEz2hTUd6aeaGHzyai8BucfezgfrdTdwgUL4Trk2ZnbiFS7mFKuKyGFSLD7hrM+eQtQ0nWVWoJLo2byRF4tT4Y+2rp3KdqFcBal25TM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QaNbA1+N; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QaNbA1+N" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741885929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nGrmHbgAII+9uPhNMvyhCYNvKc1gV86tMiTemisyc0o=; b=QaNbA1+NAuA+wbzmhT1/6VZk0H5w7q3NvC+LpXSXrkjy7/HvRy5YID5COUNSPH6CgCUfcI I8tlw72eu7L5Hluw9dcuyLJ5SggF0Pwl4dzf+nzEa6bvJa/56ph7sF3e2mEXex+tt3CCYy bM+NNj3zxxzWkHJ6dHQCwzFlnO6XLqg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-n5uJ0epTM6mc8sBHsyJ2oA-1; Thu, 13 Mar 2025 13:12:08 -0400 X-MC-Unique: n5uJ0epTM6mc8sBHsyJ2oA-1 X-Mimecast-MFC-AGG-ID: n5uJ0epTM6mc8sBHsyJ2oA_1741885927 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-43cfda30a3cso6477885e9.3 for ; Thu, 13 Mar 2025 10:12:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741885925; x=1742490725; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nGrmHbgAII+9uPhNMvyhCYNvKc1gV86tMiTemisyc0o=; b=sc07QJl0gNDQgGUyVHnRbYfVVND251sGg65wW7hbdMhhOkTwzQrsslkcW27cITeNT+ gVBVhOfUDJFy9k+04Iad9QeA2KZfbHb3d7CFXSYt+xiod3rgDKVcBW7UjZGQzQMLALlr JeASA1xXplRAy2pzM4ibEQkRTTbB06S/+ZUWKNPweZnlWK9OfKOTUXcm/fOfzStcO4a7 qpWfFL93lIBG7T6qEQJzNyYQ88pJni5MPPJPGq8M77lWQ/E4UfShcJO/MDSqlyFsZQ/D r/t+8LQOtj651LkSS/DrkATiQeyNzJ3gu6RdS7PHWLOjTMs9Gg31TZ26Qi3weOVwo+9m HZ+Q== X-Gm-Message-State: AOJu0Yxj2PMShFEj3vg8wX95DdKX/o+lZuo/2UuPATj/GKC9yLUz43T/ nIsJQbynY8aRtaIEY/rl7zXWh8BvP/lqgDqro5ZNAyQi4pd09eMk+1Iq5NoUDAO6zo0JjN5CVK3 nPP2EPGrfSAm+/GX57dW0p/kXjY66nLifzxpvCjzFRvZ1DvxhoHPdEWelB0Nt7thIR75p1ns8bE qjvQVd4Nv6lL6gA83vPOCWoxoWoF7kAPfRZFzMmLFz1iK64fzX X-Gm-Gg: ASbGnct9/KVx63tt5l5+a+J5izQnPPw3+CvcVPZFMbRJ69UDNy/HsOkeln1e5kYJU4L ijlKnKeIv2YJa4fosNis7wt4x0XHxEpEIxr15CywKJhrVnm/aZlOxRZzO4Weca68hgVQsd1xT3t CFjKfjZrUYeiZNpWm44qtyEPtPFrR2OvOzrnb9eIGOZ61YAeWxYnDxlFxbvA9N5shDgCCoWJAM2 pj1WqIgEs/mJzuY/LCMvd4PXEEp3JEeXCkz3tGBXvSDb7WeCLyEXSrwCDN1aiTtnTY4gZyyVSME +Eve2GXYxQ/Cg0cYoRVx85eW7qqcYiREdV6+0jmzU1k= X-Received: by 2002:a05:600c:3b1a:b0:43c:eea9:f45d with SMTP id 5b1f17b1804b1-43d1d8c6d50mr4689145e9.18.1741885925455; Thu, 13 Mar 2025 10:12:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyjRHKruacR3ykIkv2Ici+Gurb8exc5FYumQgohkNFhqNL6UYwE5HWX2mxAmRslvWd1m7+Tg== X-Received: by 2002:a05:600c:3b1a:b0:43c:eea9:f45d with SMTP id 5b1f17b1804b1-43d1d8c6d50mr4688815e9.18.1741885925020; Thu, 13 Mar 2025 10:12:05 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8c5d04sm62439625e9.27.2025.03.13.10.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:12:04 -0700 (PDT) Date: Thu, 13 Mar 2025 18:12:02 +0100 From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 6/8] cgroup/cpuset: Remove partition_and_rebuild_sched_domains Message-ID: References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" partition_and_rebuild_sched_domains() and partition_sched_domains() are now equivalent. Remove the former as a nice clean up. Suggested-by: Waiman Long Reviewed-by: Waiman Long Reviewed-by: Shrikanth Hegde Reviewed-by: Valentin Schneider Tested-by: Waiman Long Tested-by: Jon Hunter Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- kernel/cgroup/cpuset.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 1892dc8cd211..a51099e5d587 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -993,15 +993,6 @@ void dl_rebuild_rd_accounting(void) rcu_read_unlock(); } =20 -static void -partition_and_rebuild_sched_domains(int ndoms_new, cpumask_var_t doms_new[= ], - struct sched_domain_attr *dattr_new) -{ - sched_domains_mutex_lock(); - partition_sched_domains_locked(ndoms_new, doms_new, dattr_new); - sched_domains_mutex_unlock(); -} - /* * Rebuild scheduler domains. * @@ -1063,7 +1054,7 @@ void rebuild_sched_domains_locked(void) ndoms =3D generate_sched_domains(&doms, &attr); =20 /* Have scheduler rebuild the domains */ - partition_and_rebuild_sched_domains(ndoms, doms, attr); + partition_sched_domains(ndoms, doms, attr); } #else /* !CONFIG_SMP */ void rebuild_sched_domains_locked(void) --=20 2.48.1 From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 B814F63B9 for ; Thu, 13 Mar 2025 17:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885973; cv=none; b=KYWvBNGyZFD/n+cYlu8eIS6r4BRaqIlqPRm2e6V5XCTsYaKRxfZ38yq8cx1DbgMrGgeGul1ttI+TaUI1/U+1ey75spBny5eJuDMUdZ0xzMf3pzmB59tnXTTGMNKFeS1wSLwVF2slvuZcl8VZo7DFO2RyilKa8CNnBziInOnw92Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741885973; c=relaxed/simple; bh=aCNjCxT53589ZRllE+PYiqIoKKavHpFP+HFKZebl/To=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pX6lOWVMuRIB9v5VbLmfgGizPXK9lZNivNs/ip4kzRC8SVvyM9ZhwoBuXA61/BrbdgQs25lBYUGUYNL25SnDfsojLKOLV+LQa+5SC1ZtexjG7VvjxCydQ52sWHXDv1pnpRQu/S0mWQkAoNyWxL4SmW7gDQHMd4KX+gHUhM74tRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=L5u1L9uI; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L5u1L9uI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741885970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yTDVC0g+v7pz/pmpIDTMJxbXsOJE3z6M/wBloVGLsT8=; b=L5u1L9uIALTOJMVX/ASEt0oD+hd+2ecKeb3+HF4fhZon3ZnNRQjnTH/colMPxcxhsv05Iz 5nSOfvhCQijhiY+vsfc4QdlqNVjqonlesOOqtkRwh7itZZWD7HhV84z5HaDzNMDrvYVOK7 LqVsK9/9uDa05NnQoZH4SNBEHFyFIZY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302-mMi6yAO4Mm-lDqyDKu1AVQ-1; Thu, 13 Mar 2025 13:12:49 -0400 X-MC-Unique: mMi6yAO4Mm-lDqyDKu1AVQ-1 X-Mimecast-MFC-AGG-ID: mMi6yAO4Mm-lDqyDKu1AVQ_1741885968 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4388eee7073so10756575e9.0 for ; Thu, 13 Mar 2025 10:12:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741885966; x=1742490766; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yTDVC0g+v7pz/pmpIDTMJxbXsOJE3z6M/wBloVGLsT8=; b=KUsVNqg905V5430wo4MJi8JteVTypsH1Zwf3TtaRqLa/GrHBKlNm6dr8yzGqp7WY9G akC4FDuxerkOCa25GhWzh+IUfZbMiuMwzuFq5SsDSWnMDqgeAdlEcG1DQc/NKJXXKeI6 AL2WOWUf59opu/dxBS1jSpRJSKEuX0sFjtQNC+dC7TH/vDxHpOv7EzurSiQcbDDkozK9 vSoj456nYc4Ia8Am6N5JRHj9LGjJrP2Ucgc2aqoHTV38uC0X+bF7B4ggW+2vieB00+Mr RQVEglGojkBpZwjKreniDq3jITqdwgb5TSqHKxbq567WAQAQ8my2w63zsrFkrA0A4Dvv VXHw== X-Gm-Message-State: AOJu0YyiANrFUuROkaCbNAzl9caSHGbsSFbZ/PxXO5XBGC2CSttBJsSd o9+0DFTOOCyib8mrCJcUz3a0ixQ59+VbKYYMV0cr0NhX4zUqTbHYvxg27r+BMatXlVRpA+5gzO+ X5czvz9zknHCrhf+XB2YkGbfqfd46KTTf0Q749DbaEC1npGl8jIfSRZ+xes+VYIhG51nuIaYqQr YJimcQvZJj0MnxvwOALtYnToXKI9KQWwIsppjhKAblrwM1C3nL X-Gm-Gg: ASbGncvWGJ6fXSTAqMOLHooU042FQPzLeJnQ8akbBW2lB2JIfLU0hwBxLrwUC37FzzG 1+AD4N+LJPnsV6Hdi2zZQpqXgUndyUxjgaMmGSG9YX5KR6WCrT8V7HYXQCXpqbUdKsB1BawiJg/ yZ4dU4pXFlS/qr1o2RZwnjw2Ee3Oq9LWimFHA7gNA/E5u6z7ScUGzize7YjCdxSgVwqFf8rPUeS YxzlDeZkxXdkrIlxHhrUnYGqXtzAbSewH74tzYf8bs4VnVtl+4Nrv+UlyuFnUodzTR3xBf5kvhe vrdqwwTzXX4/vlaSnsqzqMA+hOpW9ecren7MgJF1MNs= X-Received: by 2002:a05:600c:17d1:b0:43c:ed33:a500 with SMTP id 5b1f17b1804b1-43d180acf99mr26397395e9.10.1741885966656; Thu, 13 Mar 2025 10:12:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELRcMkCppH2SBJWCkSJarh6UnGy8xwMw2xvh+1UjQuiyGcl7kDXCMMZUpRXeCFwUhi56T58Q== X-Received: by 2002:a05:600c:17d1:b0:43c:ed33:a500 with SMTP id 5b1f17b1804b1-43d180acf99mr26397005e9.10.1741885966203; Thu, 13 Mar 2025 10:12:46 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395cb7eb8c2sm2647185f8f.85.2025.03.13.10.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:12:45 -0700 (PDT) Date: Thu, 13 Mar 2025 18:12:43 +0100 From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 7/8] sched/topology: Stop exposing partition_sched_domains_locked Message-ID: References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The are no callers of partition_sched_domains_locked() outside topology.c. Stop exposing such function. Suggested-by: Waiman Long Reviewed-by: Valentin Schneider Tested-by: Waiman Long Tested-by: Jon Hunter Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- include/linux/sched/topology.h | 10 ---------- kernel/sched/topology.c | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 1622232bd08b..96e69bfc3c8a 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -168,10 +168,6 @@ static inline struct cpumask *sched_domain_span(struct= sched_domain *sd) =20 extern void dl_rebuild_rd_accounting(void); =20 -extern void partition_sched_domains_locked(int ndoms_new, - cpumask_var_t doms_new[], - struct sched_domain_attr *dattr_new); - extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[= ], struct sched_domain_attr *dattr_new); =20 @@ -212,12 +208,6 @@ extern void __init set_sched_topology(struct sched_dom= ain_topology_level *tl); =20 struct sched_domain_attr; =20 -static inline void -partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[], - struct sched_domain_attr *dattr_new) -{ -} - static inline void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], struct sched_domain_attr *dattr_new) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index df2d94a57e84..95bde793651c 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2688,7 +2688,7 @@ static int dattrs_equal(struct sched_domain_attr *cur= , int idx_cur, * * Call with hotplug lock and sched_domains_mutex held */ -void partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[= ], +static void partition_sched_domains_locked(int ndoms_new, cpumask_var_t do= ms_new[], struct sched_domain_attr *dattr_new) { bool __maybe_unused has_eas =3D false; --=20 2.48.1 From nobody Wed Dec 17 23:25:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 72B3E26A0B9 for ; Thu, 13 Mar 2025 17:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741886018; cv=none; b=l6wTuNy+In/raowaD6EQIWTYVlqBIqT5llfKAhyjz/NULNkRCCX7f5ud7J3Byid/CvaLWDKQOBoHb4qLhW9d3RdiOS28Zj/HMK1bbUHn7bBiWZMjw3It/Gtp6BZWarRZz5ojtq3JXmrG9jkcMrgUYRPi8tJlsZxZF1yqV4Tezl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741886018; c=relaxed/simple; bh=WqHYUTx+eFUkw2RW2AHRWFLhORx7kUJq9HKMYWBIj8E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d/Ff+ynD/+PAScLZFOSGfLYUCUbc8W6WKRrRQLz21zJx5HtuUFSJlHpwa+ydkVyONyaDrs5xWFe51oZB59lR+Okx/8kEaZKQu49ZufPeoNMG2gB7ROlEjsP0E7ChNwAZPyJL2qCLTXcvk8QkPee8aRZd7t0ZOdYwHFQLYNBt5KU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=fDmC00yv; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fDmC00yv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741886015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bupEj0syAwoPVUhQa42XfJiVX6UxcC7+LozYYJO5dvc=; b=fDmC00yvJpzWfH2b7kWRpwd/4Ml0RTjEEPjfqaTLhAPhsqj5ileVqxCBAPZCtu+X52Bk1T 3/kaAe71yF+kFFcOVViobWaG8bzTGKj92v1+rURe92PXZ1O+1uyrNnZy1n3DwgjakOI6pf IXVzQ0f0ZHV9tDaCpX+7dK2ovoRjndw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-ozECKWT3PkK2LVhoUlp2fg-1; Thu, 13 Mar 2025 13:13:34 -0400 X-MC-Unique: ozECKWT3PkK2LVhoUlp2fg-1 X-Mimecast-MFC-AGG-ID: ozECKWT3PkK2LVhoUlp2fg_1741886013 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-39135d31ca4so650765f8f.1 for ; Thu, 13 Mar 2025 10:13:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741886012; x=1742490812; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bupEj0syAwoPVUhQa42XfJiVX6UxcC7+LozYYJO5dvc=; b=X2vZT3K5nS9zd0b/lFdj+9Z/LmnTtm/h15ZftVBriY1+nHX3n2MTvu8oaXpHzGkb24 kF8+qiC4i83W/QO6LSsbteb5n2WaGSrfXZxiEyFzUZFOCiRbETFGOOJJQPSVFh6Cf2vR cLyCVjG8KhlC0QzVVOnyx5ansXX+AjtrXRWKctTR0J7Mdk4kbb3aqZBS7a0r8iXTFmOK 2C2L54YhpK3x3JyrTmuqI2CEnuFJiszomBmn/LpFBGLjgtHh2YfDjzQtIoS+6oGmbLDz P1kzGSX1Nmqrx0UJtmHagyBz2s5LCdPr2JIpOTGblIdJr+duYPzAKoyaJK/gY5CQdVXn gFfw== X-Gm-Message-State: AOJu0YwlYo/URGXiNmK8zSuYjVf8lZtEVyUr1RXxzQP9DQSY8NRN6wfN bBEwyyFmVv6o4sSzB9fUDFT2UWotA1TuaZERdXHrRRprh/dKRWzIjAfqJH1pgy40ABRx5os1hlE pZx2UB+JhtCcNkMOLBd6o2RucqfENUQAgFGzMCbgIsIfg8Iod1HuK8JAeYSQlfDpBK0XbduWYrv 1mABoU63xN5eoN7GGGiuxGhtMzU8/G7RlJvf41YVsZI9A9lNL9 X-Gm-Gg: ASbGncsKod0hOLP0/Cl1N2nbweYPbZbc11yWXySD5sYN7vZElSgY9baI2q5Tdr4gGB0 BC8HNkPsnSvQ65FxF9aCCHNDD228HiWP4c4eR7t30S67ETL3hBah1AF51tRhXdKSEvioozBRKnJ lTj1zL6CYScmNQRWdvQ2LJRguhvnSiWT+xLW1uSHwNDh5X7Uk6NTCRff6HpAvK1CFHHFyQOm1AO SsRu1NR9QjPbdr9RP3ODvKsv5ccN7CjVPy14U9SGOEXe9f3PBRIGd6JFEeoejLzUAmL99pOHbOm tB7AZIHTfafhe91sr7yX0FwXPxHcR1chNYtlq0DFz0g= X-Received: by 2002:a05:6000:2c1:b0:390:f0ff:2c10 with SMTP id ffacd0b85a97d-395b954eb19mr3355841f8f.19.1741886011980; Thu, 13 Mar 2025 10:13:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEEnc4cttulcmus+Fv0WW0T5aRNhlzgKWFpdFHOzzTN1NDvd2Ek9XGkn5vqNfWrw9ReDOVzw== X-Received: by 2002:a05:6000:2c1:b0:390:f0ff:2c10 with SMTP id ffacd0b85a97d-395b954eb19mr3355799f8f.19.1741886011521; Thu, 13 Mar 2025 10:13:31 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.49.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395c83b6b70sm2787906f8f.30.2025.03.13.10.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 10:13:30 -0700 (PDT) Date: Thu, 13 Mar 2025 18:13:29 +0100 From: Juri Lelli To: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Waiman Long , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Qais Yousef , Sebastian Andrzej Siewior , Swapnil Sapkal , Shrikanth Hegde , Phil Auld , luca.abeni@santannapisa.it, tommaso.cucinotta@santannapisa.it, Jon Hunter Subject: [PATCH v4 8/8] include/{topology,cpuset}: Move dl_rebuild_rd_accounting to cpuset.h Message-ID: References: <20250313170011.357208-1-juri.lelli@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250313170011.357208-1-juri.lelli@redhat.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" dl_rebuild_rd_accounting() is defined in cpuset.c, so it makes more sense to move related declarations to cpuset.h. Implement the move. Suggested-by: Waiman Long Reviewed-by: Waiman Long Reviewed-by: Valentin Schneider Tested-by: Waiman Long Tested-by: Jon Hunter Signed-off-by: Juri Lelli Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann --- include/linux/cpuset.h | 5 +++++ include/linux/sched/topology.h | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 17cc90d900f9..5466c96a33db 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -125,6 +125,7 @@ static inline int cpuset_do_page_mem_spread(void) =20 extern bool current_cpuset_is_being_rebound(void); =20 +extern void dl_rebuild_rd_accounting(void); extern void rebuild_sched_domains(void); =20 extern void cpuset_print_current_mems_allowed(void); @@ -260,6 +261,10 @@ static inline bool current_cpuset_is_being_rebound(voi= d) return false; } =20 +static inline void dl_rebuild_rd_accounting(void) +{ +} + static inline void rebuild_sched_domains(void) { partition_sched_domains(1, NULL, NULL); diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 96e69bfc3c8a..51f7b8169515 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -166,8 +166,6 @@ static inline struct cpumask *sched_domain_span(struct = sched_domain *sd) return to_cpumask(sd->span); } =20 -extern void dl_rebuild_rd_accounting(void); - extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[= ], struct sched_domain_attr *dattr_new); =20 --=20 2.48.1