Skip to contentSkip to conversation

OCFS2: allow the ocfs2 heartbeat thread to prioritize I/O

PATCH Zhen Wei 1 participant 1 message Dec 7, 2006 OCFS2

lore
Share & tools
lore

Zhen Wei

author
#0 lore raw

hi, Mark:

zhen wei
[email protected]
+86 10 65339225

Quoted 10 lines
Quoted 10 lines
Quoted 1 line

Mark Fasheh <[email protected]> 06?12?08? ?? 8:20 >>>

(quoted diff) +9 -0
+errcode_t o2cb_get_hb_thread_pid (const char *cluster_name, const char *region_name,
+			   pid_t *pid)
+{
+	char attr_path[PATH_MAX];
+	char _fake_cluster_name[NAME_MAX];
+	char attr_value[16];
+	errcode_t ret;
+
+	if (!cluster_name) {
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+		ret = _fake_default_cluster(_fake_cluster_name);
+		if (ret)
+			return ret;
+		cluster_name = _fake_cluster_name;
+	}

Hmm, I don't see any other test for cluster_name == NULL in similar code paths... Is there any particular reason why you added one?

o2cb_remove_heartbeat_region() and o2cb_create_heartbeat_region() also have similar code, _fake_default_cluster() shuold return default cluster name.

Quoted 11 lines

ocfs2_hb_ctl.c line 30

Quoted 5 lines
ocfs2_hb_ctl.c renamed from tmp/ocfs2-tools-1.2.2/ocfs2_hb_ctl/ocfs2_hb_ctl.c +2 -0
@@ -29,6 +29,7 @@
+_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
+_syscall2(int, ioprio_get, int, which, int, who);

After looking at all this, and realizing that the proper syscall definitions don't exist anywhere on a modern distro, I'm begining to think that perhaps we want to just fork and exec /usr/bin/ionice.
It seems more future maintainable than defining the syscall interface ourselves.

ok, I will replace syscall interface with exec ionice.

Quoted 10 lines

ocfs2_hb_ctl.c line 35

Quoted 5 lines
ocfs2_hb_ctl.c renamed from tmp/ocfs2-tools-1.2.2/ocfs2_hb_ctl/ocfs2_hb_ctl.c +5 -0
+	case HB_ACTION_IONICE:
+		err = adjust_priority(&hbo);
+		if (err) {
+			com_err(progname, err, "while adjusting heartbeat thread I/O priority");
+			ret = -EINVAL;

So, one thing I don't want to see is spurious errors if the set_ioprio or ionice stuff doesn't exist - this should work just fine without confusing users if they're still on an old kernel. You probably then want to filter out any errors pertaining to the existence (or not) of that api.

oh, this is my careless, I have defined a UNSUPPORTED error_code, but not return it at this place.

thanks for pointing out my mistakes for correction!