From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.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 AED2936F434 for ; Thu, 11 Jun 2026 07:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781164616; cv=none; b=b3bwTJWVtzlqqAgQmRdElexqSF9drcEOia57l/FGZ8qBHboS69UNkd8muwezDY346vM1KWsLFSLPJ0U0PSzQE70EFWpmJ6Vwbk2+GrGngxatklmSeRdrjK+48cixnv19bvSccAuTpcpE5JM3HW6ZXhf+t9wjE5vMaQgbiWYHwHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781164616; c=relaxed/simple; bh=zML8PZJvsUwE8iyX58y9XGLWRtxDiRoviS+v3Ilke4c=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=oq0WNqnWSmWKu7YprMOEnC2pjEkxElf1zRKuZEMvJkVsGKrdvm/l9n5L6IrEiNb7eg/KlHmOeKJGPVTODLCxCajtVRQXdLokO30RaP/F6nhwm7M4s10AaWx/jlSTr+WIHSHetNDmlMjI28FZHg0/ewHl9lQpEDZolczbhi4SO74= 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.161.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-oo1-f72.google.com with SMTP id 006d021491bc7-69e8587d9caso6154936eaf.3 for ; Thu, 11 Jun 2026 00:56:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781164613; x=1781769413; 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=QjQECITnBtf+6qfUZkkMwFJrBUXovHCjzVOiJyZX+NXbzkJkWl8wV+OWkqm3NyX16A UU64isj6SDIUdVTlAAx8tGOsudOgzqsIgxpXXWdHOXkbJ52ykJ9uoRkVUF7pZDVhFPqu VN4XaxUa+Wm/LxcDbRZjUjcTavSDZNwWpNq9a35d84weRFjCzL82Ub5c78f0L3SpCExI X+hgtuj5GN1cOX+qpdRDd2wL3dIpzUWcYk60LwsASgdG78toSAiCaiMMOdzSjszJshTl 1Ob8aazWT4FWSanPDZJTr8kFwmFtDZOnLbX5dXDcUJeDkpkoZDJZ2bJW2kqsnohg2bW7 Ox/A== X-Gm-Message-State: AOJu0Yw1AeEqurwjy0oaNxxNFemRZcf7+NEG0b0Zd2rvu68a/bQeHcjJ 37SpEPRY+1h95JnOV9AfZinKCs23y14biOSWGvlH7UY8NBdkmFDETXF7jrZppXzxocyqtLAXFV7 ZeuFQeQ3gmYKqHz1zXnK1/sin34f9ELDBws4GniSil0c/BlGZ6zRAJxVio4E= 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:4dc2:b0:69e:423c:720c with SMTP id 006d021491bc7-69ecaee82edmr1404524eaf.32.1781164613699; Thu, 11 Jun 2026 00:56:53 -0700 (PDT) Date: Thu, 11 Jun 2026 00:56:53 -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: <6a2a6a45.3b0a2d4e.8c8d1.000b.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