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.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 B95BDC76192 for ; Tue, 16 Jul 2019 10:20:49 +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 9267220880 for ; Tue, 16 Jul 2019 10:20:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nIPvt6CR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="1FCCrHiw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9267220880 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=DRhPAdMOayfY8ExFpvaLkE3GKeSEvtmNR6BPqPAzfLs=; b=nIPvt6CRtQ6QfJ KqZGOPLaJS1lvkYACqpfUjZedchLzLlIqNbzy3jXl8HUWXbVmjAsBMEoPzmAx0y1uaJUyw63ZinNk uuMuX5DLuK5YvK2Yo3Ozvuhld9ELelw9iBq/YqZWBTEmAknOBHtbh+TOyO3Ga76W2h6hDKvBgixF6 Z1llTC2A7LIdKz6MgCYFvARNHHY5EpkZJZ8Q1X3rI+OBvxuxRQD45yXfZulDKpLOlwhliZYYsQB0K xMBuF9wos0XOeQG1z2z8cN1DTCRJNle+BqK+hWwh8k/hcr32QK+JvNVB+Madue9hE1qeFUEFXN8VF xI1A8AIjqsgXYXe22jkw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hnKZl-0004pf-8E; Tue, 16 Jul 2019 10:20:49 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hnKZi-0004p2-KK for linux-arm-kernel@bombadil.infradead.org; Tue, 16 Jul 2019 10:20:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+jPmiLFoLFkErQnsFP18srbHMWPmmDSQUv0S0HNnLWo=; b=1FCCrHiw6wHWzTKNNLJJ628q3 sfZxcu4lXp8UOSjklMM84EEttE7cH/rxMVbAXKhQFu/3gZ+10G+GnD+QOGbggR+a4ntTcNNLYXw6j HQwYBI7Ip3s3jo0xYu5aAhxsO3PdiOkRFEk7AC6tY7L756h2yeZid6XR7FOoEIDs4wrGIKWBypx6+ 29+ITIL/Aw/WCMapng0MkEzqtfJq2WfLPttOSGcTayXz12kmjfnqKQ1/O4cinbNjMouqSZ1YNkODG xCHWvcC8YQP8U9hwBoJRuKV0DN2nezJlsVl3CsaH//S3ws6GsMrkZoCA9+TfD1jPwDtslYWwL3NIq t5kPYIzrg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hnKZX-0005uN-La; Tue, 16 Jul 2019 10:20:36 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 58FB52021C301; Tue, 16 Jul 2019 12:20:34 +0200 (CEST) Date: Tue, 16 Jul 2019 12:20:34 +0200 From: Peter Zijlstra To: Alex Kogan Subject: Re: [PATCH v3 2/5] locking/qspinlock: Refactor the qspinlock slow path Message-ID: <20190716102034.GN3419@hirez.programming.kicks-ass.net> References: <20190715192536.104548-1-alex.kogan@oracle.com> <20190715192536.104548-3-alex.kogan@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190715192536.104548-3-alex.kogan@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, guohanjun@huawei.com, arnd@arndb.de, dave.dice@oracle.com, jglauber@marvell.com, x86@kernel.org, will.deacon@arm.com, linux@armlinux.org.uk, steven.sistare@oracle.com, linux-kernel@vger.kernel.org, rahul.x.yadav@oracle.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, longman@redhat.com, tglx@linutronix.de, daniel.m.jordan@oracle.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 15, 2019 at 03:25:33PM -0400, Alex Kogan wrote: > +/* > + * set_locked_empty_mcs - Try to set the spinlock value to _Q_LOCKED_VAL, > + * and by doing that unlock the MCS lock when its waiting queue is empty > + * @lock: Pointer to queued spinlock structure > + * @val: Current value of the lock > + * @node: Pointer to the MCS node of the lock holder > + * > + * *,*,* -> 0,0,1 > + */ > +static __always_inline bool __set_locked_empty_mcs(struct qspinlock *lock, > + u32 val, > + struct mcs_spinlock *node) > +{ > + return atomic_try_cmpxchg_relaxed(&lock->val, &val, _Q_LOCKED_VAL); > +} That name is nonsense. It should be something like: static __always_inline bool __try_clear_tail(...) > +/* > + * pass_mcs_lock - pass the MCS lock to the next waiter > + * @node: Pointer to the MCS node of the lock holder > + * @next: Pointer to the MCS node of the first waiter in the MCS queue > + */ > +static __always_inline void __pass_mcs_lock(struct mcs_spinlock *node, > + struct mcs_spinlock *next) > +{ > + arch_mcs_spin_unlock_contended(&next->locked, 1); > +} I'm not entirely happy with that name either; but it's not horrible like the other one. Why not mcs_spin_unlock_contended() ? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel