All of lore.kernel.org
 help / color / mirror / Atom feed
* + task_numa_compare-fix-check-for-kernel-thread.patch added to mm-unstable branch
@ 2025-05-21 20:59 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-05-21 20:59 UTC (permalink / raw)
  To: mm-commits, yu.c.chen, vineethr, tj, tim.c.chen, shakeel.butt,
	roman.gushchin, muchun.song, mkoutny, mingo, mhocko, mgorman,
	libo.chen, kprateek.nayak, hannes, corbet, ayush.jain3, aubrey.li,
	akpm, akpm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3010 bytes --]


The patch titled
     Subject: task_numa_compare: fix check for kernel thread
has been added to the -mm mm-unstable branch.  Its filename is
     task_numa_compare-fix-check-for-kernel-thread.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/task_numa_compare-fix-check-for-kernel-thread.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: task_numa_compare: fix check for kernel thread
Date: Wed May 21 01:54:00 PM PDT 2025

Peter points out "!cur->mm is not the right way to determine a kernel
thread, PF_KTHREAD is.  Notably, there are kernel threads that have ->mm".

Link: https://lkml.kernel.org/r/20250521191114.GE24938@noisy.programming.kicks-ass.net
Fixes: 69cebdfa253b sched/numa: fix task swap by skipping kernel threads
Cc: Aubrey Li <aubrey.li@intel.com>
Cc: Ayush Jain <ayush.jain3@amd.com>
Cc: "Chen, Tim C" <tim.c.chen@intel.com>
Cc: Chen, Yu C <yu.c.chen@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Libo Chen <libo.chen@oracle.com>
Cc: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Cc: Mel Gorman <mgorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/sched/fair.c~task_numa_compare-fix-check-for-kernel-thread
+++ a/kernel/sched/fair.c
@@ -2274,7 +2274,7 @@ static bool task_numa_compare(struct tas
 	rcu_read_lock();
 	cur = rcu_dereference(dst_rq->curr);
 	if (cur && ((cur->flags & PF_EXITING) || is_idle_task(cur) ||
-		    !cur->mm))
+		    !(cur->flags & PF_KTHREAD)))
 		cur = NULL;
 
 	/*
_

Patches currently in -mm which might be from akpm@linux-foundation.org are

task_numa_compare-fix-check-for-kernel-thread.patch
mm-add-zblock-allocator-fix.patch
mm-add-zblock-allocator-fix-2.patch
mm-add-zblock-allocator-fix-2-fix.patch
mm-add-zblock-allocator-fix-3.patch
mm-zblock-avoid-failing-the-build-fix.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-21 20:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 20:59 + task_numa_compare-fix-check-for-kernel-thread.patch added to mm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.