From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.70 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796037559; b=Q6ndJUSE8B7bd2yx1/x/pD3DnNIjJwA3uU/M0F+8oR29p7kvwq+2jcSwPcxuL2d9HnZ2 BbriMu3/PRyDGmpnE7elUR+IADbFrLB85P8tkU4W2la81bj/7rU1BHAp5Rwzr2SXFPT5z vL34lHZnYk9kBz0bMJDAT6I034TBZrnaGNVZn3YJrSc8JMORbNxm8fkFeZUdtMvQUvSIS siRTSLjV/B66fDB1c5+0dkZaElMvxj6T+qKeIsou1krjFVWbN0JQzysohD6zaj/ctJtC7 fvrUY2nLtqu1/FBhl0bP9vDmGAr2xj2tUqoWNRnlK672BXT/EaM039O3/CJNrhrC2XA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796037559; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Received:Date:In-Reply-To:Mime-Version: References:X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=nqgwZWKZlnBr2WbGbARsDyMPMSCSYTM2NwGv2CIC1sc=; b=0hGlhab6Gpm4F73Ip33BL55wT/Sk48KBRcqnuZhF4WXFjg0nz0Wr2DcziIshjzrR7tMg sA28JAqMx3KwGbB6o0tImfEfDkAE6fBCsasBXgwJ9W/a4SIOZwJF215xWFSovDoxZvpnC xcby1v/zqUzm46AzcK/tCdCGrZlvStZy88PdN+j1XGLuY2attqzZf0Qt4B94MC9uYwRtH AKUjooi8mdfta8XgO9vBL7fAiFTeN+KjMeHNfq0c4iS+RnnmGSZrpJ5XCkkdrVgNDp5xe BkrdYFo5efY5b1fEXgZ3q+NfMcbbfmavT+EdgQWGr25BC3TH66Ac9XtYnCc5xpsRHHg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--jpiecuch.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=NMJC68A8; arc=none smtp.remote-ip=209.85.128.70 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 371CB606A6A0 for ; Mon, 30 Nov 2026 11:19:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 371CB606A6A0 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=flex--jpiecuch.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=NMJC68A8 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4ad3d35e899so84526595e9.1 for ; Mon, 30 Nov 2026 03:19:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796037557; x=1796642357; darn=lists.linux.dev; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=nqgwZWKZlnBr2WbGbARsDyMPMSCSYTM2NwGv2CIC1sc=; b=NMJC68A8SrTrNC0Hbe2O0NKpvcfrocMahVwbp0kfFZJV9hv5v78IwzVgfoLSdGvPCV IxFQkwgTFujiPWuHdjtA5sCxRvWrc29Z1F6IhNO2mqAHU31KhFYuaoo7S09UYrwj0t4J a1VSweewODt/fvmU8+Z1f4QmrmYUCifPHlO0xRi2RpMuCsJMiRXooSqNxOOlRoYPQbPi sTi67BV9ZPwenR6fLRw5KHdDTJz+9pEBsmgMKAdghNU0f9GwBeKdf2er66VlxEo7+gLV GQlmYmextpPF2Ha/LEjevuOokgMGEhk/ldwmxJTNiIjpXjzDHAR42LzxnkngKk4g7VE2 yNLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796037557; x=1796642357; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=nqgwZWKZlnBr2WbGbARsDyMPMSCSYTM2NwGv2CIC1sc=; b=uxy7tFD16ggrCPU2LQ2Lcd53hJT8dIMMOL5nGUoCYYJfohGE35JyYh7LKJR2Ulg7WL caAtldXNcF9U4MUA/PgfOLEcJZ9mcjwE6ySBDfg6FytU3i1ppZFX40mopOu0ZQHXqtkt HnLk71MRdaXiH14MLwrF9dxBnt/ez7qc3ZVnVUQFNUDHCDLyqS5MPiUWYgCU/stsJ++A Z4w3KU3/GqFqXZiwY6biVHZoc40175aptlAg4d69tipVy6YGYLpkt9st7OZOHm/Q4xCV xwfnvzcJS3+Sfx7zfWFnCvMjrTjm976udRfdmHXi5DjvEzYbW2zHUQQbq2WqgkD5CH6W Suhg== X-Gm-Message-State: APuU4Z/iYZfeoo9Zq6Auwbh1xZ9ki3j1jbPFjAoaAx4bvxOnhe5IsQPs lPSaPsEp8vD7bLot7R/Zql241Chkp8imLqmdUgjrTWBD0ByFXtt8sBFeKwlf8xwFWHwk8fUv7Pu 2W8UnxY9rWXrZng== X-Received: from wmcn6.prod.google.com ([2002:a05:600c:c0c6:b0:4a2:853:1e95]) (user=jpiecuch job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:5395:b0:4a3:5a98:c279 with SMTP id 5b1f17b1804b1-4bb8880e599mr658151065e9.8.1796037557342; Mon, 30 Nov 2026 03:19:17 -0800 (PST) Date: Mon, 30 Nov 2026 11:19:15 +0000 In-Reply-To: X-Mailing-List: sched-ext@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261125114932.3198836-1-jpiecuch@google.com> <20261125114932.3198836-2-jpiecuch@google.com> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130111711.2673199-2-jpiecuch@google.com> Subject: Re: [RFC PATCH 1/2] sched_ext: Reenqueue IMMED tasks when a higher class wins the pick From: Kuba Piecuch To: sashiko-reviews@lists.linux.dev Cc: sched-ext@lists.linux.dev Content-Type: text/plain; charset="UTF-8" On Wed, 25 Nov 2026 12:16, sashiko-bot@kernel.org wrote: > With CONFIG_SCHED_CORE, can a sibling CPU miss scx_settle_pick() and leave > SCX_ENQ_IMMED tasks stranded on its local DSQ when cookie matching falls > back to its currently running higher-class task? [...] > Because rq_i never enters __schedule(), rq_i->next_class is not restored to > rq_i->curr->sched_class and scx_settle_pick(rq_i) never runs, leaving the > IMMED task on rq_i->scx.local_dsq while the higher-class task continues > running and causing subsequent rq_is_open(rq_i, ...) checks to see > rq_i->next_class == &ext_sched_class. This looks real, although narrow. With a higher class task current on rq_i, the core-wide pick only gets to do_pick_task_scx() on rq_i through the ext dl_server, so the IMMED task competes with deadline priority. Another sibling's task only wins max if it's a stop or deadline task, or a dl_server pick with an earlier deadline. It also predates this patch, since nothing reenqueued the task before either. Still, the patch says core-sched siblings are covered, and they aren't when the core pick for the sibling is its current task and it never goes through __schedule(). The stale next_class is a problem on its own too: rq_is_open() would accept a PREEMPT|IMMED insertion on rq_i while the RT task keeps running. One way to fix it is to have pick_next_task() restore rq_i->next_class from the core pick when it skips resched_curr() for rq_i because rq_i->curr == rq_i->core_pick, and run the same check as scx_settle_pick() there. I'll look into it for v2.