From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) (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 D465F36BCC4 for ; Thu, 28 May 2026 22:44:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780008269; cv=none; b=cThFg/Io64MRhWd1+uU7F1T7Nk4wM9dhgNygfdbEQLd1cmBWQt91gIFEXFmpEke2fkF4Hgr5wnUsZ6nsZ0+lZlbmJIupCkHNDJch/7ErzHhuYyalLE03y1Z4K2ELiHwAjRvmjBmKFgRDffEDcx/2OFlt7OUD5G+1+3j2/C9tLMQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780008269; c=relaxed/simple; bh=NrkrLcx7QKgefQYgz3+DHeP1vZBEafKi5W4p3vXqH/E=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=j0Q9hcKctW1n/lIazlUY0Tj9JCGnjomBt+NTHGlaZdiIichIIAb+wnh0hPQJwuue6mHx/djNapN+YnV67iXvCLVuw0xq2UbCcekXSL9bLJYOiRW+PtkQFdxupWPIvGlM9n+OUsLnbD+gbZPrwlIdv9CM5yRJbVTBDF9FOYYDwtQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=HofLjX6M; arc=none smtp.client-ip=74.125.82.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HofLjX6M" Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-304df7ff4c2so539766eec.0 for ; Thu, 28 May 2026 15:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780008267; x=1780613067; darn=vger.kernel.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=QQb6tpWciUA6yxplbFRmH0Eui1ZC1f/Z/4KSBsFqB1I=; b=HofLjX6MMle8G0Bg8nbyP0MibwEzx8WrR/NhsEtxWedjIIg/AqkU/6gp/iA8Fa27hA GLxfB0XQ4yxs3l/1pJAaE/ah81CFSMk9nF3+bgI+ft7FUe0KQiZqpeNuIvaRGnk/YC4u t9pRdQz5LA6fGW8bfhkSmCYJAZmaTFG/Y+Vc08miZKUoKOfVqDz+gojJJJhJouWpSBrM tfnWVtdUH5o+hYtj0FXudXj8B6q1nJ0T6hVS3a7KCcxLCBcrhyOpqW8RL58C8QIX2shk QflgEqyu2auyLyyT3W4eizie7T1zydYLdLlYDhcA1CLArcEOe0gCxLWA/drladcEhnOn tfqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780008267; x=1780613067; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=QQb6tpWciUA6yxplbFRmH0Eui1ZC1f/Z/4KSBsFqB1I=; b=k0QkCvLOiOKzNePH8IVC8VhDLz1FE6LIxGbWs/+tdmB0kCGYetv00oOHg78PMhCrBv BLnvfPiAQMeqWNcVAZ/6aaXcc6MLcthhBNpsUCgU1UdcuLE3VXusECBFBla2giSIWy3E 0m/+VQbOb0soKCfb0tuGzHhEsv151xtb3uHH56HyuB630PRUncvtHggqaumVf6InYNKY ag0WTldQYi+X1FmEhSXij5PelFmHRaNOds0hQVyWkykkZDpYvNt37VlMrBZJQDte1Gtq oowsogGRS8pGC79iqE0ql8VIuJJIoGs+QYZk9WQggLLLd8GWT0P4iIU55t4XiBUWLfbG RmJA== X-Forwarded-Encrypted: i=1; AFNElJ93qdGnQi8hGOBHph9qNtpX+l8QOF4RLSbvIpPXiIzXBRF1kGZVd6YSP+9FKCo1K7/pYyAaARM6Mmlclt0=@vger.kernel.org X-Gm-Message-State: AOJu0YxOj6ZoJe9b/BEZe/inaXnOnbXKa5cnEZIGQFXr9D2buUXutvcI E/8ndDihD0m0irvsliO4NW8+DO53gB2DiXfr5Qn4Ato3/L7e37nVK8EkdJzJH3Kqzf3EOBqd2n7 1o2iqHbPD X-Gm-Gg: Acq92OF8zjRUfiYNuefwONipP3gGMiJd4u1uBg8mfBVc89H6e4XixOBCswsI/T31GWP ZabFMoHjGt6BXQH/Auk2leo+gO1DnX1Ry/mSyJtcQuLd+MQiW13IuBwb5z4EjYGB7wA3w/jrB+v U6Cy8TVysrCmgywKh/BUetIItGWnJ21RoqXwAh09iq3eFnGVX3Kg33VyI8NKxfnu1/6VgrBR2Ph kdGEHbMTJ1if3fUOGSOELpKUmcQlZwIcwvIWR/Ub4iMhimpce6q5st46pI2x1HREjL/dHCK+i6P GSjmsrNWVftGTS8owFoDoVrxAkHLS7tF9CZkLoeMj8hAzsBtzzIsM0xVEIFYoHB3UeB2jY5T2Gr 9QJNpGWex3mo+wfyYzf2EXIIrJYqtRy5+FPRtwGqAmHL8JCuwMT/Gp5dZXtt/xcfRCjlwF1Z+LA lCi6SKOEJ36s9a6EaNJITlKSWFZbRkSkpIIXtyxUQn7g== X-Received: by 2002:a05:7300:ec07:b0:2f3:b7b2:cbd3 with SMTP id 5a478bee46e88-304eb49b28fmr112583eec.5.1780008266198; Thu, 28 May 2026 15:44:26 -0700 (PDT) Received: from bsegall27.localhost ([98.45.141.147]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-304eb9ca228sm190276eec.7.2026.05.28.15.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 15:44:25 -0700 (PDT) From: Benjamin Segall To: K Prateek Nayak Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Valentin Schneider , Aaron Lu , Josh Don , Subject: Re: [PATCH 5/5] sched/fair: Unify cfs_rq throttling via account_cfs_rq_runtime() In-Reply-To: <20260528094830.13291-6-kprateek.nayak@amd.com> (K. Prateek Nayak's message of "Thu, 28 May 2026 09:48:30 +0000") References: <20260528094830.13291-1-kprateek.nayak@amd.com> <20260528094830.13291-6-kprateek.nayak@amd.com> Date: Thu, 28 May 2026 15:44:14 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain K Prateek Nayak writes: > From: Peter Zijlstra > > assign_cfs_rq_runtime() during update_curr() sets the resched indicator > and relies on check_cfs_rq_runtime() during pick_next_task() / > put_prev_entity() to throttle the hierarchy once current task is > preempted / blocks. > > Per-task throttle, on the other hand, uses throttle_cfs_rq() to simply > propagate the throttle signals, and then relies on task work to > individually throttle the runnable tasks on their way out to the > userspace. > > Remove check_cfs_rq_runtime() and unify throttling into > account_cfs_rq_runtime() which only sets the cfs_rq->throttled, > cfs_rq->throttle_count indicators via throttle_cfs_rq() and optionally > adds the task work to the current task (donor) it is on the throttled > hierarchy. > > throttle_cfs_rq() requests for sched_cfs_bandwidth_slice() worth of > bandwidth for the current hierarchy that enable it to continue running > uninterrupted when selected. For the rest, it requests a bare minimum of > "1" to ensure some bandwidth is available and pass the > "runtime_remaining > 0" checks once selected. > > For SCHED_PROXY_EXEC, a mutex holder cannot exit to userspace without > dropping it first and the mutex_unlock() ensures proxy is stopped before > the mutex handoff which preserves the current semantics for running a > throttled task until it exits to the userspace even if it acts as a > donor. > > [ prateek: rebased on tip, comments, commit message. ] Yeah, no need to go into schedule() anymore. Having some extra callers of task_throttle_setup_work() instead is better. Reviewed-By: Benjamin Segall