Thread (7 messages) 7 messages, 5 authors, 2017-02-20

Re: [PATCH] oom_reaper: switch to struct list_head for reap queue

From: Ingo Molnar <mingo@kernel.org>
Date: 2017-02-15 08:08:52
Also in: lkml

* Aleksa Sarai [off-list ref] wrote:
quoted
quoted
Rather than implementing an open addressing linked list structure
ourselves, use the standard list_head structure to improve consistency
with the rest of the kernel and reduce confusion.

Cc: Michal Hocko <mhocko@suse.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Aleksa Sarai <redacted>
---
include/linux/sched.h |  6 +++++-
kernel/fork.c         |  4 ++++
mm/oom_kill.c         | 24 +++++++++++++-----------
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e93594b88130..d8bcd0f8c5fe 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1960,7 +1960,11 @@ struct task_struct {
#endif
	int pagefault_disabled;
#ifdef CONFIG_MMU
-	struct task_struct *oom_reaper_list;
+	/*
+	 * List of threads that have to be reaped by OOM (rooted at
+	 * &oom_reaper_list in mm/oom_kill.c).
+	 */
+	struct list_head oom_reaper_list;
This is an extra pointer to task_struct and more lines of code to
accomplish the same thing. Why would we want to do that?
I don't think it's more "actual" lines of code (I think the wrapping is
inflating the line number count), but switching it means that it's more in
line with other queues in the kernel (it took me a bit to figure out what
was going on with oom_reaper_list beforehand).
It's still an extra pointer and extra generated code to do the same thing - a clear step backwards.

Thanks,

	Ingo

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help