From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v2 3/5] locking/qspinlock: Introduce CNA into the slow path of qspinlock Date: Wed, 3 Apr 2019 19:16:35 +0200 Message-ID: <20190403171635.GM4038@hirez.programming.kicks-ass.net> References: <20190329152006.110370-1-alex.kogan@oracle.com> <20190329152006.110370-4-alex.kogan@oracle.com> <60a3a2d8-d222-73aa-2df1-64c9d3fa3241@redhat.com> <20190402094320.GM11158@hirez.programming.kicks-ass.net> <9ec3d8dc-d1e0-1b8a-5e00-ba92b9756c58@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <9ec3d8dc-d1e0-1b8a-5e00-ba92b9756c58@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Waiman Long Cc: linux-arch@vger.kernel.org, arnd@arndb.de, dave.dice@oracle.com, x86@kernel.org, will.deacon@arm.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, rahul.x.yadav@oracle.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, Alex Kogan , steven.sistare@oracle.com, tglx@linutronix.de, daniel.m.jordan@oracle.com, linux-arm-kernel@lists.infradead.org List-Id: linux-arch.vger.kernel.org On Wed, Apr 03, 2019 at 12:33:20PM -0400, Waiman Long wrote: > static inline void queued_spin_lock_slowpath(struct qspinlock *lock, u32 > val) > { > =A0=A0=A0=A0=A0=A0=A0 if (static_branch_unlikely(&use_numa_spinlock)) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 numa_queued_spin_lock_slowp= ath(lock, val); > =A0=A0=A0=A0=A0=A0=A0 else=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 native_queued_spin_lock_slo= wpath(lock, val); > } That's horrible for the exact reason you state. > Alternatively, we can also call numa_queued_spin_lock_slowpath() in > native_queued_spin_lock_slowpath() if we don't want to increase the code > size of spinlock call sites. Yeah, still don't much like that though, we're littering the fast path of that slow path with all sorts of crap. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:41786 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfDCRQt (ORCPT ); Wed, 3 Apr 2019 13:16:49 -0400 Date: Wed, 3 Apr 2019 19:16:35 +0200 From: Peter Zijlstra Subject: Re: [PATCH v2 3/5] locking/qspinlock: Introduce CNA into the slow path of qspinlock Message-ID: <20190403171635.GM4038@hirez.programming.kicks-ass.net> References: <20190329152006.110370-1-alex.kogan@oracle.com> <20190329152006.110370-4-alex.kogan@oracle.com> <60a3a2d8-d222-73aa-2df1-64c9d3fa3241@redhat.com> <20190402094320.GM11158@hirez.programming.kicks-ass.net> <9ec3d8dc-d1e0-1b8a-5e00-ba92b9756c58@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9ec3d8dc-d1e0-1b8a-5e00-ba92b9756c58@redhat.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Waiman Long Cc: Alex Kogan , linux@armlinux.org.uk, mingo@redhat.com, will.deacon@arm.com, arnd@arndb.de, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, x86@kernel.org, steven.sistare@oracle.com, daniel.m.jordan@oracle.com, dave.dice@oracle.com, rahul.x.yadav@oracle.com Message-ID: <20190403171635.wkDc8881XOlxxAeF67Ow576HiK8H4NuOqouAZYgrXBA@z> On Wed, Apr 03, 2019 at 12:33:20PM -0400, Waiman Long wrote: > static inline void queued_spin_lock_slowpath(struct qspinlock *lock, u32 > val) > { >         if (static_branch_unlikely(&use_numa_spinlock)) >                 numa_queued_spin_lock_slowpath(lock, val); >         else    >                 native_queued_spin_lock_slowpath(lock, val); > } That's horrible for the exact reason you state. > Alternatively, we can also call numa_queued_spin_lock_slowpath() in > native_queued_spin_lock_slowpath() if we don't want to increase the code > size of spinlock call sites. Yeah, still don't much like that though, we're littering the fast path of that slow path with all sorts of crap. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1D4EC4360F for ; Wed, 3 Apr 2019 17:16:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CC77205C9 for ; Wed, 3 Apr 2019 17:16:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z+J5ZZSu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CC77205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=198gWhu7uC8S6Eqk93OkVjj3RhM/p2c0qHnP1MWer2Y=; b=Z+J5ZZSukCu8Ta MUlT2x8OtoMoID68Vn5SZIiGvepmnxfY9h7GZztXsPcyBWI2LBtW5YqNd5Ggrt06yODkybAaxCGSI 86TOxo8xeyy6k/djbJZuvUuwQ+HkAtjJ2LJ5KIQm/CeBbvUKc7dVqePBRm5Yfv8yxF0b4QN0qpbeq sMMT639qCr5IbCbQ6CXHhVKUxhx/qPt9zVD63ZIkX8b6cO2/r5In6507ThQHPIUaaIvhS+pDwaOS7 C5nKaq1EWoDDTXac6MxMdrwXTet1mjSB/euB1oKv6ag+abC6UFVtVPiQOZqBezcmyyPyqGrz3xGtO ZYQDgO/quADs8p3mKVRw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBjV9-00025E-O3; Wed, 03 Apr 2019 17:16:39 +0000 Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBjV8-000255-3T; Wed, 03 Apr 2019 17:16:38 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 56840203C12DB; Wed, 3 Apr 2019 19:16:35 +0200 (CEST) Date: Wed, 3 Apr 2019 19:16:35 +0200 From: Peter Zijlstra To: Waiman Long Subject: Re: [PATCH v2 3/5] locking/qspinlock: Introduce CNA into the slow path of qspinlock Message-ID: <20190403171635.GM4038@hirez.programming.kicks-ass.net> References: <20190329152006.110370-1-alex.kogan@oracle.com> <20190329152006.110370-4-alex.kogan@oracle.com> <60a3a2d8-d222-73aa-2df1-64c9d3fa3241@redhat.com> <20190402094320.GM11158@hirez.programming.kicks-ass.net> <9ec3d8dc-d1e0-1b8a-5e00-ba92b9756c58@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9ec3d8dc-d1e0-1b8a-5e00-ba92b9756c58@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, arnd@arndb.de, dave.dice@oracle.com, x86@kernel.org, will.deacon@arm.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, rahul.x.yadav@oracle.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, Alex Kogan , steven.sistare@oracle.com, tglx@linutronix.de, daniel.m.jordan@oracle.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 03, 2019 at 12:33:20PM -0400, Waiman Long wrote: > static inline void queued_spin_lock_slowpath(struct qspinlock *lock, u32 > val) > { > =A0=A0=A0=A0=A0=A0=A0 if (static_branch_unlikely(&use_numa_spinlock)) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 numa_queued_spin_lock_slowp= ath(lock, val); > =A0=A0=A0=A0=A0=A0=A0 else=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 native_queued_spin_lock_slo= wpath(lock, val); > } That's horrible for the exact reason you state. > Alternatively, we can also call numa_queued_spin_lock_slowpath() in > native_queued_spin_lock_slowpath() if we don't want to increase the code > size of spinlock call sites. Yeah, still don't much like that though, we're littering the fast path of that slow path with all sorts of crap. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel