From mboxrd@z Thu Jan 1 00:00:00 1970 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 A10B0313E14 for ; Wed, 5 Nov 2025 14:20:57 +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=1762352459; cv=none; b=ZTJA3imR/UizCasrKEbBn0xZCPCrPDMkhIlvHvgF/s0gKj8N50nNQBxzj0A7kCxcoZf+M696F+dI+1QsIo+YB6X/NcDkYPuocVXxHxdumBN+ZMYhdONUSrTg7IqCwluf5d8Vs8ExKFj4xMCFMfPP0gOqJVzRxsmCTBiLrBDsHHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762352459; c=relaxed/simple; bh=nu4doHrXZq6HHEdqAu78Ax8NqoZY5xgxh+gqivufsTo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rR6Pkf6ZBpsyYJjYuExbMSXcMWwlGFjD6Qyvxfah029S4ZjjdiVq30E9RmXLevV4Ukox7S/6BOnIQbX7orLP71QHQrMxZU09lp2Gj87sd2DhKzT+ZWKXo1G3y3GkGBCjL3za7T2MYgnbYn6MnPu/t5qccy0uNjnzc3K7GbdO7gQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=alEaJXtS; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=mPgO2B92; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="alEaJXtS"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="mPgO2B92" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762352456; 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=G2VtDGz1DOqvvFYKW79um0LglA9g/B0whzTAe9JWcYQ=; b=alEaJXtS//QnOtIayKntPbmqo9nkuUK4SWosxQjo5v7KP+LD7CwpVxCZvlOqv2X/K9OyNh Yl7X+llYECvVLVoZGpd3dZwXOqsCEG0D/dSrN9ZXP7BWjldtI895fPUxKc33heG4CmmqVQ 1dGiJf30NVTM4B4R4Gj3UBpSDkLy1sE= 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-605-XyfvPwTuPvSmMmkxlmu5ig-1; Wed, 05 Nov 2025 09:20:55 -0500 X-MC-Unique: XyfvPwTuPvSmMmkxlmu5ig-1 X-Mimecast-MFC-AGG-ID: XyfvPwTuPvSmMmkxlmu5ig_1762352454 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-471201dc0e9so65386625e9.2 for ; Wed, 05 Nov 2025 06:20:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762352454; x=1762957254; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=G2VtDGz1DOqvvFYKW79um0LglA9g/B0whzTAe9JWcYQ=; b=mPgO2B92PDF3lGPa8LyEyyaVsD+fIfj/ambGFrS5+OiomVH0r6DnpLautu/XMNsS6P NamliZgSdh/2iNrBtpHuFxKhvXF/tK4+vhP3WaPReCOLZ2etDYJTg8fNhykWWSZyvuLG j0TkCcLAYvQyhUSS5/Pqa2qeOe01ObSLwhOrmXXDtDtBpvZSFB0ifF2LX0QANiL6WpwM O+3gkmZafh+uWAsIwl5BwkYvuZs1HSmvtq4MU3tE7lrRsruQ3bytxSP7npPB2JBWWS+8 28eic8gYh1NWOLkfErKUL2QI1AzYr3/cT9mVXecmZpxEJCVfc55rZh96+Zwajq0CuILv yIZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762352454; x=1762957254; 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=G2VtDGz1DOqvvFYKW79um0LglA9g/B0whzTAe9JWcYQ=; b=f/REs2KPNnVeFnT0SpEJsUBs2ABAbjYqgtiqs8hC5/AGT/UFhIfU1tBs4iq9WNLE8L jN9k7DpiuhOhxU7DyfP5DTMnt+gT5NWuVXC/+CUOmjfwEn6n9BHAQUfRtBAZwBylvpOT 6jQkmuKd+EdRwYLKE3RIihQO9rlnn+HZi0uBercCNGlyRAdm9GqUXU7alXZ8kS7tuz6u y067ta+Q9s8lAo+h+ZbJopq4SwXIylXEjl8Z7a9R1IVAHk+XQObbe3t0cq3P0zns5eAX cjjtl2u+qFpyb938lS+4wkOwJVp/cSzJSc/vdf6Eb+5zTtCGc7etcXIWovZdGBGnK0fa YZUw== X-Forwarded-Encrypted: i=1; AJvYcCXOlihx19jIjBbmIhQtCSS3HqzSvDD3BqLlwEz+YtD6UyqcxGn0wFyJ/Jf+ld+GM7p+TxtPDB3DCMWEAnA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx39I5gwwRHd7W7jY26yqHOTNWusz5FE75slCBBc5jQfzyDlAFt ObJxqVGOYkpFt21OHYtYh5fvN5JL67RPMk2sAcvJJT8Y2FlG0HmxyO4P4BjPV8lQq++/NF3QPfQ UlmpgOFqz3zD9FayZhZ6aHb3I1BsMGACSnrX4UdmWkM4KVQc1CjbGjQi5VMhsihELqg== X-Gm-Gg: ASbGncuqy8aDuc/VXtdqV5reC7AYH3Z1aSU9cDGJOzODMXCpet3eOexlu0e0kNB5B/x is473Wq06l05p2vhptBbOfj1J7zgmUBu1E44Fyi0xTGNzdULL8vvwchO6eLxy0cAcHc4tYXbGmi E4b9xJJBvQw8hYq0IwOjDe4ki/6n8UCK6sDwY5NTvfACqD2PyG2kk/Vj0fRS43G16yzBAvr2cZ0 RieQCA4/9jh/xCe6U1zrLbfQb7d6kVsFHGBoImorHyA/o0arbJGvlN3UOHz+nCYVUeUlAcNQqQR HEOrssYQLdFFJz15ou9LgMsJWZ5J34ERQ6K7orC97WXXosfvifwZREYUyDTgNPITUxFNwh81MY4 oSLmpqUVzo+r2QA+B7jsNEfGppkel3g== X-Received: by 2002:a05:600d:8312:b0:475:de55:9304 with SMTP id 5b1f17b1804b1-4775ce9bc9amr22409285e9.19.1762352454093; Wed, 05 Nov 2025 06:20:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGD225S8D0eAzSRqCZNY8jiiXPUZkIB3X3AaRb7e9hIqiHytYJtBJefyIehRQDx2ycUxkcH5w== X-Received: by 2002:a05:600d:8312:b0:475:de55:9304 with SMTP id 5b1f17b1804b1-4775ce9bc9amr22408905e9.19.1762352453617; Wed, 05 Nov 2025 06:20:53 -0800 (PST) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.129.40]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc192a96sm11270694f8f.13.2025.11.05.06.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Nov 2025 06:20:53 -0800 (PST) Date: Wed, 5 Nov 2025 15:20:50 +0100 From: Juri Lelli To: Peter Zijlstra Cc: Andrea Righi , Ingo Molnar , Vincent Guittot , John Stultz , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Tejun Heo , David Vernet , Changwoo Min , Shuah Khan , Joel Fernandes , Christian Loehle , Emil Tsalapatis , Luigi De Matteis , sched-ext@lists.linux.dev, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHSET v10 sched_ext/for-6.19] Add a deadline server for sched_ext tasks Message-ID: References: <20251029191111.167537-1-arighi@nvidia.com> <20251105135911.GQ4067720@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251105135911.GQ4067720@noisy.programming.kicks-ass.net> On 05/11/25 14:59, Peter Zijlstra wrote: > On Wed, Nov 05, 2025 at 02:47:39PM +0100, Andrea Righi wrote: > > On Wed, Oct 29, 2025 at 08:08:37PM +0100, Andrea Righi wrote: > > > sched_ext tasks can be starved by long-running RT tasks, especially since > > > RT throttling was replaced by deadline servers to boost only SCHED_NORMAL > > > tasks. > > > > > > Several users in the community have reported issues with RT stalling > > > sched_ext tasks. This is fairly common on distributions or environments > > > where applications like video compositors, audio services, etc. run as RT > > > tasks by default. > > > > > > Example trace (showing a per-CPU kthread stalled due to the sway Wayland > > > compositor running as an RT task): > > > > > > runnable task stall (kworker/0:0[106377] failed to run for 5.043s) > > > ... > > > CPU 0 : nr_run=3 flags=0xd cpu_rel=0 ops_qseq=20646200 pnt_seq=45388738 > > > curr=sway[994] class=rt_sched_class > > > R kworker/0:0[106377] -5043ms > > > scx_state/flags=3/0x1 dsq_flags=0x0 ops_state/qseq=0/0 > > > sticky/holding_cpu=-1/-1 dsq_id=0x8000000000000002 dsq_vtime=0 slice=20000000 > > > cpus=01 > > > > > > This is often perceived as a bug in the BPF schedulers, but in reality > > > schedulers can't do much: RT tasks run outside their control and can > > > potentially consume 100% of the CPU bandwidth. > > > > > > Fix this by adding a sched_ext deadline server, so that sched_ext tasks are > > > also boosted and do not suffer starvation. > > > > > > Two kselftests are also provided to verify the starvation fixes and > > > bandwidth allocation is correct. > > > > Peter, Juri, this has now been tested quite extensively on our side and > > we're considering applying these patches to Tejun's sched_ext branch. > > > > Do you have any objections or concerns? > > Yeah, I want to finish this first: > > https://lkml.kernel.org/r/20251101000057.GA2184199@noisy.programming.kicks-ass.net > > Because as is, the whole dl_server stuff isn't quite right. > And I'm spending time on "[PATCH 04/11] sched/deadline: Add support to initialize and remove dl_server bandwidth" which I am still not 100% sure is correct (or that is correct how we handle setting runtime to 0 for fair_server today). Apologies, had some travelling and pto, but should be able to write something more about it in the next few days. Thanks, Juri