From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 231D93BF679 for ; Mon, 8 Jun 2026 12:16:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780920973; cv=none; b=asYUbjUcCtS6zp2zkYGrCd3HUpqZSOr336n1Df+tpENg6iC0ZX84PVORiAmVPh5DNdkn8ErKsbA8cfanXtmii1iH4wv3T6qHQ2mvWIOLM3hlOq4VB71RNeinqprvfEZMAh+JqLEWAtXD3xnkNMrNK9zrqF0lU/d/hi71QLFdUOk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780920973; c=relaxed/simple; bh=BYQW8jJLIb415FaGZ/DHcSKEWD0PzRzsPjdJ7m5EWpQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W5hPvmqG0A/98/yTTrzwU23Zp8V5vPxm2Io1KcGN0N8o2LzBxAp1Zuij8deYwPKgsyYF+DRYFt4nDx0VfRCBhYuTlcEstVJt9E8U0xE0lg+mgd8fONo3q0rTdV5QbLaJnJhNlT7wfFGfjWpLP4SqfiMpl095+1BXrKYq/jdhUno= 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=UUVa6xcl; arc=none smtp.client-ip=209.85.128.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UUVa6xcl" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so8298255e9.1 for ; Mon, 08 Jun 2026 05:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780920969; x=1781525769; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U/E0eBSATwh3f1Xuk/npu4WDtAq8O6nFLmGZ8AjsGbA=; b=UUVa6xclWQ7dsXoXP8UoWGSuppGoLKxvUdnuWYpHVbTSJVAxFGleARyj5pf8Uc/ADd 6RNAFifRoviOySYhZy3yPf4tL8aoKs0V/r8YPkeS1iS0CtrdRdO1ASz9HOV2fu3Tuja1 feyLRYYgBtg9v76/zKPuQGcy2GhWcCBKtC50Ut+8fdz2bzkWyoqlhEWutwaofOI8VdWg W+go91tf0XhvDP95GyYHfGJAdT8ARAadZWa5M4/j6isicTpiNzH7aL5YhCw9dMyXXoQ4 pdjU/BVMw+Wei+v8ZQjzvYJPZw2XRFkdS6yM6WE3+VH+dvEi2IcAdTLM2LVpEBExM5cz cQKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780920969; x=1781525769; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=U/E0eBSATwh3f1Xuk/npu4WDtAq8O6nFLmGZ8AjsGbA=; b=bAN8c8EF7G3iZvWuRfRa4E+FlOgzmzZA8pfHhMkI+ZVqcqnyPsZhhWwN3poeugeAwi C4Txhz9y8FqdujkTeQfFjO5WGwsZH5iWEtzP8QLjkXESxA5JEMYye1FwfNu7P+eBEZP1 Lb6ex1Mewqj1kKdoEiUIep7av0RGJdv6K5h3QG4xvOzhfp1fA0p8k1TgsPcq8mwMIDCp dQmZIWO6cpyRQmE3yGkbtYVI/6JwZeK6MyBqrH0qCp/f1J3BioenMG/fJdpx0wWLe0rN OH6cEF4VI2Hjb2MyJ+gvdN6veeqX10K13l6YJ9P7yUfEUrx157iElFJebeT2dRJR5te0 U/Iw== X-Forwarded-Encrypted: i=1; AFNElJ8hufhEusvXJb/5tWC4bUK86WYPiwtJBe341PMgBnMqLEJ8WD8SgWW57qkYamfpLlPC1VyoIDx3xQeKpMY=@vger.kernel.org X-Gm-Message-State: AOJu0YwdwkzhRPOiF+RePZYca/CsXPIbgUeM7pgYF9/SMLeBt1Hf3jht gW5/WfSxOHBKfzWNfr9wPeI6v4Jd1z45Q5TvQH7XjLVhDcWXu5NdMk8lIen0s6iL X-Gm-Gg: Acq92OGCuK/L8f4LI7jftZXiAos8U2G4hKmykoyoORSf+353zB8jKUhKPZqYNiejcDl f5rvgioUNlGV7LE2wNpXLJYEN8bKQ5n/PnwdRflb0Ybo1lPeqV6QEHyd2shCtnH/u6OtypF96g6 yiN6g5usVZeXYBVs22hM/1JszH9wmGDOGO9Pp6iWjdUL50ptYryjv0acxHM0OrxBWuI//t51pT9 eYURJ6dwNct9gQUP4d+QMucJ0FQ6NLHxN1vXet3GS10fWlUPGP0k0+zni7hOkcrV0zuRBEU/l5q cpEsGLzREO/uF1FO3omq/3tMcC3Q/P5USZIzp3NgC80jMQr/Z81kDVKJ3ufPqUMboTvty4rJKy4 fSJwR3oE8JOKcO7fmV+guMNG++EJ1LMXq0dwYxFb1R6WTrAy/msOrpqw1lOYK1u5TvGbYyilJ2f pOmh8aKSLUGSiyMig1qsUrkcLCjrXdlaQ= X-Received: by 2002:a05:600c:1f83:b0:490:b724:5085 with SMTP id 5b1f17b1804b1-490c2621a5cmr257900725e9.33.1780920969326; Mon, 08 Jun 2026 05:16:09 -0700 (PDT) Received: from victus-lab ([193.205.81.5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f2ec711sm50644906f8f.12.2026.06.08.05.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 05:16:09 -0700 (PDT) From: Yuri Andriaccio To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Abeni , Yuri Andriaccio Subject: [RFC PATCH v6 23/25] sched/rt: Try pull task on empty server pick. Date: Mon, 8 Jun 2026 14:15:42 +0200 Message-ID: <20260608121546.69910-24-yurand2000@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260608121546.69910-1-yurand2000@gmail.com> References: <20260608121546.69910-1-yurand2000@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Try to pull task on a server with an empty runqueue before returning NULL (and thus shutting down). --- When all the servers of a cgroup are throttled, work is pending, and any one of the servers is replenished, it may happen that the runqueue is empty and thus the replenished server is immediately shut down. The server may try to pull a task so that the cgroup could consume its allocated runtime as soon as it is replenished. Signed-off-by: Yuri Andriaccio --- kernel/sched/rt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 964704d88ba1..f672ef17e5d1 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -285,14 +285,22 @@ int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent) } static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq); +static void pull_rt_task(struct rq *); static struct task_struct *rt_server_pick(struct sched_dl_entity *dl_se, struct rq_flags *rf) { struct rt_rq *rt_rq = &dl_se->my_q->rt; + struct rq *global_rq = global_rq_of_rt_rq(rt_rq); struct task_struct *p; - if (!sched_rt_runnable(dl_se->my_q)) - return NULL; + if (!sched_rt_runnable(dl_se->my_q)) { + rq_unpin_lock(global_rq, rf); + pull_rt_task(rq_of_rt_rq(rt_rq)); + rq_repin_lock(global_rq, rf); + + if (!sched_rt_runnable(dl_se->my_q)) + return NULL; + } p = rt_task_of(pick_next_rt_entity(rt_rq)); -- 2.54.0