[merged] procfs-treat-parked-tasks-as-sleeping-for-task-state.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: procfs: treat parked tasks as sleeping for task state
has been removed from the -mm tree.  Its filename was
     procfs-treat-parked-tasks-as-sleeping-for-task-state.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Chris Metcalf <cmetcalf@xxxxxxxxxx>
Subject: procfs: treat parked tasks as sleeping for task state

Allowing watchdog threads to be parked means that we now have the
opportunity of actually seeing persistent parked threads in the output of
/proc/<pid>/stat and /proc/<pid>/status.  The existing code reported such
threads as "Running", which is kind-of true if you think of the case where
we park them as part of taking cpus offline.  But if we allow parking them
indefinitely, "Running" is pretty misleading, so we report them as
"Sleeping" instead.

We could simply report them with a new string, "Parked", but it feels like
it's a bit risky for userspace to see unexpected new values; the output is
already documented in Documentation/filesystems/proc.txt, and it seems
like a mistake to change that lightly.

The scheduler does report parked tasks with a "P" in debugging output from
sched_show_task() or dump_cpu_task(), but that's a different API. 
Similarly, the trace_ctxwake_* routines report a "P" for parked tasks, but
again, different API.

This change seemed slightly cleaner than updating the task_state_array to
have additional rows.  TASK_DEAD should be subsumed by the exit_state
bits; TASK_WAKEKILL is just a modifier; and TASK_WAKING can very
reasonably be reported as "Running" (as it is now).  Only TASK_PARKED
shows up with unreasonable output here.

Signed-off-by: Chris Metcalf <cmetcalf@xxxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Ulrich Obergfell <uobergfe@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/proc/array.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff -puN fs/proc/array.c~procfs-treat-parked-tasks-as-sleeping-for-task-state fs/proc/array.c
--- a/fs/proc/array.c~procfs-treat-parked-tasks-as-sleeping-for-task-state
+++ a/fs/proc/array.c
@@ -126,6 +126,14 @@ static inline const char *get_task_state
 {
 	unsigned int state = (tsk->state | tsk->exit_state) & TASK_REPORT;
 
+	/*
+	 * Parked tasks do not run; they sit in __kthread_parkme().
+	 * Without this check, we would report them as running, which is
+	 * clearly wrong, so we report them as sleeping instead.
+	 */
+	if (tsk->state == TASK_PARKED)
+		state = TASK_INTERRUPTIBLE;
+
 	BUILD_BUG_ON(1 + ilog2(TASK_REPORT) != ARRAY_SIZE(task_state_array)-1);
 
 	return task_state_array[fls(state)];
_

Patches currently in -mm which might be from cmetcalf@xxxxxxxxxx are

origin.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux