aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
diff options
context:
space:
mode:
authorUrsula Braun <braunu@de.ibm.com>2007-05-04 12:47:49 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-05-04 12:48:25 -0400
commit00c0c6466c66bdf05f2a3dcf59e6895179ea8b76 (patch)
tree6696db228238e029f523875cd78022ddd4da7002 /drivers/s390/cio
parentd4ee453bcfcc0ce76de8522e099868dc440cba23 (diff)
[S390] qdio: make qdio statistics SMP-capable
Use atomic_t/atomic64_t to make qdio performance statistics smp safe. Remove temporarily calculation of "total time of inbound actions". Signed-off-by: Ursula Braun <braunu@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/qdio.c240
-rw-r--r--drivers/s390/cio/qdio.h52
2 files changed, 174 insertions, 118 deletions
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 05fac0733f3d..cba64e4cfcd4 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -69,7 +69,6 @@ static const char version[] = "QDIO base support version 2";
69 69
70static int qdio_performance_stats = 0; 70static int qdio_performance_stats = 0;
71static int proc_perf_file_registration; 71static int proc_perf_file_registration;
72static unsigned long i_p_c, i_p_nc, o_p_c, o_p_nc, ii_p_c, ii_p_nc;
73static struct qdio_perf_stats perf_stats; 72static struct qdio_perf_stats perf_stats;
74 73
75static int hydra_thinints; 74static int hydra_thinints;
@@ -111,6 +110,31 @@ qdio_min(int a,int b)
111} 110}
112 111
113/***************** SCRUBBER HELPER ROUTINES **********************/ 112/***************** SCRUBBER HELPER ROUTINES **********************/
113#ifdef CONFIG_64BIT
114static inline void qdio_perf_stat_inc(atomic64_t *count)
115{
116 if (qdio_performance_stats)
117 atomic64_inc(count);
118}
119
120static inline void qdio_perf_stat_dec(atomic64_t *count)
121{
122 if (qdio_performance_stats)
123 atomic64_dec(count);
124}
125#else /* CONFIG_64BIT */
126static inline void qdio_perf_stat_inc(atomic_t *count)
127{
128 if (qdio_performance_stats)
129 atomic_inc(count);
130}
131
132static inline void qdio_perf_stat_dec(atomic_t *count)
133{
134 if (qdio_performance_stats)
135 atomic_dec(count);
136}
137#endif /* CONFIG_64BIT */
114 138
115static inline __u64 139static inline __u64
116qdio_get_micros(void) 140qdio_get_micros(void)
@@ -277,8 +301,7 @@ qdio_siga_sync(struct qdio_q *q, unsigned int gpr2,
277 QDIO_DBF_TEXT4(0,trace,"sigasync"); 301 QDIO_DBF_TEXT4(0,trace,"sigasync");
278 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); 302 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
279 303
280 if (qdio_performance_stats) 304 qdio_perf_stat_inc(&perf_stats.siga_syncs);
281 perf_stats.siga_syncs++;
282 305
283 cc = do_siga_sync(q->schid, gpr2, gpr3); 306 cc = do_siga_sync(q->schid, gpr2, gpr3);
284 if (cc) 307 if (cc)
@@ -323,8 +346,7 @@ qdio_siga_output(struct qdio_q *q)
323 __u32 busy_bit; 346 __u32 busy_bit;
324 __u64 start_time=0; 347 __u64 start_time=0;
325 348
326 if (qdio_performance_stats) 349 qdio_perf_stat_inc(&perf_stats.siga_outs);
327 perf_stats.siga_outs++;
328 350
329 QDIO_DBF_TEXT4(0,trace,"sigaout"); 351 QDIO_DBF_TEXT4(0,trace,"sigaout");
330 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); 352 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
@@ -358,8 +380,7 @@ qdio_siga_input(struct qdio_q *q)
358 QDIO_DBF_TEXT4(0,trace,"sigain"); 380 QDIO_DBF_TEXT4(0,trace,"sigain");
359 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); 381 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
360 382
361 if (qdio_performance_stats) 383 qdio_perf_stat_inc(&perf_stats.siga_ins);
362 perf_stats.siga_ins++;
363 384
364 cc = do_siga_input(q->schid, q->mask); 385 cc = do_siga_input(q->schid, q->mask);
365 386
@@ -953,8 +974,7 @@ __qdio_outbound_processing(struct qdio_q *q)
953 974
954 if (unlikely(qdio_reserve_q(q))) { 975 if (unlikely(qdio_reserve_q(q))) {
955 qdio_release_q(q); 976 qdio_release_q(q);
956 if (qdio_performance_stats) 977 qdio_perf_stat_inc(&perf_stats.outbound_tl_runs_resched);
957 o_p_c++;
958 /* as we're sissies, we'll check next time */ 978 /* as we're sissies, we'll check next time */
959 if (likely(!atomic_read(&q->is_in_shutdown))) { 979 if (likely(!atomic_read(&q->is_in_shutdown))) {
960 qdio_mark_q(q); 980 qdio_mark_q(q);
@@ -962,10 +982,8 @@ __qdio_outbound_processing(struct qdio_q *q)
962 } 982 }
963 return; 983 return;
964 } 984 }
965 if (qdio_performance_stats) { 985 qdio_perf_stat_inc(&perf_stats.outbound_tl_runs);
966 o_p_nc++; 986 qdio_perf_stat_inc(&perf_stats.tl_runs);
967 perf_stats.tl_runs++;
968 }
969 987
970 /* see comment in qdio_kick_outbound_q */ 988 /* see comment in qdio_kick_outbound_q */
971 siga_attempts=atomic_read(&q->busy_siga_counter); 989 siga_attempts=atomic_read(&q->busy_siga_counter);
@@ -1139,17 +1157,6 @@ qdio_has_inbound_q_moved(struct qdio_q *q)
1139{ 1157{
1140 int i; 1158 int i;
1141 1159
1142 static int old_pcis=0;
1143 static int old_thinints=0;
1144
1145 if (qdio_performance_stats) {
1146 if ((old_pcis==perf_stats.pcis)&&
1147 (old_thinints==perf_stats.thinints))
1148 perf_stats.start_time_inbound=NOW;
1149 else
1150 old_pcis=perf_stats.pcis;
1151 }
1152
1153 i=qdio_get_inbound_buffer_frontier(q); 1160 i=qdio_get_inbound_buffer_frontier(q);
1154 if ( (i!=GET_SAVED_FRONTIER(q)) || 1161 if ( (i!=GET_SAVED_FRONTIER(q)) ||
1155 (q->error_status_flags&QDIO_STATUS_LOOK_FOR_ERROR) ) { 1162 (q->error_status_flags&QDIO_STATUS_LOOK_FOR_ERROR) ) {
@@ -1337,10 +1344,7 @@ qdio_kick_inbound_handler(struct qdio_q *q)
1337 q->siga_error=0; 1344 q->siga_error=0;
1338 q->error_status_flags=0; 1345 q->error_status_flags=0;
1339 1346
1340 if (qdio_performance_stats) { 1347 qdio_perf_stat_inc(&perf_stats.inbound_cnt);
1341 perf_stats.inbound_time+=NOW-perf_stats.start_time_inbound;
1342 perf_stats.inbound_cnt++;
1343 }
1344} 1348}
1345 1349
1346static void 1350static void
@@ -1360,8 +1364,7 @@ __tiqdio_inbound_processing(struct qdio_q *q, int spare_ind_was_set)
1360 */ 1364 */
1361 if (unlikely(qdio_reserve_q(q))) { 1365 if (unlikely(qdio_reserve_q(q))) {
1362 qdio_release_q(q); 1366 qdio_release_q(q);
1363 if (qdio_performance_stats) 1367 qdio_perf_stat_inc(&perf_stats.inbound_thin_tl_runs_resched);
1364 ii_p_c++;
1365 /* 1368 /*
1366 * as we might just be about to stop polling, we make 1369 * as we might just be about to stop polling, we make
1367 * sure that we check again at least once more 1370 * sure that we check again at least once more
@@ -1369,8 +1372,7 @@ __tiqdio_inbound_processing(struct qdio_q *q, int spare_ind_was_set)
1369 tiqdio_sched_tl(); 1372 tiqdio_sched_tl();
1370 return; 1373 return;
1371 } 1374 }
1372 if (qdio_performance_stats) 1375 qdio_perf_stat_inc(&perf_stats.inbound_thin_tl_runs);
1373 ii_p_nc++;
1374 if (unlikely(atomic_read(&q->is_in_shutdown))) { 1376 if (unlikely(atomic_read(&q->is_in_shutdown))) {
1375 qdio_unmark_q(q); 1377 qdio_unmark_q(q);
1376 goto out; 1378 goto out;
@@ -1412,8 +1414,7 @@ __tiqdio_inbound_processing(struct qdio_q *q, int spare_ind_was_set)
1412 for (i=0;i<irq_ptr->no_output_qs;i++) { 1414 for (i=0;i<irq_ptr->no_output_qs;i++) {
1413 oq = irq_ptr->output_qs[i]; 1415 oq = irq_ptr->output_qs[i];
1414 if (!qdio_is_outbound_q_done(oq)) { 1416 if (!qdio_is_outbound_q_done(oq)) {
1415 if (qdio_performance_stats) 1417 qdio_perf_stat_dec(&perf_stats.tl_runs);
1416 perf_stats.tl_runs--;
1417 __qdio_outbound_processing(oq); 1418 __qdio_outbound_processing(oq);
1418 } 1419 }
1419 } 1420 }
@@ -1452,8 +1453,7 @@ __qdio_inbound_processing(struct qdio_q *q)
1452 1453
1453 if (unlikely(qdio_reserve_q(q))) { 1454 if (unlikely(qdio_reserve_q(q))) {
1454 qdio_release_q(q); 1455 qdio_release_q(q);
1455 if (qdio_performance_stats) 1456 qdio_perf_stat_inc(&perf_stats.inbound_tl_runs_resched);
1456 i_p_c++;
1457 /* as we're sissies, we'll check next time */ 1457 /* as we're sissies, we'll check next time */
1458 if (likely(!atomic_read(&q->is_in_shutdown))) { 1458 if (likely(!atomic_read(&q->is_in_shutdown))) {
1459 qdio_mark_q(q); 1459 qdio_mark_q(q);
@@ -1461,10 +1461,8 @@ __qdio_inbound_processing(struct qdio_q *q)
1461 } 1461 }
1462 return; 1462 return;
1463 } 1463 }
1464 if (qdio_performance_stats) { 1464 qdio_perf_stat_inc(&perf_stats.inbound_tl_runs);
1465 i_p_nc++; 1465 qdio_perf_stat_inc(&perf_stats.tl_runs);
1466 perf_stats.tl_runs++;
1467 }
1468 1466
1469again: 1467again:
1470 if (qdio_has_inbound_q_moved(q)) { 1468 if (qdio_has_inbound_q_moved(q)) {
@@ -1510,8 +1508,7 @@ tiqdio_reset_processing_state(struct qdio_q *q, int q_laps)
1510 1508
1511 if (unlikely(qdio_reserve_q(q))) { 1509 if (unlikely(qdio_reserve_q(q))) {
1512 qdio_release_q(q); 1510 qdio_release_q(q);
1513 if (qdio_performance_stats) 1511 qdio_perf_stat_inc(&perf_stats.inbound_thin_tl_runs_resched);
1514 ii_p_c++;
1515 /* 1512 /*
1516 * as we might just be about to stop polling, we make 1513 * as we might just be about to stop polling, we make
1517 * sure that we check again at least once more 1514 * sure that we check again at least once more
@@ -1602,8 +1599,7 @@ tiqdio_tl(unsigned long data)
1602{ 1599{
1603 QDIO_DBF_TEXT4(0,trace,"iqdio_tl"); 1600 QDIO_DBF_TEXT4(0,trace,"iqdio_tl");
1604 1601
1605 if (qdio_performance_stats) 1602 qdio_perf_stat_inc(&perf_stats.tl_runs);
1606 perf_stats.tl_runs++;
1607 1603
1608 tiqdio_inbound_checks(); 1604 tiqdio_inbound_checks();
1609} 1605}
@@ -1914,10 +1910,7 @@ tiqdio_thinint_handler(void)
1914{ 1910{
1915 QDIO_DBF_TEXT4(0,trace,"thin_int"); 1911 QDIO_DBF_TEXT4(0,trace,"thin_int");
1916 1912
1917 if (qdio_performance_stats) { 1913 qdio_perf_stat_inc(&perf_stats.thinints);
1918 perf_stats.thinints++;
1919 perf_stats.start_time_inbound=NOW;
1920 }
1921 1914
1922 /* SVS only when needed: 1915 /* SVS only when needed:
1923 * issue SVS to benefit from iqdio interrupt avoidance 1916 * issue SVS to benefit from iqdio interrupt avoidance
@@ -1972,17 +1965,12 @@ qdio_handle_pci(struct qdio_irq *irq_ptr)
1972 int i; 1965 int i;
1973 struct qdio_q *q; 1966 struct qdio_q *q;
1974 1967
1975 if (qdio_performance_stats) { 1968 qdio_perf_stat_inc(&perf_stats.pcis);
1976 perf_stats.pcis++;
1977 perf_stats.start_time_inbound=NOW;
1978 }
1979 for (i=0;i<irq_ptr->no_input_qs;i++) { 1969 for (i=0;i<irq_ptr->no_input_qs;i++) {
1980 q=irq_ptr->input_qs[i]; 1970 q=irq_ptr->input_qs[i];
1981 if (q->is_input_q&QDIO_FLAG_NO_INPUT_INTERRUPT_CONTEXT) 1971 if (q->is_input_q&QDIO_FLAG_NO_INPUT_INTERRUPT_CONTEXT)
1982 qdio_mark_q(q); 1972 qdio_mark_q(q);
1983 else { 1973 else {
1984 if (qdio_performance_stats)
1985 perf_stats.tl_runs--;
1986 __qdio_inbound_processing(q); 1974 __qdio_inbound_processing(q);
1987 } 1975 }
1988 } 1976 }
@@ -1992,8 +1980,7 @@ qdio_handle_pci(struct qdio_irq *irq_ptr)
1992 q=irq_ptr->output_qs[i]; 1980 q=irq_ptr->output_qs[i];
1993 if (qdio_is_outbound_q_done(q)) 1981 if (qdio_is_outbound_q_done(q))
1994 continue; 1982 continue;
1995 if (qdio_performance_stats) 1983 qdio_perf_stat_dec(&perf_stats.tl_runs);
1996 perf_stats.tl_runs--;
1997 if (!irq_ptr->sync_done_on_outb_pcis) 1984 if (!irq_ptr->sync_done_on_outb_pcis)
1998 SYNC_MEMORY; 1985 SYNC_MEMORY;
1999 __qdio_outbound_processing(q); 1986 __qdio_outbound_processing(q);
@@ -3463,18 +3450,12 @@ do_qdio_handle_outbound(struct qdio_q *q, unsigned int callflags,
3463 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; 3450 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr;
3464 3451
3465 /* This is the outbound handling of queues */ 3452 /* This is the outbound handling of queues */
3466 if (qdio_performance_stats)
3467 perf_stats.start_time_outbound=NOW;
3468
3469 qdio_do_qdio_fill_output(q,qidx,count,buffers); 3453 qdio_do_qdio_fill_output(q,qidx,count,buffers);
3470 3454
3471 used_elements=atomic_add_return(count, &q->number_of_buffers_used) - count; 3455 used_elements=atomic_add_return(count, &q->number_of_buffers_used) - count;
3472 3456
3473 if (callflags&QDIO_FLAG_DONT_SIGA) { 3457 if (callflags&QDIO_FLAG_DONT_SIGA) {
3474 if (qdio_performance_stats) { 3458 qdio_perf_stat_inc(&perf_stats.outbound_cnt);
3475 perf_stats.outbound_time+=NOW-perf_stats.start_time_outbound;
3476 perf_stats.outbound_cnt++;
3477 }
3478 return; 3459 return;
3479 } 3460 }
3480 if (q->is_iqdio_q) { 3461 if (q->is_iqdio_q) {
@@ -3504,8 +3485,7 @@ do_qdio_handle_outbound(struct qdio_q *q, unsigned int callflags,
3504 qdio_kick_outbound_q(q); 3485 qdio_kick_outbound_q(q);
3505 } else { 3486 } else {
3506 QDIO_DBF_TEXT3(0,trace, "fast-req"); 3487 QDIO_DBF_TEXT3(0,trace, "fast-req");
3507 if (qdio_performance_stats) 3488 qdio_perf_stat_inc(&perf_stats.fast_reqs);
3508 perf_stats.fast_reqs++;
3509 } 3489 }
3510 } 3490 }
3511 /* 3491 /*
@@ -3516,10 +3496,7 @@ do_qdio_handle_outbound(struct qdio_q *q, unsigned int callflags,
3516 __qdio_outbound_processing(q); 3496 __qdio_outbound_processing(q);
3517 } 3497 }
3518 3498
3519 if (qdio_performance_stats) { 3499 qdio_perf_stat_inc(&perf_stats.outbound_cnt);
3520 perf_stats.outbound_time+=NOW-perf_stats.start_time_outbound;
3521 perf_stats.outbound_cnt++;
3522 }
3523} 3500}
3524 3501
3525/* count must be 1 in iqdio */ 3502/* count must be 1 in iqdio */
@@ -3589,33 +3566,67 @@ qdio_perf_procfile_read(char *buffer, char **buffer_location, off_t offset,
3589 return 0; 3566 return 0;
3590 3567
3591#define _OUTP_IT(x...) c+=sprintf(buffer+c,x) 3568#define _OUTP_IT(x...) c+=sprintf(buffer+c,x)
3592 _OUTP_IT("i_p_nc/c=%lu/%lu\n",i_p_nc,i_p_c); 3569#ifdef CONFIG_64BIT
3593 _OUTP_IT("ii_p_nc/c=%lu/%lu\n",ii_p_nc,ii_p_c); 3570 _OUTP_IT("Number of tasklet runs (total) : %li\n",
3594 _OUTP_IT("o_p_nc/c=%lu/%lu\n",o_p_nc,o_p_c); 3571 (long)atomic64_read(&perf_stats.tl_runs));
3595 _OUTP_IT("Number of tasklet runs (total) : %lu\n", 3572 _OUTP_IT("Inbound tasklet runs tried/retried : %li/%li\n",
3596 perf_stats.tl_runs); 3573 (long)atomic64_read(&perf_stats.inbound_tl_runs),
3574 (long)atomic64_read(&perf_stats.inbound_tl_runs_resched));
3575 _OUTP_IT("Inbound-thin tasklet runs tried/retried : %li/%li\n",
3576 (long)atomic64_read(&perf_stats.inbound_thin_tl_runs),
3577 (long)atomic64_read(&perf_stats.inbound_thin_tl_runs_resched));
3578 _OUTP_IT("Outbound tasklet runs tried/retried : %li/%li\n",
3579 (long)atomic64_read(&perf_stats.outbound_tl_runs),
3580 (long)atomic64_read(&perf_stats.outbound_tl_runs_resched));
3597 _OUTP_IT("\n"); 3581 _OUTP_IT("\n");
3598 _OUTP_IT("Number of SIGA sync's issued : %lu\n", 3582 _OUTP_IT("Number of SIGA sync's issued : %li\n",
3599 perf_stats.siga_syncs); 3583 (long)atomic64_read(&perf_stats.siga_syncs));
3600 _OUTP_IT("Number of SIGA in's issued : %lu\n", 3584 _OUTP_IT("Number of SIGA in's issued : %li\n",
3601 perf_stats.siga_ins); 3585 (long)atomic64_read(&perf_stats.siga_ins));
3602 _OUTP_IT("Number of SIGA out's issued : %lu\n", 3586 _OUTP_IT("Number of SIGA out's issued : %li\n",
3603 perf_stats.siga_outs); 3587 (long)atomic64_read(&perf_stats.siga_outs));
3604 _OUTP_IT("Number of PCIs caught : %lu\n", 3588 _OUTP_IT("Number of PCIs caught : %li\n",
3605 perf_stats.pcis); 3589 (long)atomic64_read(&perf_stats.pcis));
3606 _OUTP_IT("Number of adapter interrupts caught : %lu\n", 3590 _OUTP_IT("Number of adapter interrupts caught : %li\n",
3607 perf_stats.thinints); 3591 (long)atomic64_read(&perf_stats.thinints));
3608 _OUTP_IT("Number of fast requeues (outg. SBALs w/o SIGA) : %lu\n", 3592 _OUTP_IT("Number of fast requeues (outg. SBALs w/o SIGA) : %li\n",
3609 perf_stats.fast_reqs); 3593 (long)atomic64_read(&perf_stats.fast_reqs));
3610 _OUTP_IT("\n"); 3594 _OUTP_IT("\n");
3611 _OUTP_IT("Total time of all inbound actions (us) incl. UL : %lu\n", 3595 _OUTP_IT("Number of inbound transfers : %li\n",
3612 perf_stats.inbound_time); 3596 (long)atomic64_read(&perf_stats.inbound_cnt));
3613 _OUTP_IT("Number of inbound transfers : %lu\n", 3597 _OUTP_IT("Number of do_QDIOs outbound : %li\n",
3614 perf_stats.inbound_cnt); 3598 (long)atomic64_read(&perf_stats.outbound_cnt));
3615 _OUTP_IT("Total time of all outbound do_QDIOs (us) : %lu\n", 3599#else /* CONFIG_64BIT */
3616 perf_stats.outbound_time); 3600 _OUTP_IT("Number of tasklet runs (total) : %i\n",
3617 _OUTP_IT("Number of do_QDIOs outbound : %lu\n", 3601 atomic_read(&perf_stats.tl_runs));
3618 perf_stats.outbound_cnt); 3602 _OUTP_IT("Inbound tasklet runs tried/retried : %i/%i\n",
3603 atomic_read(&perf_stats.inbound_tl_runs),
3604 atomic_read(&perf_stats.inbound_tl_runs_resched));
3605 _OUTP_IT("Inbound-thin tasklet runs tried/retried : %i/%i\n",
3606 atomic_read(&perf_stats.inbound_thin_tl_runs),
3607 atomic_read(&perf_stats.inbound_thin_tl_runs_resched));
3608 _OUTP_IT("Outbound tasklet runs tried/retried : %i/%i\n",
3609 atomic_read(&perf_stats.outbound_tl_runs),
3610 atomic_read(&perf_stats.outbound_tl_runs_resched));
3611 _OUTP_IT("\n");
3612 _OUTP_IT("Number of SIGA sync's issued : %i\n",
3613 atomic_read(&perf_stats.siga_syncs));
3614 _OUTP_IT("Number of SIGA in's issued : %i\n",
3615 atomic_read(&perf_stats.siga_ins));
3616 _OUTP_IT("Number of SIGA out's issued : %i\n",
3617 atomic_read(&perf_stats.siga_outs));
3618 _OUTP_IT("Number of PCIs caught : %i\n",
3619 atomic_read(&perf_stats.pcis));
3620 _OUTP_IT("Number of adapter interrupts caught : %i\n",
3621 atomic_read(&perf_stats.thinints));
3622 _OUTP_IT("Number of fast requeues (outg. SBALs w/o SIGA) : %i\n",
3623 atomic_read(&perf_stats.fast_reqs));
3624 _OUTP_IT("\n");
3625 _OUTP_IT("Number of inbound transfers : %i\n",
3626 atomic_read(&perf_stats.inbound_cnt));
3627 _OUTP_IT("Number of do_QDIOs outbound : %i\n",
3628 atomic_read(&perf_stats.outbound_cnt));
3629#endif /* CONFIG_64BIT */
3619 _OUTP_IT("\n"); 3630 _OUTP_IT("\n");
3620 3631
3621 return c; 3632 return c;
@@ -3642,8 +3653,6 @@ qdio_add_procfs_entry(void)
3642static void 3653static void
3643qdio_remove_procfs_entry(void) 3654qdio_remove_procfs_entry(void)
3644{ 3655{
3645 perf_stats.tl_runs=0;
3646
3647 if (!proc_perf_file_registration) /* means if it went ok earlier */ 3656 if (!proc_perf_file_registration) /* means if it went ok earlier */
3648 remove_proc_entry(QDIO_PERF,&proc_root); 3657 remove_proc_entry(QDIO_PERF,&proc_root);
3649} 3658}
@@ -3671,13 +3680,38 @@ qdio_performance_stats_store(struct bus_type *bus, const char *buf, size_t count
3671 qdio_performance_stats = i; 3680 qdio_performance_stats = i;
3672 if (i==0) { 3681 if (i==0) {
3673 /* reset perf. stat. info */ 3682 /* reset perf. stat. info */
3674 i_p_nc = 0; 3683#ifdef CONFIG_64BIT
3675 i_p_c = 0; 3684 atomic64_set(&perf_stats.tl_runs, 0);
3676 ii_p_nc = 0; 3685 atomic64_set(&perf_stats.outbound_tl_runs, 0);
3677 ii_p_c = 0; 3686 atomic64_set(&perf_stats.inbound_tl_runs, 0);
3678 o_p_nc = 0; 3687 atomic64_set(&perf_stats.inbound_tl_runs_resched, 0);
3679 o_p_c = 0; 3688 atomic64_set(&perf_stats.inbound_thin_tl_runs, 0);
3680 memset(&perf_stats, 0, sizeof(struct qdio_perf_stats)); 3689 atomic64_set(&perf_stats.inbound_thin_tl_runs_resched,
3690 0);
3691 atomic64_set(&perf_stats.siga_outs, 0);
3692 atomic64_set(&perf_stats.siga_ins, 0);
3693 atomic64_set(&perf_stats.siga_syncs, 0);
3694 atomic64_set(&perf_stats.pcis, 0);
3695 atomic64_set(&perf_stats.thinints, 0);
3696 atomic64_set(&perf_stats.fast_reqs, 0);
3697 atomic64_set(&perf_stats.outbound_cnt, 0);
3698 atomic64_set(&perf_stats.inbound_cnt, 0);
3699#else /* CONFIG_64BIT */
3700 atomic_set(&perf_stats.tl_runs, 0);
3701 atomic_set(&perf_stats.outbound_tl_runs, 0);
3702 atomic_set(&perf_stats.inbound_tl_runs, 0);
3703 atomic_set(&perf_stats.inbound_tl_runs_resched, 0);
3704 atomic_set(&perf_stats.inbound_thin_tl_runs, 0);
3705 atomic_set(&perf_stats.inbound_thin_tl_runs_resched, 0);
3706 atomic_set(&perf_stats.siga_outs, 0);
3707 atomic_set(&perf_stats.siga_ins, 0);
3708 atomic_set(&perf_stats.siga_syncs, 0);
3709 atomic_set(&perf_stats.pcis, 0);
3710 atomic_set(&perf_stats.thinints, 0);
3711 atomic_set(&perf_stats.fast_reqs, 0);
3712 atomic_set(&perf_stats.outbound_cnt, 0);
3713 atomic_set(&perf_stats.inbound_cnt, 0);
3714#endif /* CONFIG_64BIT */
3681 } 3715 }
3682 } else { 3716 } else {
3683 QDIO_PRINT_WARN("QDIO performance_stats: write 0 or 1 to this file!\n"); 3717 QDIO_PRINT_WARN("QDIO performance_stats: write 0 or 1 to this file!\n");
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index ec9af72b2afc..2895392eaae4 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -406,21 +406,43 @@ do_clear_global_summary(void)
406#define CHSC_FLAG_SIGA_SYNC_DONE_ON_OUTB_PCIS 0x04 406#define CHSC_FLAG_SIGA_SYNC_DONE_ON_OUTB_PCIS 0x04
407 407
408struct qdio_perf_stats { 408struct qdio_perf_stats {
409 unsigned long tl_runs; 409#ifdef CONFIG_64BIT
410 410 atomic64_t tl_runs;
411 unsigned long siga_outs; 411 atomic64_t outbound_tl_runs;
412 unsigned long siga_ins; 412 atomic64_t outbound_tl_runs_resched;
413 unsigned long siga_syncs; 413 atomic64_t inbound_tl_runs;
414 unsigned long pcis; 414 atomic64_t inbound_tl_runs_resched;
415 unsigned long thinints; 415 atomic64_t inbound_thin_tl_runs;
416 unsigned long fast_reqs; 416 atomic64_t inbound_thin_tl_runs_resched;
417 417
418 __u64 start_time_outbound; 418 atomic64_t siga_outs;
419 unsigned long outbound_cnt; 419 atomic64_t siga_ins;
420 unsigned long outbound_time; 420 atomic64_t siga_syncs;
421 __u64 start_time_inbound; 421 atomic64_t pcis;
422 unsigned long inbound_cnt; 422 atomic64_t thinints;
423 unsigned long inbound_time; 423 atomic64_t fast_reqs;
424
425 atomic64_t outbound_cnt;
426 atomic64_t inbound_cnt;
427#else /* CONFIG_64BIT */
428 atomic_t tl_runs;
429 atomic_t outbound_tl_runs;
430 atomic_t outbound_tl_runs_resched;
431 atomic_t inbound_tl_runs;
432 atomic_t inbound_tl_runs_resched;
433 atomic_t inbound_thin_tl_runs;
434 atomic_t inbound_thin_tl_runs_resched;
435
436 atomic_t siga_outs;
437 atomic_t siga_ins;
438 atomic_t siga_syncs;
439 atomic_t pcis;
440 atomic_t thinints;
441 atomic_t fast_reqs;
442
443 atomic_t outbound_cnt;
444 atomic_t inbound_cnt;
445#endif /* CONFIG_64BIT */
424}; 446};
425 447
426/* unlikely as the later the better */ 448/* unlikely as the later the better */