From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 AD031313545 for ; Mon, 8 Dec 2025 11:15:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765192518; cv=none; b=Dxg72F7skGvhLGRRmlt9fBnmWmST8sLEjpBjYsP1PzubC+4pqHh/3Ts/yc+RWk+v6AWgDfcoReBNvFSH2AtB37NYuHvfSokQPYwA5gDEw0neSqQ9a4x1126YLd0lrzNt6B7TQPatGcg1t5HWW7I2JkOC6BFNaYOFjuRqoejt8m4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765192518; c=relaxed/simple; bh=sj7sNphhYZaVF5qP7MRJ+wFIXaN25bN/qgpFeh/bFkA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=KUdhLCayjHr2Xbh2hrFmSgyXtZYOlcHqd2YFEceUIXZY7d+d7LGHkSkIioLI6mjtiigS31iU+mrexnL6iNMTx/2kx3HyjhFaobEw/4khYbGmpyPkzi0VKpnFuWe9/9bjiL9buf2CLqo4JFCUT/ygf8Lwme5ygWWDJW19a/+z83g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jpiecuch.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FyQ2McF/; arc=none smtp.client-ip=209.85.128.73 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.b="FyQ2McF/" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-47788165c97so26490475e9.0 for ; Mon, 08 Dec 2025 03:15:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1765192515; x=1765797315; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=sj7sNphhYZaVF5qP7MRJ+wFIXaN25bN/qgpFeh/bFkA=; b=FyQ2McF/2GXJoha9Yi7YmFhJ1Jcher3oWRtFKChXLZJfv2NHUQYq9qtRGRe9pS0j69 2OHHSzJ0XMufdAgK7o3+XYfmZQoklnM0KcvUPaNxdiKnWk/tfidU9ZMj/frbFuF04c5Q 9U/cWCqJs3ekTPRtl5QNpJkfZJLh5VqVxZxpB8ia2eJPo8UjWdK5e6m56qs94Xyl4Mgs 89kE+oVVd+JYlJxAFl5Pi/nvJIFeLNjJT/x/DhAXqSML/ulze3VGcxdsqdM4mws6VlB6 B52ZISm4uwKx8BjOsBPDeRa27nfu8rwLczy5qelEpmcWOJdpEiJNk9WgXuO4Df+0Z38O nZjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765192515; x=1765797315; h=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; bh=sj7sNphhYZaVF5qP7MRJ+wFIXaN25bN/qgpFeh/bFkA=; b=gLbgtyEL3R7szWCi3XOX1spm65ssPBzljn+atOEfVeEbGx54DIcb9S+an+kp5uoJ3a zwpz2n/cjtno72P397tfqMcetYgR6yulhYiphpmAMvL2QsS/v2bQvG++7S0AS77H+VN6 GPbVcZDWT73zSG/9jxvSUvAjvtik9v6mJic4WM73QbA9pNCvH0ifU0IIGOOLpjU+JWO8 /fB8j4A0jwh+jYVJVHfJn1zq77JDsZ37S4tRVj4NaeoLUCzpe9jOuoX2wfFncIungi8u Iijk/9alPWpFwGHvy5iL99ocCEqu45opOl5AcEEMK7AILZD7ydiobDiaoM65Jz4Jr2Gx C72g== X-Forwarded-Encrypted: i=1; AJvYcCVi7BuFEW2j16GEm2BnIQ2g1DLhX6JGsPA1y3//y8xrzflA7xbmFtyIqpZcL4EZzncBTS78FKFld8GTD/w=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3rTstUzjLrinc9JrndTEHut1OGLvBG1IzrYxGQjz7RaMgSQEv EKmtIPV3INXFkUg6gaS5TiR4t1Z5pjoiDEM629HzvG+VGzTWUeKHIidDGcR3VgqO4cbR7BMrm79 7zhHxuL0e5x4S3A== X-Google-Smtp-Source: AGHT+IHgil5oa21F4CeSi52vizMTZQ9YndgxtOBxLFoV0jCWSTP89KlmMN4RCZcHpaF+jM9XC0kYM0SuwxPNlA== X-Received: from wmma16.prod.google.com ([2002:a05:600c:2250:b0:475:d94e:4d5d]) (user=jpiecuch job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4fd6:b0:479:3876:22a8 with SMTP id 5b1f17b1804b1-47939e1deacmr81009055e9.16.1765192514810; Mon, 08 Dec 2025 03:15:14 -0800 (PST) Date: Mon, 08 Dec 2025 11:15:14 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251206022218.1541878-1-jstultz@google.com> X-Mailer: aerc 0.20.1 Message-ID: Subject: Re: [RFC][PATCH] sched/ext: Avoid null ptr traversal when ->put_prev_task() is called with NULL next From: Kuba Piecuch To: Kuba Piecuch , John Stultz , LKML Cc: Joel Fernandes , Qais Yousef , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Mel Gorman , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Metin Kaya , Xuewen Yan , K Prateek Nayak , Thomas Gleixner , Daniel Lezcano , Suleiman Souhlal , kuyo chang , hupu , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , , Content-Type: text/plain; charset="UTF-8" On Mon Dec 8, 2025 at 10:10 AM UTC, Kuba Piecuch wrote: > It looks like it's impossible for an outside observer holding a CPU's rq lock > to observe a task that is running on that CPU and isn't queued, i.e. > 'running' implies 'queued' (I'm new to the scheduler so I may be wrong here). A task that blocks in __schedule() can drop the rq lock while picking the next task, which is after try_to_block_task() dequeues prev. So it's very much possible for a task on another CPU to grab the rq lock and observe prev as dequeued but still running.