From 72a2537c6d92f2f60fabe98050fbea59bc7f9dc8 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 18 Jul 2013 14:42:07 +0200 Subject: [PATCH] copy: make io_prio configurable via /proc --- kernel/mars_copy.c | 12 +++++++++++- kernel/mars_copy.h | 2 ++ kernel/sy_old/mars_proc.c | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/kernel/mars_copy.c b/kernel/mars_copy.c index 11d3f6fd..7affbd76 100644 --- a/kernel/mars_copy.c +++ b/kernel/mars_copy.c @@ -35,6 +35,12 @@ int mars_copy_overlap = 0; EXPORT_SYMBOL_GPL(mars_copy_overlap); +int mars_copy_read_prio = MARS_PRIO_NORMAL; +EXPORT_SYMBOL_GPL(mars_copy_read_prio); + +int mars_copy_write_prio = MARS_PRIO_NORMAL; +EXPORT_SYMBOL_GPL(mars_copy_write_prio); + ///////////////////////// own helper functions //////////////////////// /* TODO: @@ -261,7 +267,11 @@ int _make_mref(struct copy_brick *brick, int index, int queue, void *data, loff_ len = end_pos - pos; } mref->ref_len = len; - mref->ref_prio = brick->io_prio; + mref->ref_prio = rw ? + mars_copy_write_prio : + mars_copy_read_prio; + if (mref->ref_prio < MARS_PRIO_HIGH || mref->ref_prio > MARS_PRIO_LOW) + mref->ref_prio = brick->io_prio; SETUP_CALLBACK(mref, copy_endio, mref_a); diff --git a/kernel/mars_copy.h b/kernel/mars_copy.h index f0ae5710..63e8a11b 100644 --- a/kernel/mars_copy.h +++ b/kernel/mars_copy.h @@ -11,6 +11,8 @@ #define INPUT_B_COPY 3 extern int mars_copy_overlap; +extern int mars_copy_read_prio; +extern int mars_copy_write_prio; enum { COPY_STATE_RESET = -1, diff --git a/kernel/sy_old/mars_proc.c b/kernel/sy_old/mars_proc.c index 95b87b6b..0a865aab 100644 --- a/kernel/sy_old/mars_proc.c +++ b/kernel/sy_old/mars_proc.c @@ -231,6 +231,8 @@ ctl_table mars_table[] = { INT_ENTRY("mem_used_raw_kb", brick_global_block_used,0400), INT_ENTRY("io_flying_count", mars_global_io_flying, 0400), INT_ENTRY("copy_overlap", mars_copy_overlap, 0600), + INT_ENTRY("copy_read_prio", mars_copy_read_prio, 0600), + INT_ENTRY("copy_write_prio", mars_copy_write_prio, 0600), INT_ENTRY("statusfiles_rollover_sec", mars_rollover_interval, 0600), INT_ENTRY("scan_interval_sec", mars_scan_interval, 0600), INT_ENTRY("propagate_interval_sec", mars_propagate_interval, 0600),