Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gru: add debug option for cache flushing

Add a debug option to the SGI GRU driver for flushing GRU cache lines from
memory. In theory this is not needed but it is useful for debugging.
This has no use by end users.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jack Steiner and committed by
Linus Torvalds
b8229bed 7f2251b1

+10 -5
+8 -5
drivers/misc/sgi-gru/grukdump.c
··· 44 44 45 45 static int gru_dump_context_data(void *grubase, 46 46 struct gru_context_configuration_handle *cch, 47 - void __user *ubuf, int ctxnum, int dsrcnt) 47 + void __user *ubuf, int ctxnum, int dsrcnt, 48 + int flush_cbrs) 48 49 { 49 50 void *cb, *cbe, *tfh, *gseg; 50 51 int i, scr; ··· 56 55 tfh = grubase + GRU_TFH_BASE; 57 56 58 57 for_each_cbr_in_allocation_map(i, &cch->cbr_allocation_map, scr) { 58 + if (flush_cbrs) 59 + gru_flush_cache(cb); 59 60 if (gru_user_copy_handle(&ubuf, cb)) 60 61 goto fail; 61 62 if (gru_user_copy_handle(&ubuf, tfh + i * GRU_HANDLE_STRIDE)) ··· 118 115 119 116 static int gru_dump_context(struct gru_state *gru, int ctxnum, 120 117 void __user *ubuf, void __user *ubufend, char data_opt, 121 - char lock_cch) 118 + char lock_cch, char flush_cbrs) 122 119 { 123 120 struct gru_dump_context_header hdr; 124 121 struct gru_dump_context_header __user *uhdr = ubuf; ··· 162 159 ret = -EFBIG; 163 160 else 164 161 ret = gru_dump_context_data(grubase, cch, ubuf, ctxnum, 165 - dsrcnt); 166 - 162 + dsrcnt, flush_cbrs); 167 163 } 168 164 if (cch_locked) 169 165 unlock_cch_handle(cch); ··· 217 215 for (ctxnum = 0; ctxnum < GRU_NUM_CCH; ctxnum++) { 218 216 if (req.ctxnum == ctxnum || req.ctxnum < 0) { 219 217 ret = gru_dump_context(gru, ctxnum, ubuf, ubufend, 220 - req.data_opt, req.lock_cch); 218 + req.data_opt, req.lock_cch, 219 + req.flush_cbrs); 221 220 if (ret < 0) 222 221 goto fail; 223 222 ubuf += ret;
+2
drivers/misc/sgi-gru/grulib.h
··· 125 125 int ctxnum; 126 126 char data_opt; 127 127 char lock_cch; 128 + char flush_cbrs; 129 + char fill[10]; 128 130 pid_t pid; 129 131 void *buf; 130 132 size_t buflen;