aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/slow-work.txt4
-rw-r--r--include/linux/slow-work.h8
-rw-r--r--init/Kconfig8
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/slow-work-debugfs.c (renamed from kernel/slow-work-proc.c)4
-rw-r--r--kernel/slow-work.c18
-rw-r--r--kernel/slow-work.h6
7 files changed, 28 insertions, 22 deletions
diff --git a/Documentation/slow-work.txt b/Documentation/slow-work.txt
index 52bc31433723..9dbf4470c7e1 100644
--- a/Documentation/slow-work.txt
+++ b/Documentation/slow-work.txt
@@ -279,9 +279,9 @@ The slow-work thread pool has a number of configurables:
279VIEWING EXECUTING AND QUEUED ITEMS 279VIEWING EXECUTING AND QUEUED ITEMS
280================================== 280==================================
281 281
282If CONFIG_SLOW_WORK_PROC is enabled, a proc file is made available: 282If CONFIG_SLOW_WORK_DEBUG is enabled, a debugfs file is made available:
283 283
284 /proc/slow_work_rq 284 /sys/kernel/debug/slow_work/runqueue
285 285
286through which the list of work items being executed and the queues of items to 286through which the list of work items being executed and the queues of items to
287be executed may be viewed. The owner of a work item is given the chance to 287be executed may be viewed. The owner of a work item is given the chance to
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h
index 5035a2691739..13337bf6c3f5 100644
--- a/include/linux/slow-work.h
+++ b/include/linux/slow-work.h
@@ -20,7 +20,7 @@
20#include <linux/timer.h> 20#include <linux/timer.h>
21 21
22struct slow_work; 22struct slow_work;
23#ifdef CONFIG_SLOW_WORK_PROC 23#ifdef CONFIG_SLOW_WORK_DEBUG
24struct seq_file; 24struct seq_file;
25#endif 25#endif
26 26
@@ -42,8 +42,8 @@ struct slow_work_ops {
42 /* execute a work item */ 42 /* execute a work item */
43 void (*execute)(struct slow_work *work); 43 void (*execute)(struct slow_work *work);
44 44
45#ifdef CONFIG_SLOW_WORK_PROC 45#ifdef CONFIG_SLOW_WORK_DEBUG
46 /* describe a work item for /proc */ 46 /* describe a work item for debugfs */
47 void (*desc)(struct slow_work *work, struct seq_file *m); 47 void (*desc)(struct slow_work *work, struct seq_file *m);
48#endif 48#endif
49}; 49};
@@ -64,7 +64,7 @@ struct slow_work {
64#define SLOW_WORK_DELAYED 5 /* item is struct delayed_slow_work with active timer */ 64#define SLOW_WORK_DELAYED 5 /* item is struct delayed_slow_work with active timer */
65 const struct slow_work_ops *ops; /* operations table for this item */ 65 const struct slow_work_ops *ops; /* operations table for this item */
66 struct list_head link; /* link in queue */ 66 struct list_head link; /* link in queue */
67#ifdef CONFIG_SLOW_WORK_PROC 67#ifdef CONFIG_SLOW_WORK_DEBUG
68 struct timespec mark; /* jiffies at which queued or exec begun */ 68 struct timespec mark; /* jiffies at which queued or exec begun */
69#endif 69#endif
70}; 70};
diff --git a/init/Kconfig b/init/Kconfig
index ab5c64801fe5..39923ccc287b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1098,12 +1098,12 @@ config SLOW_WORK
1098 1098
1099 See Documentation/slow-work.txt. 1099 See Documentation/slow-work.txt.
1100 1100
1101config SLOW_WORK_PROC 1101config SLOW_WORK_DEBUG
1102 bool "Slow work debugging through /proc" 1102 bool "Slow work debugging through debugfs"
1103 default n 1103 default n
1104 depends on SLOW_WORK && PROC_FS 1104 depends on SLOW_WORK && DEBUG_FS
1105 help 1105 help
1106 Display the contents of the slow work run queue through /proc, 1106 Display the contents of the slow work run queue through debugfs,
1107 including items currently executing. 1107 including items currently executing.
1108 1108
1109 See Documentation/slow-work.txt. 1109 See Documentation/slow-work.txt.
diff --git a/kernel/Makefile b/kernel/Makefile
index 776ffed1556d..d7c13d249b2d 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -94,7 +94,7 @@ obj-$(CONFIG_X86_DS) += trace/
94obj-$(CONFIG_RING_BUFFER) += trace/ 94obj-$(CONFIG_RING_BUFFER) += trace/
95obj-$(CONFIG_SMP) += sched_cpupri.o 95obj-$(CONFIG_SMP) += sched_cpupri.o
96obj-$(CONFIG_SLOW_WORK) += slow-work.o 96obj-$(CONFIG_SLOW_WORK) += slow-work.o
97obj-$(CONFIG_SLOW_WORK_PROC) += slow-work-proc.o 97obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o
98obj-$(CONFIG_PERF_EVENTS) += perf_event.o 98obj-$(CONFIG_PERF_EVENTS) += perf_event.o
99 99
100ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) 100ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
diff --git a/kernel/slow-work-proc.c b/kernel/slow-work-debugfs.c
index 3988032571f5..e45c43645298 100644
--- a/kernel/slow-work-proc.c
+++ b/kernel/slow-work-debugfs.c
@@ -57,7 +57,7 @@ static void slow_work_print_mark(struct seq_file *m, struct slow_work *work)
57} 57}
58 58
59/* 59/*
60 * Describe a slow work item for /proc 60 * Describe a slow work item for debugfs
61 */ 61 */
62static int slow_work_runqueue_show(struct seq_file *m, void *v) 62static int slow_work_runqueue_show(struct seq_file *m, void *v)
63{ 63{
@@ -211,7 +211,7 @@ static const struct seq_operations slow_work_runqueue_ops = {
211}; 211};
212 212
213/* 213/*
214 * open "/proc/slow_work_rq" to list queue contents 214 * open "/sys/kernel/debug/slow_work/runqueue" to list queue contents
215 */ 215 */
216static int slow_work_runqueue_open(struct inode *inode, struct file *file) 216static int slow_work_runqueue_open(struct inode *inode, struct file *file)
217{ 217{
diff --git a/kernel/slow-work.c b/kernel/slow-work.c
index b5c17f15f9de..00889bd3c590 100644
--- a/kernel/slow-work.c
+++ b/kernel/slow-work.c
@@ -16,7 +16,7 @@
16#include <linux/kthread.h> 16#include <linux/kthread.h>
17#include <linux/freezer.h> 17#include <linux/freezer.h>
18#include <linux/wait.h> 18#include <linux/wait.h>
19#include <linux/proc_fs.h> 19#include <linux/debugfs.h>
20#include "slow-work.h" 20#include "slow-work.h"
21 21
22static void slow_work_cull_timeout(unsigned long); 22static void slow_work_cull_timeout(unsigned long);
@@ -138,7 +138,7 @@ static void slow_work_clear_thread_processing(int id) {}
138/* 138/*
139 * Data for tracking currently executing items for indication through /proc 139 * Data for tracking currently executing items for indication through /proc
140 */ 140 */
141#ifdef CONFIG_SLOW_WORK_PROC 141#ifdef CONFIG_SLOW_WORK_DEBUG
142struct slow_work *slow_work_execs[SLOW_WORK_THREAD_LIMIT]; 142struct slow_work *slow_work_execs[SLOW_WORK_THREAD_LIMIT];
143pid_t slow_work_pids[SLOW_WORK_THREAD_LIMIT]; 143pid_t slow_work_pids[SLOW_WORK_THREAD_LIMIT];
144DEFINE_RWLOCK(slow_work_execs_lock); 144DEFINE_RWLOCK(slow_work_execs_lock);
@@ -823,7 +823,7 @@ static void slow_work_new_thread_execute(struct slow_work *work)
823static const struct slow_work_ops slow_work_new_thread_ops = { 823static const struct slow_work_ops slow_work_new_thread_ops = {
824 .owner = THIS_MODULE, 824 .owner = THIS_MODULE,
825 .execute = slow_work_new_thread_execute, 825 .execute = slow_work_new_thread_execute,
826#ifdef CONFIG_SLOW_WORK_PROC 826#ifdef CONFIG_SLOW_WORK_DEBUG
827 .desc = slow_work_new_thread_desc, 827 .desc = slow_work_new_thread_desc,
828#endif 828#endif
829}; 829};
@@ -1055,9 +1055,15 @@ static int __init init_slow_work(void)
1055 if (slow_work_max_max_threads < nr_cpus * 2) 1055 if (slow_work_max_max_threads < nr_cpus * 2)
1056 slow_work_max_max_threads = nr_cpus * 2; 1056 slow_work_max_max_threads = nr_cpus * 2;
1057#endif 1057#endif
1058#ifdef CONFIG_SLOW_WORK_PROC 1058#ifdef CONFIG_SLOW_WORK_DEBUG
1059 proc_create("slow_work_rq", S_IFREG | 0400, NULL, 1059 {
1060 &slow_work_runqueue_fops); 1060 struct dentry *dbdir;
1061
1062 dbdir = debugfs_create_dir("slow_work", NULL);
1063 if (dbdir && !IS_ERR(dbdir))
1064 debugfs_create_file("runqueue", S_IFREG | 0400, dbdir,
1065 NULL, &slow_work_runqueue_fops);
1066 }
1061#endif 1067#endif
1062 return 0; 1068 return 0;
1063} 1069}
diff --git a/kernel/slow-work.h b/kernel/slow-work.h
index 3c2f007f3ad6..321f3c59d732 100644
--- a/kernel/slow-work.h
+++ b/kernel/slow-work.h
@@ -19,7 +19,7 @@
19/* 19/*
20 * slow-work.c 20 * slow-work.c
21 */ 21 */
22#ifdef CONFIG_SLOW_WORK_PROC 22#ifdef CONFIG_SLOW_WORK_DEBUG
23extern struct slow_work *slow_work_execs[]; 23extern struct slow_work *slow_work_execs[];
24extern pid_t slow_work_pids[]; 24extern pid_t slow_work_pids[];
25extern rwlock_t slow_work_execs_lock; 25extern rwlock_t slow_work_execs_lock;
@@ -30,9 +30,9 @@ extern struct list_head vslow_work_queue;
30extern spinlock_t slow_work_queue_lock; 30extern spinlock_t slow_work_queue_lock;
31 31
32/* 32/*
33 * slow-work-proc.c 33 * slow-work-debugfs.c
34 */ 34 */
35#ifdef CONFIG_SLOW_WORK_PROC 35#ifdef CONFIG_SLOW_WORK_DEBUG
36extern const struct file_operations slow_work_runqueue_fops; 36extern const struct file_operations slow_work_runqueue_fops;
37 37
38extern void slow_work_new_thread_desc(struct slow_work *, struct seq_file *); 38extern void slow_work_new_thread_desc(struct slow_work *, struct seq_file *);