OCFS2: allow the ocfs2 heartbeat thread to prioritize I/O
PATCH 1/1 OCFS2: allow the ocfs2 heartbeat thread to prioritize I/O
From: Zhen Wei <[email protected]>
Subject: allow the ocfs2 heartbeat thread to prioritize I/O
Patch-mainline: 2.6.19
To prioritize ocfs2 heartbeat thread I/O may help cut down on spurious fencing,
so the patch sets the heartbeat thread to real time I/O priority after thread starting,
user also can change the I/O priorities via configfs without knowing the thread pid,
but only cfq scheduler supports I/O priorities now.
zhen wei
[email protected]
+86 10 65339225
Novell, Inc.
-------------- next part --------------
From: Zhen Wei <[email protected]>
Subject: allow the ocfs2 heartbeat thread to prioritize I/O
Patch-mainline: 2.6.19
To prioritize ocfs2 heartbeat thread I/O may help cut down on spurious fencing, so the patch set the heartbeat thread to real time I/O level after thread starting, user also can change the I/O priorities via configfs without knowing the thread pid, but only cfq scheduler supports I/O priorities now.
fs/ioprio.c +2 -1
@@ -26,7 +26,7 @@#include <linux/syscalls.h> #include <linux/security.h> -static int set_task_ioprio (struct task_struct *task,int ioprio) +int set_task_ioprio (struct task_struct *task,int ioprio) {int err;struct io_context *ioc;
@@ -225,3 +225,4 @@ asmlinkage long sys_ioprio_get(int whichreturn ret; } +EXPORT_SYMBOL_GPL (set_task_ioprio);
fs/ocfs2/cluster/heartbeat.c +52 -0
97 lines not on this page · raw message
include/linux/ioprio.h +1 -0
@@ -61,4 +61,5 @@ static inline int task_nice_ioprio(struc*/ extern int ioprio_best (unsigned short aprio,unsigned short bprio); +extern int set_task_ioprio (struct task_struct *task,int ioprio);#endif
PATCH 1/1 OCFS2: allow the ocfs2 heartbeat thread to prioritize I/O
Hi Zhen,
Quoted 12 lines · Zhen Wei
From: Zhen Wei <[email protected]>
Subject: allow the ocfs2 heartbeat thread to prioritize I/O
Patch-mainline: 2.6.19To prioritize ocfs2 heartbeat thread I/O may help cut down on spurious fencing,
so the patch sets the heartbeat thread to real time I/O priority after thread starting,
user also can change the I/O priorities via configfs without knowing the thread pid,
but only cfq scheduler supports I/O priorities now.
Quoted 1 line
Signed-off-by Zhen Wei <[email protected]>
Thanks for the patch, but I think you're taking the wrong approach here. I think what we want to do is handle the majority of this in userspace. The "ionice" program already exists to use the system calls in fs/ionice.c to change the io priority of a running thread.
What I would do is look into modifying ocfs2_hb_ctl in ocfs2-tools to modify the io priority of the running heartbeat thread. You can export the thread pid via configfs if need be. The way to modify priority would be either to fork and exec ionice (if it exists), or to call the system call directly. Either way, you'll have to do work to detect whether you're on a system which doesn't support sys_ioprio_set().
--Mark
--
Mark Fasheh
Senior Software Developer, Oracle
[email protected]