From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (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 3C494189B84 for ; Fri, 12 Jun 2026 01:50:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781229030; cv=none; b=CCiyIR8wT2bzjTh1gABJ3PSJpec5Gf/Myi8uxWPqzewR4OjZWRDyNpPFzwECdPlP5+opnaxCMwQHNDzkqaOutTeJHEtQ5DoyzI/Ppk7oUsY3CCKjuTJxk+kbExGnpydYzahNvBeUar03JWgl0JrdkPobUtYSpdnqyGg5LapQfzU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781229030; c=relaxed/simple; bh=zML8PZJvsUwE8iyX58y9XGLWRtxDiRoviS+v3Ilke4c=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=Zhg/jYBde+GIKHC9qqdElLihtys1IUgEvBBpKDKXBCJlFo0swgJjRtjkDWmPkfCNxJteq9OvD4YoAAZL1Q3nHAztvAZclGKDTzAp8IS1p8HiJTlVoPKEStiMMddrVeW45gR7nkKGdxHBbCBH7AVpTrn6Er/fBZpelOixLG0lMpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.210.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-7e71e43e89bso705064a34.3 for ; Thu, 11 Jun 2026 18:50:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781229028; x=1781833828; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lr0jBecFZMt/wlzbQ1UMg0xwKQxBwfIr9Ngv1bCCuGo=; b=TkuKfWF9hARY55p1xn76FJ4fNieiJXgNnNTUeoxNVLbnohwqXY71+3/6Q7pYnEUvzk tZZMdgxs2dM7wkb+uQ4yUpjL0FrlVQAklHjRpGFWPe197v0EFhLhmHShl7gRQMgYiYap 8xpnMij9O2XmnLZIDyZws0I3BOQFwr5AjSwE+XeUHTasq/LkCgXooIimOffWTiJ2dUCg o2fLHqY7OXclgui+BJAqJk4iJml4TyugKvy4UClGgL7QvJXAfJhvb97zwW/Cp4B1+Cqr XeQsqw+kMCiX0SG5gkwO3J2FhmDpygogvQFSGBr0UwksXedR4J2vBiuLCWU09rgViBbs t8eA== X-Gm-Message-State: AOJu0YyiFmH0lWtOAYvu1Ok01wNtv3py65/MgDQ1I1NZHIS3b677MiOB ohosEwhlmXSlE6ek2+9hnRLwo4JtMML4d/RmgSTAL0Wq7s0B0T7g+h481XuJeawQ1l0/l3lF2RO PWxk85Ol7MMy/SNF0JRPMOBX8h+N7Gx6WWgs2aSvSzbv84LARPfLmT1wI0yE= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:f035:b0:699:a7d1:5fd5 with SMTP id 006d021491bc7-69edc7477cbmr598127eaf.39.1781229028317; Thu, 11 Jun 2026 18:50:28 -0700 (PDT) Date: Thu, 11 Jun 2026 18:50:28 -0700 In-Reply-To: <6a289c01.39669fcc.33b062.00a9.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a2b65e4.99669fcc.12a77b.0002.GAE@google.com> Subject: Forwarded: [PATCH] sched/fair: Skip newidle balance for remote rqs From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] sched/fair: Skip newidle balance for remote rqs Author: jie.wang@intel.com #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 49e02880ec0a8c378e811bc9d85da188d7c6204c Commit b3a2dfa8b42e ("sched/fair: Add newidle balance to pick_task_fair()") added sched_balance_newidle() to pick_task_fair(). With CONFIG_SCHED_CORE, the core-wide selection loop in pick_next_task() calls pick_task() for each sibling rq. When a sibling has no CFS tasks, pick_task_fair() enters newidle balancing which drops the shared core-wide rq lock. During this window, tasks already selected for earlier siblings can be migrated away, making core_pick stale. This causes task_rq(p) != rq in hrtick_start_fair(). Skip newidle balance when called for a remote rq. The sibling will do its own newidle balance when it schedules itself. Fixes: b3a2dfa8b42e ("sched/fair: Add newidle balance to pick_task_fair()") Reported-by: syzbot+2cbf10efc23b22ff9c31@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=2cbf10efc23b22ff9c31 Signed-off-by: Jie Wang --- kernel/sched/fair.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1b23e73f48b0..5beb4e1b480b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9942,6 +9942,13 @@ struct task_struct *pick_task_fair(struct rq *rq, struct rq_flags *rf) return p; idle: + /* + * Skip newidle balance for remote rqs -- doing so would drop the + * core-wide rq lock, invalidating already-selected core_picks. + */ + if (rq != this_rq()) + return NULL; + new_tasks = sched_balance_newidle(rq, rf); if (new_tasks < 0) return RETRY_TASK; -- 2.43.0