]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.arch/s390-08-08-add_qdio_utilization.patch
Move xen patchset to new version's subdir.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.arch / s390-08-08-add_qdio_utilization.patch
1 From: Gerald Schaefer <geraldsc@de.ibm.com>
2 Subject: zfcp: queue_full is lacking the entry for qdio utilization
3 References: bnc#466462
4
5 Symptom: ziomon fails with an error message indicating an outdated kernel
6 Problem: queue_full is missing an additional entry that gives the
7 qdio utilization. Without this entry, the scsi performance
8 dara collection feature does not work at all.
9 Solution: Add the missing attribute to queue_full.
10
11 Acked-by: John Jolly <jjolly@suse.de>
12
13 ---
14
15 drivers/s390/scsi/zfcp_aux.c | 1 +
16 drivers/s390/scsi/zfcp_def.h | 3 +++
17 drivers/s390/scsi/zfcp_qdio.c | 20 ++++++++++++++++++++
18 drivers/s390/scsi/zfcp_sysfs.c | 3 ++-
19 4 files changed, 26 insertions(+), 1 deletion(-)
20
21 --- a/drivers/s390/scsi/zfcp_aux.c
22 +++ b/drivers/s390/scsi/zfcp_aux.c
23 @@ -500,6 +500,7 @@ int zfcp_adapter_enqueue(struct ccw_devi
24 spin_lock_init(&adapter->scsi_dbf_lock);
25 spin_lock_init(&adapter->rec_dbf_lock);
26 spin_lock_init(&adapter->req_q_lock);
27 + spin_lock_init(&adapter->qdio_stat_lock);
28
29 rwlock_init(&adapter->erp_lock);
30 rwlock_init(&adapter->abort_lock);
31 --- a/drivers/s390/scsi/zfcp_def.h
32 +++ b/drivers/s390/scsi/zfcp_def.h
33 @@ -472,6 +472,9 @@ struct zfcp_adapter {
34 spinlock_t req_q_lock; /* for operations on queue */
35 int req_q_pci_batch; /* SBALs since PCI indication
36 was last set */
37 + ktime_t req_q_time; /* time of last fill level change */
38 + u64 req_q_util; /* for accounting */
39 + spinlock_t qdio_stat_lock;
40 u32 fsf_req_seq_no; /* FSF cmnd seq number */
41 wait_queue_head_t request_wq; /* can be used to wait for
42 more avaliable SBALs */
43 --- a/drivers/s390/scsi/zfcp_qdio.c
44 +++ b/drivers/s390/scsi/zfcp_qdio.c
45 @@ -76,6 +76,23 @@ static void zfcp_qdio_zero_sbals(struct
46 }
47 }
48
49 +/* this needs to be called prior to updating the queue fill level */
50 +static void zfcp_qdio_account(struct zfcp_adapter *adapter)
51 +{
52 + ktime_t now;
53 + s64 span;
54 + int free, used;
55 +
56 + spin_lock(&adapter->qdio_stat_lock);
57 + now = ktime_get();
58 + span = ktime_us_delta(now, adapter->req_q_time);
59 + free = max(0, atomic_read(&adapter->req_q.count));
60 + used = QDIO_MAX_BUFFERS_PER_Q - free;
61 + adapter->req_q_util += used * span;
62 + adapter->req_q_time = now;
63 + spin_unlock(&adapter->qdio_stat_lock);
64 +}
65 +
66 static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int qdio_err,
67 int queue_no, int first, int count,
68 unsigned long parm)
69 @@ -92,6 +109,7 @@ static void zfcp_qdio_int_req(struct ccw
70 /* cleanup all SBALs being program-owned now */
71 zfcp_qdio_zero_sbals(queue->sbal, first, count);
72
73 + zfcp_qdio_account(adapter);
74 atomic_add(count, &queue->count);
75 wake_up(&adapter->request_wq);
76 }
77 @@ -358,6 +376,8 @@ int zfcp_qdio_send(struct zfcp_fsf_req *
78 sbale->flags |= SBAL_FLAGS0_PCI;
79 }
80
81 + zfcp_qdio_account(adapter);
82 +
83 retval = do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_OUTPUT, 0, first,
84 count);
85 if (unlikely(retval)) {
86 --- a/drivers/s390/scsi/zfcp_sysfs.c
87 +++ b/drivers/s390/scsi/zfcp_sysfs.c
88 @@ -486,7 +486,8 @@ static ssize_t zfcp_sysfs_adapter_q_full
89 struct zfcp_adapter *adapter =
90 (struct zfcp_adapter *) scsi_host->hostdata[0];
91
92 - return sprintf(buf, "%d\n", atomic_read(&adapter->qdio_outb_full));
93 + return sprintf(buf, "%d %llu\n", atomic_read(&adapter->qdio_outb_full),
94 + (unsigned long long)adapter->req_q_util);
95 }
96 static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL);
97