Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2142698rwo; Thu, 3 Aug 2023 05:29:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlFjbxPCELchhisWY9M3l5TG3gRVVBNcbWCZ5qaZTdFz2DiiPZ0JLsSD3uQD/rq/o9m9pLDa X-Received: by 2002:aa7:cb48:0:b0:51e:1a51:d414 with SMTP id w8-20020aa7cb48000000b0051e1a51d414mr7007341edt.32.1691065756862; Thu, 03 Aug 2023 05:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691065756; cv=none; d=google.com; s=arc-20160816; b=fwlWytTDHakfsYaNmXYa1ZLTq6tQCKJifVvKupuGNOp7kwd5ivsaRPH9XCiXz1iody FHGM1MYnySS4xHi0lY7rb161+zGev0NDG/S+IBSI3xjoItB2wV8zE1aOKpYnTRYmgncU y3JtVkiY9zN7f/HoOTe/dusRbRIT5cJ1pSuOQKf9u0UVy8Kok2Fo/uiZsfc303XtxBvc WmT2QLsKcDIpsCuohcBX51GQrc26/7leam+C447VayaGxpEPGizUdhwqwZEt6FkLVUOw AGCye22B24gV9OqgPP8+aYr5BskMIycBbC4CvGK4O9qMuFdc5bnZrnBQ7YwybhDAE9DU X1vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cO/uLPmilqipGwZoOwvAvBoyxkuyIOj2yUkU6KfTz7s=; fh=h0l4gfSBykqHr6xYzZC04AV1oMpywElI66wujMbsQ3w=; b=XVublKqBDKAlc25/zM7OG7tC0zNyn0UOcnnERPFoJ01w6mPc/nVd6p4bRydA3vabWr 7wpuzvyZmyB/27AyBSA2aalN9fqtbslyW5iLBUt4I1McydkhixV1I5YyDjL74oCqg/U9 rD/Rj48q4SKPZb+EGgfRY2Xp52kkDXF7pLdo3vFnh8evy1ffxOvWRnDXX2CQR6Y19TRD OTQBvUy5yNEXmU3NeIFArayS5CR+MvXTs9zVLng1Hnl/l6TkrsZQiaJ21qmOq7sVy1ZO sgcanrqNnRy5k1KW2o8JQq2K49eoSmNbKLNz4Tcv7bt8rT807Wu1VMEjaizSy6ASqczR QbYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=qHllbgqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d19-20020aa7ce13000000b0052288239e89si4104174edv.231.2023.08.03.05.28.51; Thu, 03 Aug 2023 05:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=qHllbgqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235670AbjHCL52 (ORCPT + 99 others); Thu, 3 Aug 2023 07:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235671AbjHCL50 (ORCPT ); Thu, 3 Aug 2023 07:57:26 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567FD2D71; Thu, 3 Aug 2023 04:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=cO/uLPmilqipGwZoOwvAvBoyxkuyIOj2yUkU6KfTz7s=; b=qHllbgqNWzBcNIH4ZGYGaAGIW0 khm+1RvfI+4PbyLkbFmvrTIC6/VmgVC27qgb4qIxoElmksURq9oAYXYRuiXQl/Q7iyZyqCiI0+JHj UJccFnJTHT5Ssw0mFm7Xmqew0JTIPqTMLGbDD7VCy5DuXp5BFcGCRaUX5MWCXPWk51/JxORUVVoLp N9/eUDaTN447e2aA8Grnwx1BKJaLdkYs6wjwkyRR4c+EXbxQ8celhv9RvoAZKTLB1Lr86D9gSoAHV qi9SNsSrgkap72uU35CGStE4sBIQdmLWFwphElzj2Gu9nx3poPpnTx1Aa5O6keODRFYciXB43NUfJ tnrt6g6A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qRWw8-00GnqP-1a; Thu, 03 Aug 2023 11:56:12 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2A774300301; Thu, 3 Aug 2023 13:56:11 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F21A6205EA3E6; Thu, 3 Aug 2023 13:56:10 +0200 (CEST) Date: Thu, 3 Aug 2023 13:56:10 +0200 From: Peter Zijlstra To: Guo Ren Cc: Alex Kogan , linux@armlinux.org.uk, mingo@redhat.com, will.deacon@arm.com, arnd@arndb.de, longman@redhat.com, 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, guohanjun@huawei.com, jglauber@marvell.com, steven.sistare@oracle.com, daniel.m.jordan@oracle.com, dave.dice@oracle.com Subject: Re: [PATCH v15 3/6] locking/qspinlock: Introduce CNA into the slow path of qspinlock Message-ID: <20230803115610.GC214207@hirez.programming.kicks-ass.net> References: <20210514200743.3026725-1-alex.kogan@oracle.com> <20210514200743.3026725-4-alex.kogan@oracle.com> <20230803085004.GF212435@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 03, 2023 at 06:28:51PM +0800, Guo Ren wrote: > On Thu, Aug 3, 2023 at 4:50 PM Peter Zijlstra wrote: > > > > On Wed, Aug 02, 2023 at 07:14:05PM -0400, Guo Ren wrote: > > > > > The pv_ops is belongs to x86 custom frame work, and it prevent other > > > architectures connect to the CNA spinlock. > > > > static_call() exists as a arch neutral variant of this. > Emm... we have used static_call() in the riscv queued_spin_lock_: > https://lore.kernel.org/all/20230802164701.192791-20-guoren@kernel.org/ Yeah, I think I saw that land in the INBOX, just haven't had time to look at it. > But we met a compile problem: > > GEN .vmlinux.objs > MODPOST Module.symvers > ERROR: modpost: "__SCK__pv_queued_spin_unlock" [arch/riscv/kvm/kvm.ko] > undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" > [kernel/locking/locktorture.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" [mm/z3fold.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" > [fs/nfs_common/grace.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" [fs/quota/quota_v1.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" [fs/quota/quota_v2.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" > [fs/quota/quota_tree.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" [fs/fuse/virtiofs.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" [fs/dlm/dlm.ko] undefined! > ERROR: modpost: "__SCK__pv_queued_spin_unlock" [fs/fscache/fscache.ko] > undefined! > WARNING: modpost: suppressed 839 unresolved symbol warnings because > there were too many) > /home/guoren/source/kernel/linux/scripts/Makefile.modpost:144: recipe > for target 'Module.symvers' failed > > Our solution is: > EXPORT_SYMBOL(__SCK__pv_queued_spin_unlock); > > What do you think about it? Could be you're not using static_call_mod() to go with EXPORT_STATIC_CALL_TRAMP() > > > I'm working on riscv qspinlock on sg2042 64 cores 2/4 NUMA nodes > > > platforms. Here are the patches about riscv CNA qspinlock: > > > https://lore.kernel.org/linux-riscv/20230802164701.192791-19-guoren@kernel.org/ > > > > > > What's the next plan for this patch series? I think the two-queue design > > > has satisfied most platforms with two NUMA nodes. > > > > What has been your reason for working on CNA? What lock has been so > > contended you need this? > I wrote the reason here: > https://lore.kernel.org/all/20230802164701.192791-1-guoren@kernel.org/ > > The target platform is: https://www.sophon.ai/ > > The two NUMA nodes platform has come out, so we want to measure the > benefit of CNA qspinlock. CNA should only show a benefit when there is strong inter-node contention, and in that case it is typically best to fix the kernel side locking. Hence the question as to what lock prompted you to look at this.