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 D1188346FC8 for ; Mon, 12 Jan 2026 09:02:44 +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=1768208567; cv=none; b=RtL3pw83YF0CUbfq1qiIS7zXowkQEXApv3Rjg86xl014Kf51llJseDrmFw4LDcDMfAsSlL7/x4TabtwXOUdF3vhp8PpJFkFyN4Kwu1G+tVTHhNw4d2g++tBPCn/xJb8qMMUoFGXhVmYKqCb54iwXsB88B2egFr/a4Nts8zEWy7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768208567; c=relaxed/simple; bh=E+lQvyko6+pXYbBbaYJARRGHsURuF6lTl1ax1ZiOjdc=; h=Message-ID:Subject:From:To:Cc:Date:Content-Type:MIME-Version; b=iITqiVLKE/WP0KVWGKY8dc7/NjXapGkuudRvfjKZFaIZUsavZCM5CC57PIJC9T991GsMGudDDmjJI3FXdoVsgZIqeOjhRSQ6HHSTrzhl5yULsmPMDazk7Q/GwUHzUa/yS3TzmC0dDf6mz7gm+9EIERgAMs7cuYUZtpnfuYaP8lk= 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=U1fZ4f00; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=GM3Jo7lr; 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="U1fZ4f00"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="GM3Jo7lr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768208563; 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: content-transfer-encoding:content-transfer-encoding:autocrypt:autocrypt; bh=KFG5THa3U5lV5GqZkm/oD2oNMVYerOx0xh8YFxk/hWs=; b=U1fZ4f003A9x7pzyMAFQusvQWYNNxbmbrClF04Gyog5rMnkRWgtGhzZ3ywMqiNAAXjwalu 28MkpEPRlD293rVd/E1f/6ifV9Nca05cck1mGlFAr4ArBltwImiC3T+rFrqaWKl1RmZYSL 5I6KBaOv/JVrGszMRNe8f9bX80uKsXc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-ztKK3qqKN0-1AnbqSjKVYg-1; Mon, 12 Jan 2026 04:02:41 -0500 X-MC-Unique: ztKK3qqKN0-1AnbqSjKVYg-1 X-Mimecast-MFC-AGG-ID: ztKK3qqKN0-1AnbqSjKVYg_1768208561 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-477563a0c75so38050435e9.1 for ; Mon, 12 Jan 2026 01:02:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1768208560; x=1768813360; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:autocrypt:date:cc :to:from:subject:message-id:from:to:cc:subject:date:message-id :reply-to; bh=KFG5THa3U5lV5GqZkm/oD2oNMVYerOx0xh8YFxk/hWs=; b=GM3Jo7lrReAQSMch6z5fTkTlnWH4+iSGm8LFqSYNdUDT1Y6cK7Pw8Z0NTjXyWKrx2V UG66MrFdMdupxIf8bGs4Ayp0sK7E/gLEWuPr7DIHUFR54D4LW07YZgv1/hVOdqk0dISt yJeN25yAIYmu99CkH5hH9ipKgsArK5n7Fs7US3Shh0WvS4BUHNo/FtG8rHBxoOyYHfig h9kSkhzWV5lLOkSuD4NIA2zddivJoAZ3wVpnFw3uAOYBfJVYEUrC2I8ZBjVRPvUDz+7g GazWN9zMyeN1dGITWY3WXmZiEegjLsc0qxE5XwusUrtuPOZ/26Bmj2wSc3KKVbrJ39UF 3WpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768208560; x=1768813360; h=mime-version:user-agent:content-transfer-encoding:autocrypt:date:cc :to:from:subject:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KFG5THa3U5lV5GqZkm/oD2oNMVYerOx0xh8YFxk/hWs=; b=eiWOoZWlNBJB7QquvKiZVTGNIXF4NhWIsrOiLWDJOMfhjq6DqkELtj7Tkr0i7WPeNW +rSKRDra16/Wl0ak692ew9QyXA/xCS+/fZotWCF2CUVX5LrhoMcjReCqcL8BscsRfSap 9m8fs+arzFxKVng9P/VhlwHoEkWf0o/ykcigRTaUwHBwesiTWJ33PzhDh0FUYVckIE4g c92V5fkPFproHRIa4gJ824aVK66JP0pakzn3lRG7jHVgZaRZMnbDs8R0kHTmTSyugmDf QHqAlgF9+f1T4kXrmnlyB7dhztx59O7Iexq/8FDsDJBiLwbEX6SPrZV0zh3gJC5IBKKS q3eA== X-Gm-Message-State: AOJu0YziMr/SRRPlzUQFeHzs8RYWz1NhSQmbDCLOxnxctHXwvvFzDm09 1jPhGk2CD9TIR9tvTWNkf73yy2edZJF09URwgESg4ktWhEwGHJOg61ymtpBdEdquGf3Y39mCiXO RUoqC9YkDJkKdRlJ5VcsOtlBrp37ODmy3D51cyuDKzK+oN9GSXjfi7QPsjZEvT2GbaosLTofpCF mOPSaQltTexaVP8s3yp6KSoCWb7QKToV1ZucbUppuSr3i7hV5w7AE= X-Gm-Gg: AY/fxX5/t6KBZYWL00iA/5TIJIbn1QnCWevLpiRrzI4MVBRuNlNxYUgWW0LXiaOhbem PbB/4YEwFoNemslqeQFu38ma79Ywz8ZBtKXh2YWlqq5XspXN8ruIya+jkODySShB7W3koWpzOV4 X4WeGUTHuyfDdI8zHJ++A2vrNKhknCG7rzeO0Mibrq2r4Op1EIkNTZDpK9pe+MjVxiDtHjuyE4R fGV3ydT/dU3xQzcgLNVYhwVMwYlNBU/jc+aID5XG8ivrBtIM+0Xb8Ygts8TW4t+6gnwSvaB5KPa 9Cy4aGz9CXNilEEoM+J621IBGJI7HLbq4dZNSuhYCRq1+fotNVeh6l13uvxMq1189f7KXiiMZv3 4ul8ptQzdPGKQ4bDfmRbiBcsSThiILmhL8ztDXotyh166I4bMsGFxd15f4Y4sHIh2Y5jzRAVd27 9ZuTUYDkya X-Received: by 2002:a05:600c:8b09:b0:458:a7fa:211d with SMTP id 5b1f17b1804b1-47d8f284036mr109126505e9.29.1768208560612; Mon, 12 Jan 2026 01:02:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHafAdMll9rohx2k4TNi5ErP5VQER+aQewgiJYQtHVWyZhyInMBqoIhT/XbvyK+/UVSiCRNsg== X-Received: by 2002:a05:600c:8b09:b0:458:a7fa:211d with SMTP id 5b1f17b1804b1-47d8f284036mr109126085e9.29.1768208560135; Mon, 12 Jan 2026 01:02:40 -0800 (PST) Received: from gmonaco-thinkpadt14gen3.rmtit.csb (185-132-178-103.hosted-by-worldstream.net. [185.132.178.103]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d8717db51sm125648885e9.11.2026.01.12.01.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jan 2026 01:02:39 -0800 (PST) Message-ID: <8394f68afac3b26aeba3def48d927e3ab7c177e3.camel@redhat.com> Subject: sched/deadline: Server stops while fair tasks are still runnable From: Gabriele Monaco To: linux-kernel@vger.kernel.org, Peter Zijlstra , Juri Lelli Cc: Clark Williams Date: Mon, 12 Jan 2026 10:02:38 +0100 Autocrypt: addr=gmonaco@redhat.com; prefer-encrypt=mutual; keydata=mDMEZuK5YxYJKwYBBAHaRw8BAQdAmJ3dM9Sz6/Hodu33Qrf8QH2bNeNbOikqYtxWFLVm0 1a0JEdhYnJpZWxlIE1vbmFjbyA8Z21vbmFjb0BrZXJuZWwub3JnPoiZBBMWCgBBFiEEysoR+AuB3R Zwp6j270psSVh4TfIFAmjKX2MCGwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgk Q70psSVh4TfIQuAD+JulczTN6l7oJjyroySU55Fbjdvo52xiYYlMjPG7dCTsBAMFI7dSL5zg98I+8 cXY1J7kyNsY6/dcipqBM4RMaxXsOtCRHYWJyaWVsZSBNb25hY28gPGdtb25hY29AcmVkaGF0LmNvb T6InAQTFgoARAIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgBYhBMrKEfgLgd0WcK eo9u9KbElYeE3yBQJoymCyAhkBAAoJEO9KbElYeE3yjX4BAJ/ETNnlHn8OjZPT77xGmal9kbT1bC1 7DfrYVISWV2Y1AP9HdAMhWNAvtCtN2S1beYjNybuK6IzWYcFfeOV+OBWRDQ== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.2 (3.58.2-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The boost model in [1] spotted cases with fair tasks running after the serv= er stopped. I believe this means that it's equally possible for those tasks to starve without the server even trying to start. There are 2 related situation that can result in this: 1. dl_server_idle is set to true when the CPU is really idle 2. a fair task wakes up (nothing happens since the server is still active) 3. dl_server_timer stops the server since it's idle, although it isn't real= ly ``` -0 d.h3. 2.521220: event_boost: -12: idle x dl_replenish = -> idle -0 d.h3. 2.521227: event_laxity: -12: zero_laxity_wait x d= l_replenish_idle -> idle_wait thread3-3-580 d..4. 3.338067: event_boost: -12: idle x dl_server_res= ume_throttled -> throttled thread3-3-580 d..3. 3.338076: sched_wakeup: ksoftirqd/12:118 [120] CP= U:012 thread5-5-582 d.h2. 3.471237: event_boost: -12: throttled x dl_serve= r_stop -> stopped (final) thread5-5-582 d.h2. 3.471240: event_laxity: -12: idle_wait x dl_serve= r_stop -> stopped (final) ktimers/12-117 d..3. 3.538088: error_boost: -12: event sched_switch_i= n not expected in the state stopped ktimers/12-117 d..2. 3.538089: sched_switch: ktimers/12:117 [98] S =3D= =3D> ksoftirqd/12:118 [120] ``` 1. dl_server_timer runs when the CPU is idle but after a fair task wakes up 2. the call to update_curr sets dl_server_idle since it's only checking rq-= >curr (which is indeed idle) 3. the server is stopped within the same timer call although a fair task ju= st woke up ``` ktimers/13-125 d.s52 7.309878: event_boost: -12: stopped x dl_server_s= tart -> ready ktimers/13-125 d.s52 7.309878: event_laxity: -12: stopped x dl_server_s= tart -> zero_laxity_wait ktimers/13-125 d.s42 7.309879: sched_wakeup: kworker/u519:2:5559 [120] = CPU:012 -0 d.h3. 7.309889: event_boost: -12: ready x dl_replenish = -> ready -0 d.h3. 7.309889: event_laxity: -12: zero_laxity_wait x dl= _replenish_idle -> idle_wait -0 d.h3. 7.309890: event_boost: -12: ready x dl_server_sto= p -> stopped (final) -0 d.h3. 7.309891: event_laxity: -12: idle_wait x dl_server= _stop -> stopped (final) -0 d..3. 7.309895: error_boost: -12: event sched_switch_in= not expected in the state stopped -0 d..2. 7.309896: sched_switch: swapper/12:0 [120] R =3D= =3D> kworker/u519:2:5559 [120] ``` In both cases, if no new fair task wakes up, the one that woke up right bef= ore stopping the server could starve. That's a problem isn't it? I tried a quick solution to the first case by clearing dl_server_idle every= time the server started (even if it's still active, that is at every fair wakeup= ) and I think the second case could be avoided by relying on idle_cpu() instead o= f looking only on rq->curr, taking also waking tasks into account (not tried)= . Is this a real issue or is the monitor just too sensitive? Thanks, Gabriele [1] - https://lore.kernel.org/lkml/20251205131621.135513-1-gmonaco@redhat.c= om