Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796138149; b=1ZkrYzd4Jz+BKme8jns5YFML38osCwdDAT1/q8NWjpr0QzYrbBDWQbw2Z9ataVhPlwib +eaQr73xg7B0zP0Bhl412jScnNz5bcr7vvJrWvErcfTdrKvJyFRkOCrNCoE/BBNl89lDX qsN1+jcMQ9EEozUPkFf8ledYc+9qWLAP/SHAv1bAfvF7f2y8QvAk7SkPskIZW1KQZugzk U+vJY/gmANUkvK+9OqSYH6K3BtDhymtADIN267U8drZMLpYv9WD2m+A3obBRcVEq/VjsN 9yQlBFkO/ZUcSd7LKJArqTwoUENM5UUCFCgyriid1+Gp378EekP3yd5Z6YPUiG1uBWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796138149; 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=KTLUbHc/3mmOHdkdhDjlGWR4/1pmEyjSVyRPOQHHHuw=; b=mfgaIbmUT5nIa0SkPn7T4h0E1FRR9kMqzeUDPnQ9kdSej/S9Y06eDeMPNYa8LNLfPTxW XDjzCrs46DJ+SJzYhKyqgeZobu+oDnSuh4T6izSrNuV8IGvyjesVmn5NltrHhwl2BpgsA aJAN6pbGG7EMAvUuZj/EmS6B1+/HI5fSnWeFDk8j+V2WUdoBqHeRliD0olg0Vw5zqvFm/ LHCkp+Nn3TKKZ6hASL2t3q15MUdx0ajd/ZyUYsSJVU6lvbxbRkxkyLpbdzr7KKhLqzBc5 KAw4/4uLDJMU5Z3za3r9kAMM5FGLzVtalNEEtUAdNkCbCqv4iHhLASDcy/lOPdNpU3g== 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="k1diMF1/"; arc=none smtp.remote-ip=209.85.128.72 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (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 519C9606A322 for ; Tue, 1 Dec 2026 15:15:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 519C9606A322 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=k1diMF1/ Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4a1f03f2e8aso106284275e9.1 for ; Tue, 01 Dec 2026 07:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796138148; x=1796742948; 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=KTLUbHc/3mmOHdkdhDjlGWR4/1pmEyjSVyRPOQHHHuw=; b=k1diMF1/e3t/q3hXQk3WdO9wwvkqTILg47OzFkhst12mq7XSuPxfsGFjCb7nk2TsuI lh1SUzNgfDIyEZfyz1VhAs9sfB/cMzctOWOnBokpyWUR07NzGT18Z2naJGDfNyI9VP00 rok1UnU1lokXChn+KpXejfQhdgslRACGLpnYg8h3JalleTbf1vrOWXI5SBrZ+8TuqfZx BKvPFu6QTrQkISc014NhXMxQY1u5EJh8vJABbG6cjWE69K46iyLBaXz/CvinTPERD9J1 kECKU+M9akYC1sNhVbFmnh8pgphrWn8x7TXGfODdiJbWAUHIfysZj/aTxPhQhsOL/xN+ oOig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796138148; x=1796742948; 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=KTLUbHc/3mmOHdkdhDjlGWR4/1pmEyjSVyRPOQHHHuw=; b=yowLwdEm8y2VX0C5hfF12So/BEkSgPFaKNofjDahAaDYTp3Wv+n7w5d+gX5v0ukrWu MwFHBVQQJqDCXMApCFwam8ibgFmhC9KK5P4/Gh/B0wsBX5iYtoixANNxb75zBDdWLBat FHXh0bi6MZche+iE14/Adz13A5cvYnLeOx+mzLUpFSCHgQeuihzdp35BJ6sFbLih30gX 9Q8ccq7KjEgcxGTtHEVU1apJ/7rnsXlhNaDlSGwrunVOPeEfA7mP5QsD9bG/nVKfN6qU Ptjyv2rRs9xoECno+7IeoTTivppD+1yLsDJskYRzT2CNbUi3FvAPlC8rsoxcYkDa75ox VPzg== X-Gm-Message-State: APuU4Z89hvmOJhDppM4J28E+NWJ63cEPr6BJd1w26mPZisSSIdBGNP+w 3XbS99W9HJbUQ0tdLv1gEyOST0+wKETRQYSKDx5RGhIuj+ZijdXnBkAtxiQsUBlHAn9bwA+VVcq nDd2Iek2nK0VE+k5ELW4lGbhGzKgE0j/PF/STdw5atssgST5vKhoN1FHVkWE2ZejbjaNr+MxTGe j54FkkZSsgcRptW4NbmjlHD+i2pIwdRBrqCVBtq7K67uWmF+GGrZ4fwhVErPo= X-Received: from wmco9.prod.google.com ([2002:a05:600c:a309:b0:4a3:9bdc:d7e4]) (user=jpiecuch job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1d29:b0:4a9:2a92:231f with SMTP id 5b1f17b1804b1-4bb88804d4dmr773435325e9.7.1796138147510; Tue, 01 Dec 2026 07:15:47 -0800 (PST) Date: Tue, 1 Dec 2026 15:15:46 +0000 In-Reply-To: X-Mailing-List: sashiko-reviews@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261201120123.3678974-1-jpiecuch@google.com> <20261201120123.3678974-3-jpiecuch@google.com> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261201151535.2379180-1-jpiecuch@google.com> Subject: Re: [PATCH 2/2] selftests/sched_ext: Add core_forceidle test for voluntary idle picks From: Kuba Piecuch To: sashiko-reviews@lists.linux.dev Cc: sched-ext@lists.linux.dev Content-Type: text/plain; charset="UTF-8" On Tue, 01 Dec 2026 12:26, sashiko-bot@kernel.org wrote: > When Phase 1 parks parked_st in PARK_DSQ and both siblings pick idle, > pick_next_task() resets rq->core->core_cookie to 0 while > rq->core->core_forceidle_count remains 0. Because > core_forceidle_dispatch() keeps PARK_DSQ parked when phase is 2, > parked_st never runs on sib0 between Phase 1 and Phase 2, and the > ph == 2 branch in core_forceidle_enqueue() is never reached. > > When Phase 2 wakes untagged busy_st (core_cookie == 0) on sib1, > pick_next_task() sees !need_sync && !next->core_cookie and takes the > single-rq fast path to out_set_next, bypassing the core-wide sibling loop > where occ == 1 and core_forceidle_count are evaluated. Also, busy_running > in core_forceidle.bpf.c is updated in running/stopping but never read. > > Should parked_st be unparked once busy_st is running on sib1 so that > sib0 enters Phase 2 with a non-zero core_cookie before re-parking on > SCX_ENQ_LAST? Good catch, that is right. With patch 1 applied, Phase 1 leaves both rq->core->core_cookie and rq->core->core_forceidle_count at 0, so waking untagged busy_st in Phase 2 takes the !need_sync fast path and skips the core-wide sibling loop. Keeping busy_st untagged avoids unrelated untagged kernel threads on sib0 causing genuine forced idle, so unparking parked_st once busy_st is running and letting it expire and re-park on SCX_ENQ_LAST is the right fix: the pick that parks parked_st then enters the core-wide loop with need_sync set and selects busy_st on sib1 (occ == 1) alongside voluntary idle on sib0. I will update Phase 2 accordingly (and drop the unused busy_running field and stopping callback) in v2.