diff options
author | Zhen Wei <zwei@novell.com> | 2006-12-08 02:48:17 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-12-28 19:40:32 -0500 |
commit | 92efc15241ceebc23451691971897020e8563a70 (patch) | |
tree | e9f5c8a43e61f7a9993fb962f3f4158ec46648c5 /fs/ocfs2/cluster | |
parent | 7f4a2a97e324e8c826d1d983bc8efb5c59194f02 (diff) |
ocfs2: export heartbeat thread pid via configfs
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>
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index a25ef5a50386..277ca67a2ad6 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -1447,6 +1447,15 @@ out: | |||
1447 | return ret; | 1447 | return ret; |
1448 | } | 1448 | } |
1449 | 1449 | ||
1450 | static ssize_t o2hb_region_pid_read(struct o2hb_region *reg, | ||
1451 | char *page) | ||
1452 | { | ||
1453 | if (!reg->hr_task) | ||
1454 | return 0; | ||
1455 | |||
1456 | return sprintf(page, "%u\n", reg->hr_task->pid); | ||
1457 | } | ||
1458 | |||
1450 | struct o2hb_region_attribute { | 1459 | struct o2hb_region_attribute { |
1451 | struct configfs_attribute attr; | 1460 | struct configfs_attribute attr; |
1452 | ssize_t (*show)(struct o2hb_region *, char *); | 1461 | ssize_t (*show)(struct o2hb_region *, char *); |
@@ -1485,11 +1494,19 @@ static struct o2hb_region_attribute o2hb_region_attr_dev = { | |||
1485 | .store = o2hb_region_dev_write, | 1494 | .store = o2hb_region_dev_write, |
1486 | }; | 1495 | }; |
1487 | 1496 | ||
1497 | static struct o2hb_region_attribute o2hb_region_attr_pid = { | ||
1498 | .attr = { .ca_owner = THIS_MODULE, | ||
1499 | .ca_name = "pid", | ||
1500 | .ca_mode = S_IRUGO | S_IRUSR }, | ||
1501 | .show = o2hb_region_pid_read, | ||
1502 | }; | ||
1503 | |||
1488 | static struct configfs_attribute *o2hb_region_attrs[] = { | 1504 | static struct configfs_attribute *o2hb_region_attrs[] = { |
1489 | &o2hb_region_attr_block_bytes.attr, | 1505 | &o2hb_region_attr_block_bytes.attr, |
1490 | &o2hb_region_attr_start_block.attr, | 1506 | &o2hb_region_attr_start_block.attr, |
1491 | &o2hb_region_attr_blocks.attr, | 1507 | &o2hb_region_attr_blocks.attr, |
1492 | &o2hb_region_attr_dev.attr, | 1508 | &o2hb_region_attr_dev.attr, |
1509 | &o2hb_region_attr_pid.attr, | ||
1493 | NULL, | 1510 | NULL, |
1494 | }; | 1511 | }; |
1495 | 1512 | ||