Received: by 10.192.165.148 with SMTP id m20csp251112imm; Thu, 19 Apr 2018 20:57:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx48C69Xwo27SQI3jFpsRHpfOAN2+yApQScQpJ+87WbhyEg1SoYgefNfgsR8xnLMWuBJXqb2j X-Received: by 2002:a17:902:8a81:: with SMTP id p1-v6mr8881018plo.183.1524196645327; Thu, 19 Apr 2018 20:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524196645; cv=none; d=google.com; s=arc-20160816; b=Im0AvsiVSwq7POAX/njboB6Zt+P94cTBpHnghKxwjUqeM5Uf8Sn1IP/F+0PUTsfuLr d/eD4VrgQIt8PsqTzcVx29GlYOE/aC/5D8W/rpKy0tNGrpAZhHz6yMj1iuPOBykdjgqW cu95eHr2XMmEKynVjkSpTRLWnYPlQrrdNuv+g0+xtQhF9oT9sM+HTfCgI7Ny9x0SnLLU nGGt3hxYqx3WRteAXOqCZkWjyApuBkgdUROs4QAHGD0AlpvvqjjTWeyZvcryHJdDIACL tB9m0hobHC13KigWJWztKqsIY7tgTyGWk0sL/p2y87qF+zQlwBCrs2KaQrskf2/zXhCj vMSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:references :in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=qh5d+gJ03uvv/iRSUlKou7b/JWQ3HkclWU4vX+mIDyg=; b=Zw8bljoVi9M3BHOjHAVDXeHc1Uizz751XJDiUzFSm5JT/EUAYhX70YHQZEd/er+frr 9kaESUn9FxZGeSgEmaYV7n1BOUMnKQ0QofyAFdQurlx++e3eMsqyYAC0PD5iK3m4HZoj kekczgCrV8gFosbQz3S+5Lrwx9gvS0/3XmXNAm2l0sYovxhwhgbq+sx34WMb1z97W1yV kzaknCtCmmB9XTOs4sR9w9VWtC1N9Cw3xC/9CJx2d/NWTf0Q3k767Vea97IKTHtKSdG6 HpbVw0xEgvp5dTQ1aKxmJApe7D+Qj6v1fZhA8lmGVQ8VHRQa3lfxL/OfR6oU1QipfnaJ +B8Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 206si4443707pfy.4.2018.04.19.20.57.10; Thu, 19 Apr 2018 20:57:25 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754256AbeDTD4C (ORCPT + 99 others); Thu, 19 Apr 2018 23:56:02 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44406 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754169AbeDTD4B (ORCPT ); Thu, 19 Apr 2018 23:56:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD1844074CAC; Fri, 20 Apr 2018 03:56:00 +0000 (UTC) Received: from haswell-e.nc.xsintricity.com (ovpn-122-18.rdu2.redhat.com [10.10.122.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89FC92026E04; Fri, 20 Apr 2018 03:56:00 +0000 (UTC) Message-ID: <1524196555.11756.30.camel@redhat.com> Subject: Re: [PATCH] IB/core: Make ib_mad_client_id atomic From: Doug Ledford To: =?ISO-8859-1?Q?H=E5kon?= Bugge , Don Hiatt , Dasaratharaman Chandramouli , Ira Weiny , Sean Hefty Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 19 Apr 2018 23:55:55 -0400 In-Reply-To: <20180418142450.15581-1-Haakon.Bugge@oracle.com> References: <20180418142450.15581-1-Haakon.Bugge@oracle.com> Organization: Red Hat, Inc. Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-PLg0GUGohGjeHX9p8SOq" Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 20 Apr 2018 03:56:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 20 Apr 2018 03:56:00 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dledford@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-PLg0GUGohGjeHX9p8SOq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2018-04-18 at 16:24 +0200, H=C3=A5kon Bugge wrote: > Two kernel threads may get the same value for agent.hi_tid, if the > agents are registered for different ports. As of now, this works, as > the agent list is per port. >=20 > It is however confusing and not future robust. Hence, making it > atomic. >=20 People sometimes underestimate the performance penalty of atomic ops.=20 Every atomic op is the equivalent of a spin_lock/spin_unlock pair. This is why two atomics are worse than taking a spin_lock, doing what you have to do, and releasing the spin_lock. Is this really what you want for a "confusing, let's make it robust" issue? --=20 Doug Ledford GPG KeyID: B826A3330E572FDD Key fingerprint =3D AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD --=-PLg0GUGohGjeHX9p8SOq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEErmsb2hIrI7QmWxJ0uCajMw5XL90FAlrZZMsACgkQuCajMw5X L93joA/8DJwFhaQ/BqkgGb7IU86MZGrNpT+yjnPKt9BIV6mi998Rvrf9dDR4mqy6 junN9n2TFg3I5+YdDDDGuIisUHGaR1cWf6w6b+lZXHqFpTNYPxzJZf64M1BvW7GS 9kQPD50wq9tb5Cvh4qGQsN7ENmMagXaExy+VMgf3sIWKrvJIpHYVlpLUo4Sd9EFp xRXE2JMgOfSFtKOhsGOJP2fQ4ioZuXzmaJbbO9d6vS2IyFfv6dqJSI8uDdqeJXkx hvzsmS4L+SuEs/n6t5ce+gjG8b+xhp3QEOumL4siTQrzK6QIVlN49KOMN54VdI6q 3qZjBMlgVS31YHKMzK+6wYRfK+Ri9ry97vDUzsSyATmlOB+kz6HyHcbjOcUMrQzy 5cCEfO1W0jLQ6mZ3QuBn0Q3B/FTWXCbOaF6tBo0QAHpaWBN/N1PcI9sOyJHwhySt PzWtq3mnFbZ1MlIpCrjxoYbo/BxrzEyaDImr5X7XRGJoNWbBdyTlI47yUuq/65mx uOgjS8IIpJ+BHmYzItOahvCPFEeKw6dBME0KoUTPWslBeXY8bgyCrS57UiABoWYk nCWp7z8XjsuIetIvPLU3Ep9wC86tZN+BDeev/AICwE/IdpAufKxeBZDSv4Ek/oeF FBrQe0SoueIKORlI+x3Jo8rpcQP+AUl0Y0MiiQDpAQLvU6gjYRI= =ilTE -----END PGP SIGNATURE----- --=-PLg0GUGohGjeHX9p8SOq--