aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/ap_card.c
diff options
context:
space:
mode:
authorIngo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>2016-10-14 14:34:51 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-12-14 16:33:39 +0100
commite47de21dd35bad6d1e71482a66699cd04e83ea40 (patch)
tree1089dd285e8cde50690b546db76285efa198b8cc /drivers/s390/crypto/ap_card.c
parents390/zcrypt: Introduce new zcrypt device status API (diff)
downloadlinux-dev-e47de21dd35bad6d1e71482a66699cd04e83ea40.tar.xz
linux-dev-e47de21dd35bad6d1e71482a66699cd04e83ea40.zip
s390/zcrypt: Fixed attrition of AP adapters and domains
Currently the first eligible AP adapter respectively domain will be selected to service requests. In case of sequential workload, the very same adapter/domain will be used. The adapter/domain selection algorithm now considers the completed transactions per adaper/domain and therefore ensures a homogeneous utilization. Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_card.c')
-rw-r--r--drivers/s390/crypto/ap_card.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c
index 731dc0dbfb75..0110d44172a3 100644
--- a/drivers/s390/crypto/ap_card.c
+++ b/drivers/s390/crypto/ap_card.c
@@ -63,13 +63,11 @@ static ssize_t ap_request_count_show(struct device *dev,
char *buf)
{
struct ap_card *ac = to_ap_card(dev);
- struct ap_queue *aq;
unsigned int req_cnt;
req_cnt = 0;
spin_lock_bh(&ap_list_lock);
- for_each_ap_queue(aq, ac)
- req_cnt += aq->total_request_count;
+ req_cnt = atomic_read(&ac->total_request_count);
spin_unlock_bh(&ap_list_lock);
return snprintf(buf, PAGE_SIZE, "%d\n", req_cnt);
}