Skip to contentSkip to conversation

bdi: add a user-tunable cpu_list for the bdi flusher threads

PATCH In review Jeff Moyer 2 participants 2 messages Dec 5, 2012

Subsystems (2)
lore
Share & tools
lore

Jeff Moyer

author
#0 lore raw

PATCH v3 1/1 bdi: add a user-tunable cpu_list for the bdi flusher threads

In realtime environments, it may be desirable to keep the per-bdi flusher threads from running on certain cpus. This patch adds a cpu_list file to /sys/class/bdi/* to enable this. The default is to tie the flusher threads to the same numa node as the backing device (though I could be convinced to make it a mask of all cpus to avoid a change in behaviour).

Thanks to Jeremy Eder for the original idea.

--
changes from v2->v3:
- expanded the mutex coverage to include set_cpus_allowed
- use spin_lock_bh for bdi->wb_lock
- changed the name of the mutex

changes from v1->v2:
- fixed missing free in error path of bdi_init
- fixed up unchecked references to task in the store function

include/linux/backing-dev.h +4 -0
index 2a9a9ab..238521a 100644
@@ -18,6 +18,7 @@
 #include <linux/writeback.h>
 #include <linux/atomic.h>
 #include <linux/sysctl.h>
+#include <linux/mutex.h>
 
 struct page;
 struct device;
@@ -105,6 +106,9 @@ struct backing_dev_info {
 
 	struct timer_list laptop_mode_wb_timer;
 
+	cpumask_t *flusher_cpumask; /* used for writeback thread scheduling */
+	struct mutex flusher_cpumask_lock;
+
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *debug_dir;
 	struct dentry *debug_stats;
mm/backing-dev.c +84 -0

138 lines not on this page · raw message

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 6 lines · Jeff Moyer

In realtime environments, it may be desirable to keep the per-bdi flusher threads from running on certain cpus. This patch adds a cpu_list file to /sys/class/bdi/* to enable this. The default is to tie the flusher threads to the same numa node as the backing device (though I could be convinced to make it a mask of all cpus to avoid a change in behaviour).

This looks fine to me now. I'll queue it up for 3.8.

Signature · 7 lines
Jens Axboe

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>