Received: by 10.223.176.46 with SMTP id f43csp285442wra; Tue, 23 Jan 2018 21:04:23 -0800 (PST) X-Google-Smtp-Source: AH8x226vhGMFWXhrUQ1jg377zUrm4HxV+Dt4yDU4tfW4uDP51tEB4bXIZXQ4nshk1YQLqCVNu89X X-Received: by 2002:a17:902:3363:: with SMTP id a90-v6mr6844841plc.159.1516770263779; Tue, 23 Jan 2018 21:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516770263; cv=none; d=google.com; s=arc-20160816; b=nXQv8w8NpWMh+LWcf4VB6iKQrIFhrFc8fZM33W3tCLzTt7eyLzbNb/brHdbkU8igUG +0fLs2x+J0u1OsPZjr81Oj+fNGX2CrD9K7F+duaeSWHym1ENK+6pOUmIZw2ag4P6LCJ7 Pe3EBFnTkzO7JR//XVut75ZRu1pLLTdi2htSWnYZXdRc+XImhPOuSTC55Ed34d9W3Ns5 snTT648XCFS/0yGowUBznUHOYGzoFJMk7Vhx2JJPeVAI7SP0DeMgxzRl1EE6bmVBGOmV 30RN+F2UqFvVjUebi/Ay5/TVuFPgTygNqWj5rIZNgh3w6LV8GcTIDlV5vugWdLFwMsCD NwAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ofvD2WQ0yXWb5FsnPFM0sjZnhpvm/iECAK2ujZLYdm8=; b=qeGwQM0K/pz7N8oOvpPPOGwj3EMt30ucOAAmg75s8GhFMOeqiHVGfToTc3rvziTmkT 7IvCRMkUu1Yh/mehUBykLB92HirD4RWFYwKvRqB27ZkG708CkAf60uaDrVixEQqAGxPH N/Ilgjt0Qq84x+GmiKIKEs6skfDe3hGxKtTtupxPObrubdKGOzIAYp0IaNlsoxLCL6vP csFhwamKJPX2IlnehRTs/+YJL1Vtvs7VinvVYr4lNEe+iEesF3gRjhfE05p/dNZ1RjLc jWMju1cmKNqUeRv+w6UEgsKuuDMEHpsmmqqrJ7OLh8WEqLhrVFtBDPVNSD8TS4zaWDAr Ij8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ozmmCCwg; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1-v6si5585366plt.459.2018.01.23.21.04.10; Tue, 23 Jan 2018 21:04:23 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ozmmCCwg; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbeAXFDF (ORCPT + 99 others); Wed, 24 Jan 2018 00:03:05 -0500 Received: from mail-cys01nam02on0138.outbound.protection.outlook.com ([104.47.37.138]:25312 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752678AbeAXEOg (ORCPT ); Tue, 23 Jan 2018 23:14:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ofvD2WQ0yXWb5FsnPFM0sjZnhpvm/iECAK2ujZLYdm8=; b=ozmmCCwgI+8uEOwDu6yKwMGzTlB4gbo9AHnGN7dlzdFwbWzoF984UV5WhaECiPYDSSr8jCnGBcQoODxtAYDaPUM4gIM6LAqJ44MtycMhu+62LFYFgp8SOBrEy/24itQGwNpf6g4X0kotP9N4yfTwvB5TaxS/Fr2aAcfCEoPKYto= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1080.namprd21.prod.outlook.com (52.132.130.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.464.1; Wed, 24 Jan 2018 04:14:34 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7%2]) with mapi id 15.20.0464.000; Wed, 24 Jan 2018 04:14:34 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Harald Freudenberger , Martin Schwidefsky , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 024/100] s390/zcrypt: Fix wrong comparison leading to strange load balancing Thread-Topic: [PATCH AUTOSEL for 4.14 024/100] s390/zcrypt: Fix wrong comparison leading to strange load balancing Thread-Index: AQHTlMnXUerOJKD5oEeuBfoQqczEzg== Date: Wed, 24 Jan 2018 04:14:34 +0000 Message-ID: <20180124041414.32065-24-alexander.levin@microsoft.com> References: <20180124041414.32065-1-alexander.levin@microsoft.com> In-Reply-To: <20180124041414.32065-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1080;7:fiM+n92dXefsFzVKer6yAmv8oydSmR3tLUqCMbx9LZ6OatmbTS7G0vbKb6MVHzwzmzdg4AfJ+/vJoM2pz6qs3qPGWEwRw1mSNuyFkfcUJkyb6fd3x80RxRXMUjjhEWZZOCk6SXihbozpzoJs4zJrbzBDUYVVlGYcmONNXhOOSCuz/trF+w57uSLtmZRR48qaP6UPYpNs2t+vIdKyG+8OXmr0w4KGK8JbzsHc1ihGCHOiR3iE4HKz8Ydy9P1awNwB x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-correlation-id: 0b0dc8d1-3c69-4b7c-d4a7-08d562e0fa0a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603307)(7193020);SRVR:DM5PR2101MB1080; x-ms-traffictypediagnostic: DM5PR2101MB1080: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(190383065149520)(104084551191319); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231046)(2400081)(944501161)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1080;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1080; x-forefront-prvs: 056297E276 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(396003)(346002)(39860400002)(39380400002)(366004)(189003)(199004)(72206003)(110136005)(316002)(5250100002)(6346003)(2900100001)(54906003)(1076002)(6116002)(3846002)(22452003)(36756003)(53936002)(99286004)(6512007)(68736007)(2501003)(3660700001)(14454004)(3280700002)(86362001)(102836004)(7736002)(5660300001)(305945005)(575784001)(107886003)(6486002)(6506007)(2906002)(81156014)(26005)(25786009)(4326008)(81166006)(105586002)(8936002)(59450400001)(106356001)(478600001)(10290500003)(6436002)(8676002)(2950100002)(86612001)(97736004)(76176011)(10090500001)(66066001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1080;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: dpwUpeaeeG7tWhwlGAD782Tm9SZSCbmNkG5llTX2kQzzTaD1C5tF+w4rmmlv14Xzuh4BD9YiebNNHuWH9DYA1Q== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b0dc8d1-3c69-4b7c-d4a7-08d562e0fa0a X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2018 04:14:34.8562 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1080 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/s390/crypto/zcrypt_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_= api.c index b5f4006198b9..a9a56aa9c26b 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -218,8 +218,8 @@ static inline bool zcrypt_queue_compare(struct zcrypt_q= ueue *zq, weight +=3D atomic_read(&zq->load); pref_weight +=3D atomic_read(&pref_zq->load); if (weight =3D=3D 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; } =20 --=20 2.11.0