Skip to content

Commit 529683d

Browse files
julianwiedmannhcahca
authored andcommitted
s390/qdio: fix statistics for 128 SBALs
Old code would only scan up to 127 SBALs at once. So the last statistics bucket was set aside to count "discovered 127 SBALs with new work" events. But nowadays we allow to scan all 128 SBALs for Output Queues, and a subsequent patch will introduce the same for Input Queues. So fix up the accounting to use the last bucket only when all 128 SBALs have been discovered with new work. Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 7904aaa commit 529683d

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

drivers/s390/cio/qdio.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ struct qdio_dev_perf_stat {
166166
} ____cacheline_aligned;
167167

168168
struct qdio_queue_perf_stat {
169-
/*
170-
* Sorted into order-2 buckets: 1, 2-3, 4-7, ... 64-127, 128.
171-
* Since max. 127 SBALs are scanned reuse entry for 128 as queue full
172-
* aka 127 SBALs found.
173-
*/
169+
/* Sorted into order-2 buckets: 1, 2-3, 4-7, ... 64-127, 128. */
174170
unsigned int nr_sbals[8];
175171
unsigned int nr_sbal_error;
176172
unsigned int nr_sbal_nop;

drivers/s390/cio/qdio_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static int qstat_show(struct seq_file *m, void *v)
165165
}
166166

167167
seq_printf(m, "\n1 2.. 4.. 8.. "
168-
"16.. 32.. 64.. 127\n");
168+
"16.. 32.. 64.. 128\n");
169169
for (i = 0; i < ARRAY_SIZE(q->q_stats.nr_sbals); i++)
170170
seq_printf(m, "%-10u ", q->q_stats.nr_sbals[i]);
171171
seq_printf(m, "\nError NOP Total\n%-10u %-10u %-10u\n\n",

drivers/s390/cio/qdio_main.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,8 @@ static inline void qdio_stop_polling(struct qdio_q *q)
413413

414414
static inline void account_sbals(struct qdio_q *q, unsigned int count)
415415
{
416-
int pos;
417-
418416
q->q_stats.nr_sbal_total += count;
419-
if (count == QDIO_MAX_BUFFERS_MASK) {
420-
q->q_stats.nr_sbals[7]++;
421-
return;
422-
}
423-
pos = ilog2(count);
424-
q->q_stats.nr_sbals[pos]++;
417+
q->q_stats.nr_sbals[ilog2(count)]++;
425418
}
426419

427420
static void process_buffer_error(struct qdio_q *q, unsigned int start,

0 commit comments

Comments
 (0)