提交 0b088267 编写于 作者: H Harald Freudenberger 提交者: Martin Schwidefsky

s390/zcrypt: Fix wrong comparison leading to strange load balancing

The function to decide if one zcrypt queue is better than
another one compared two pointers instead of comparing the
values where the pointers refer to. So within the same
zcrypt card when load of each queue was equal just one queue
was used. This effect only appears on relatively lite load,
typically with one thread applications.

This patch fixes the wrong comparison and now the counters
show that requests are balanced equally over all available
queues within the cards.

There is no performance improvement coming with this fix.
As long as the queue depth for an APQN queue is not touched,
processing is not faster when requests are spread over
queues within the same card hardware. So this fix only
beautifies the lszcrypt counter printouts.
Signed-off-by: NHarald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 de35089c
...@@ -218,8 +218,8 @@ static inline bool zcrypt_queue_compare(struct zcrypt_queue *zq, ...@@ -218,8 +218,8 @@ static inline bool zcrypt_queue_compare(struct zcrypt_queue *zq,
weight += atomic_read(&zq->load); weight += atomic_read(&zq->load);
pref_weight += atomic_read(&pref_zq->load); pref_weight += atomic_read(&pref_zq->load);
if (weight == pref_weight) if (weight == pref_weight)
return &zq->queue->total_request_count > return zq->queue->total_request_count >
&pref_zq->queue->total_request_count; pref_zq->queue->total_request_count;
return weight > pref_weight; return weight > pref_weight;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册