Skip to content

Commit

Permalink
ocfs2: export heartbeat thread pid via configfs
Browse files Browse the repository at this point in the history
The patch allows the ocfs2 heartbeat thread to prioritize I/O which may
help cut down on spurious fencing. Most of this will be in the tools -
we can have a pid configfs attribute and let userspace (ocfs2_hb_ctl)
calls the ioprio_set syscall after starting heartbeat, but only cfq
scheduler supports I/O priorities now.

Signed-off-by: Zhen Wei <zwei@novell.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Zhen Wei authored and Mark Fasheh committed Dec 29, 2006
1 parent 7f4a2a9 commit 92efc15
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions fs/ocfs2/cluster/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,15 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,
return ret;
}

static ssize_t o2hb_region_pid_read(struct o2hb_region *reg,
char *page)
{
if (!reg->hr_task)
return 0;

return sprintf(page, "%u\n", reg->hr_task->pid);
}

struct o2hb_region_attribute {
struct configfs_attribute attr;
ssize_t (*show)(struct o2hb_region *, char *);
Expand Down Expand Up @@ -1485,11 +1494,19 @@ static struct o2hb_region_attribute o2hb_region_attr_dev = {
.store = o2hb_region_dev_write,
};

static struct o2hb_region_attribute o2hb_region_attr_pid = {
.attr = { .ca_owner = THIS_MODULE,
.ca_name = "pid",
.ca_mode = S_IRUGO | S_IRUSR },
.show = o2hb_region_pid_read,
};

static struct configfs_attribute *o2hb_region_attrs[] = {
&o2hb_region_attr_block_bytes.attr,
&o2hb_region_attr_start_block.attr,
&o2hb_region_attr_blocks.attr,
&o2hb_region_attr_dev.attr,
&o2hb_region_attr_pid.attr,
NULL,
};

Expand Down

0 comments on commit 92efc15

Please sign in to comment.