[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1403694435-3180-14-git-send-email-jslaby@suse.cz>
Date: Wed, 25 Jun 2014 13:07:08 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: linux-kernel@...r.kernel.org
Cc: tj@...nel.org, rostedt@...dmis.org, mingo@...hat.com,
akpm@...ux-foundation.org, andi@...stfloor.org,
paulmck@...ux.vnet.ibm.com, pavel@....cz, jirislaby@...il.com,
Vojtech Pavlik <vojtech@...e.cz>, Michael Matz <matz@...e.de>,
Jiri Kosina <jkosina@...e.cz>, Jiri Slaby <jslaby@...e.cz>,
Frederic Weisbecker <fweisbec@...il.com>
Subject: [PATCH -repost 14/21] kgr: add procfs interface for per-process 'kgr_in_progress'
From: Jiri Kosina <jkosina@...e.cz>
Instead of flooding dmesg with data about tasks which haven't yet been
migrated to the "new universe", create a 'kgr_in_progress' in
/proc/<pid>/ so that it's possible to easily script the checks/actions
in userspace.
js: use the kgr helper
Signed-off-by: Jiri Kosina <jkosina@...e.cz>
Signed-off-by: Jiri Slaby <jslaby@...e.cz> [simplification]
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>
---
fs/proc/base.c | 11 +++++++++++
kernel/kgraft.c | 3 +--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 2d696b0c93bf..60f7b1ce5d1c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -87,6 +87,7 @@
#include <linux/slab.h>
#include <linux/flex_array.h>
#include <linux/posix-timers.h>
+#include <linux/kgraft.h>
#ifdef CONFIG_HARDWALL
#include <asm/hardwall.h>
#endif
@@ -2106,6 +2107,13 @@ static const struct file_operations proc_timers_operations = {
};
#endif /* CONFIG_CHECKPOINT_RESTORE */
+#if IS_ENABLED(CONFIG_KGRAFT)
+static int proc_pid_kgr_in_progress(struct task_struct *task, char *buffer)
+{
+ return sprintf(buffer, "%d\n", kgr_task_in_progress(task));
+}
+#endif /* IS_ENABLED(CONFIG_KGRAFT) */
+
static int proc_pident_instantiate(struct inode *dir,
struct dentry *dentry, struct task_struct *task, const void *ptr)
{
@@ -2638,6 +2646,9 @@ static const struct pid_entry tgid_base_stuff[] = {
#ifdef CONFIG_CHECKPOINT_RESTORE
REG("timers", S_IRUGO, proc_timers_operations),
#endif
+#if IS_ENABLED(CONFIG_KGRAFT)
+ INF("kgr_in_progress", S_IRUSR, proc_pid_kgr_in_progress),
+#endif
};
static int proc_tgid_base_readdir(struct file *file, struct dir_context *ctx)
diff --git a/kernel/kgraft.c b/kernel/kgraft.c
index fd0ded7ce725..d99171c6ea1d 100644
--- a/kernel/kgraft.c
+++ b/kernel/kgraft.c
@@ -77,9 +77,8 @@ static bool kgr_still_patching(void)
read_lock(&tasklist_lock);
for_each_process(p) {
if (kgr_task_in_progress(p)) {
- pr_info("pid %d (%s) still in kernel after timeout\n",
- p->pid, p->comm);
failed = true;
+ break;
}
}
read_unlock(&tasklist_lock);
--
2.0.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists