[Patch 07/25] GRU - add context lock flag to gru status

From: steiner
Date: Mon Jul 19 2010 - 17:39:04 EST


From: Jack Steiner <steiner@xxxxxxx>

Add a flag to the GRU cch_status file to indicate if the cch is locked.
This is useful for debugging.

Signed-off-by: Jack Steiner <steiner@xxxxxxx>


---
drivers/misc/sgi-gru/gruprocfs.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

Index: linux/drivers/misc/sgi-gru/gruprocfs.c
===================================================================
--- linux.orig/drivers/misc/sgi-gru/gruprocfs.c 2010-06-09 08:11:42.043954832 -0500
+++ linux/drivers/misc/sgi-gru/gruprocfs.c 2010-06-09 08:11:42.456084620 -0500
@@ -190,21 +190,22 @@ static int cch_seq_show(struct seq_file
const char *mode[] = { "??", "UPM", "INTR", "OS_POLL" };

if (gid == 0)
- seq_printf(file, "#%5s%5s%6s%7s%9s%6s%8s%8s\n", "gid", "bid",
- "ctx#", "asid", "pid", "cbrs", "dsbytes", "mode");
+ seq_printf(file, "#%5s%5s%6s%7s%9s%6s%8s%8s%7s\n", "gid", "bid",
+ "ctx#", "asid", "pid", "cbrs", "dsbytes", "mode", "locked");
if (gru)
for (i = 0; i < GRU_NUM_CCH; i++) {
ts = gru->gs_gts[i];
if (!ts)
continue;
- seq_printf(file, " %5d%5d%6d%7d%9d%6d%8d%8s\n",
+ seq_printf(file, " %5d%5d%6d%7d%9d%6d%8d%8s%7s\n",
gru->gs_gid, gru->gs_blade_id, i,
is_kernel_context(ts) ? 0 : ts->ts_gms->ms_asids[gid].mt_asid,
is_kernel_context(ts) ? 0 : ts->ts_tgid_owner,
ts->ts_cbr_au_count * GRU_CBR_AU_SIZE,
- ts->ts_cbr_au_count * GRU_DSR_AU_BYTES,
+ ts->ts_dsr_au_count * GRU_DSR_AU_BYTES,
mode[ts->ts_user_options &
- GRU_OPT_MISS_MASK]);
+ GRU_OPT_MISS_MASK],
+ mutex_is_locked(&ts->ts_ctxlock) ? "LOCKED" : "-");
}

return 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/