Received: by 10.223.176.5 with SMTP id f5csp1012605wra; Fri, 2 Feb 2018 09:41:32 -0800 (PST) X-Google-Smtp-Source: AH8x226j64BF2jMaeS9Z0fpFyiN+9bruIZtucuP2RE/nw9IiOcPDRs7RW/wqwMsWVkVtcsI6szxR X-Received: by 2002:a17:902:6d09:: with SMTP id s9-v6mr36185598plk.176.1517593292887; Fri, 02 Feb 2018 09:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517593292; cv=none; d=google.com; s=arc-20160816; b=aVNmlXH0dyHR+//KvLuWIpyCet907rKX99Hrm8SETIlYk0CvszsZ/r5GXt27TYzpj5 G+GvbFOrVgbNa/AsgMPUYmtOQELbMSmrku7fRemQh9BjDdPIoLgODU2rezqnrLGw6Dy+ IF7MAb+0FnKKIlMGSpCUsQXLFf1A7BQv1ZimAwGv3z9BK3FOIPCqAw6dXgwAGYGOsdTm ovrpzvnkdUWZZHj68C5zku2OiDkbGkLZ5K5id3FzWqE90EoPPt0eHVUN6gm0o36aYjlN KBMYHLFoqxk1nCTvjy2Blivuyddbd6uA4Zi9HqYQ5JkdgCPwPUFNwa5DPco9FhdtqiJd jRmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=cTVkBUdUQGziARIu+eHk6/Gh184WKcVI00U8KAnwJXQ=; b=TfOZt3jSSy3G6fHI4laH2NR4zUwZfmnJjMgoxsEpeSyYwZJ6IYy3Pgu6BwkZv6k+G4 gOm+U6Aq7eeIKVIa3eaFjT03bcjRB9HVBRuflGQoiJxEGLb/bO1UylPrQ5L1nhXqzQna ArrcDvT2Ue3yqXpY4B/PrTdd0kFEbMgqJDTCtdqKSEOyccYA5426g45dsky7Y5Al/xPB 4LcWhZ2/DPKl8HA3NvxZInUtZqN+0+O8z++KQ3hd75sKqK0pYNQobwYDG0/eoi4mNAVh yhU/5hv9dJ9n1Z5DsG72egHuPMK/x0ho7tZveI+8RUE6i3QX7btgDxiI6SykdWdlzkHB Bjxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185si197066pge.131.2018.02.02.09.41.16; Fri, 02 Feb 2018 09:41:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753750AbeBBRPh (ORCPT + 99 others); Fri, 2 Feb 2018 12:15:37 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37910 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753074AbeBBRJW (ORCPT ); Fri, 2 Feb 2018 12:09:22 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 83A01E27; Fri, 2 Feb 2018 17:09:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harald Freudenberger , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.14 053/156] s390/zcrypt: Fix wrong comparison leading to strange load balancing Date: Fri, 2 Feb 2018 17:57:14 +0100 Message-Id: <20180202140842.670298822@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Harald Freudenberger [ Upstream commit 0b0882672640ced4deeebf84da0b88b6389619c4 ] 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: Harald Freudenberger Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/s390/crypto/zcrypt_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -218,8 +218,8 @@ static inline bool zcrypt_queue_compare( weight += atomic_read(&zq->load); pref_weight += atomic_read(&pref_zq->load); if (weight == pref_weight) - return &zq->queue->total_request_count > - &pref_zq->queue->total_request_count; + return zq->queue->total_request_count > + pref_zq->queue->total_request_count; return weight > pref_weight; }