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.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 4780BC2D0DB for ; Thu, 23 Jan 2020 14:16:13 +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 15A2920718 for ; Thu, 23 Jan 2020 14:16:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lI7vKI83"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="II4+EIzt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15A2920718 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ENejWwRyphhh+BEtRozyejD22dcxAEsjTkrLGiG+o8E=; b=lI7vKI834Sflxq 6gTh+feQEKwZzFP3ItYlAtBfK/55ALHM+SMyrcVNnRt1RIPtNwacB+kTiXbZ3gLWZj6LVxC848Rah 3/pqZnfGKDo5ABkzgY81dumBsGdn2mYCj3jFK7DI0/+ThTDuikcd2hwp186zic7ZMGcdbhRKsrGtC dwLcoxMIB0Zs2uqjA4Gq/PugSAyhMDicXaaSq95tsL1ScvSMH/X1mdgcfuquSn1RuDRP6BwBuJ/2o ryp8ARnvAzN/K7wm6cLMOFVqt/Ep9TT934mbG5zRmlxXCuVBzYI/izyNaS8IZ/i/XZaLOd9urtFkr JN+LIiq+BANAs/CyZBEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iudHG-0003zQ-Sx; Thu, 23 Jan 2020 14:16:10 +0000 Received: from us-smtp-1.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iudHD-0003vH-H6 for linux-arm-kernel@lists.infradead.org; Thu, 23 Jan 2020 14:16:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579788965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/NlvV8sLBYjX4HhniKYbwd4Qsi6bxUolByF4ash31SU=; b=II4+EIztUNhrWqkElEHtpPu09cCvhITB1jFUhrDpBZ2nu81dE+TWa1Jqt11Efzn2+Wv/WA wF2WYbssEVakEKRrN3A7+8tT8ZMluRREwNhhWq9d2QkFZHp3kAAN73my1lWGn2ZiGqCzj2 qoCnKiGy6lDmK7fL24VgcdUtFx0IP7M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-181-U4d8_1qPOfexJ9uhx9dzrw-1; Thu, 23 Jan 2020 09:16:01 -0500 X-MC-Unique: U4d8_1qPOfexJ9uhx9dzrw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9557A18C8C0D; Thu, 23 Jan 2020 14:15:58 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-59.bos.redhat.com [10.18.17.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AB801CB; Thu, 23 Jan 2020 14:15:56 +0000 (UTC) Subject: Re: [PATCH v9 3/5] locking/qspinlock: Introduce CNA into the slow path of qspinlock To: Alex Kogan , linux@armlinux.org.uk, peterz@infradead.org, 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, guohanjun@huawei.com, jglauber@marvell.com References: <20200115035920.54451-1-alex.kogan@oracle.com> <20200115035920.54451-4-alex.kogan@oracle.com> From: Waiman Long Organization: Red Hat Message-ID: Date: Thu, 23 Jan 2020 09:15:55 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20200115035920.54451-4-alex.kogan@oracle.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200123_061607_644316_CC3455D2 X-CRM114-Status: GOOD ( 14.83 ) 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: dave.dice@oracle.com, steven.sistare@oracle.com, daniel.m.jordan@oracle.com 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 1/14/20 10:59 PM, Alex Kogan wrote: > +static int __init cna_init_nodes(void) > +{ > + unsigned int cpu; > + > + /* > + * this will break on 32bit architectures, so we restrict > + * the use of CNA to 64bit only (see arch/x86/Kconfig) > + */ > + BUILD_BUG_ON(sizeof(struct cna_node) > sizeof(struct qnode)); > + /* we store an ecoded tail word in the node's @locked field */ > + BUILD_BUG_ON(sizeof(u32) > sizeof(unsigned int)); > + > + for_each_possible_cpu(cpu) > + cna_init_nodes_per_cpu(cpu); > + > + return 0; > +} > +early_initcall(cna_init_nodes); > + I just realized that you shouldn't call cna_init_nodes as an early_initcall. Instead, > +/* > + * Switch to the NUMA-friendly slow path for spinlocks when we have > + * multiple NUMA nodes in native environment, unless the user has > + * overridden this default behavior by setting the numa_spinlock flag. > + */ > +void __init cna_configure_spin_lock_slowpath(void) > +{ > + if ((numa_spinlock_flag == 1) || > + (numa_spinlock_flag == 0 && nr_node_ids > 1 && > + pv_ops.lock.queued_spin_lock_slowpath == > + native_queued_spin_lock_slowpath)) { > + pv_ops.lock.queued_spin_lock_slowpath = > + __cna_queued_spin_lock_slowpath; > + > + pr_info("Enabling CNA spinlock\n"); > + } > +} call it when it is sure that CNA spinlock is going to be used. At this point, the system is still in UP mode and the slowpath will not be called. Cheers, Longman _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel