Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2008328pxb; Sat, 2 Oct 2021 04:15:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0X0kyr8FxGHh9mS2//DHpAO0JdgI0c0M0WVXrMToN2Iol7wP2/qnqzYYUGHVIPA36Az1Y X-Received: by 2002:a65:47cd:: with SMTP id f13mr2481897pgs.439.1633173341069; Sat, 02 Oct 2021 04:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633173341; cv=none; d=google.com; s=arc-20160816; b=cO772DfRpkckVTsVyEBRWVpWNdB28zsVnT/gIcIscDjra9eeP/4uEYo67sb2b/THYa Li+AwLZWvfXUk6ZKMqWL0iJOrGZDaNiz4/tilq5fQk6XWHJnqVh3Hl1PzSBAbnxXcx9M WbOr3uO/c2vnfby8jTCsjuW1oeyrhSSUVTyXOxhXIPTtWO2AaCZtlE4Lq2qCnTnqCUEw 0Haw3l4cP2T5eNANCNJg4AqZ1skVQMWBW0TbVonju4X4zFj/fPC/D6D8KaYgRU8Wbt4m UyQSVj7GUohGspkfoEgLMKRkCjZ6ufzju3KwUDVd6Wqf8KbJOdViam/A+WpRbvhD7iOk xc1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lOvScWWdsWCsTrT9qAyN9hFCi3UuNxTHx/MbnP0X/8w=; b=sbDGpYStJMPLD/ANkzkXXcHMaMHoa21mIRDTzFNLl2Vnz306vXqhoyGxDXElYVAmrQ mrWzV01LTl2Xrs6VXiskZ0zexcwpk29OFywhcfcYVzJyPAS51A3kWaE9/ir8mNekZBkV MaWrrqJSP84m0aVY5cK14R3rJR4L5A8pJpsXCM87RuLkbe+aPU0rbFM/GB5WtlL/i/4g rMu3jN55YSAWUcSYAWVwuz9S3zsQnwtHTNEaNfo4BIifL7dGWMlfTc2+9GbzkAFrsuvX Ak8zBwxc7QHcNl3KpJenqHOAAVqJWDu1SRCNzR5Ar+W8UbCTx9MYkl6DQBxIggV8qCmt MIGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eDB0oNVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si10946473plr.455.2021.10.02.04.15.26; Sat, 02 Oct 2021 04:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eDB0oNVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232836AbhJBLHK (ORCPT + 99 others); Sat, 2 Oct 2021 07:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232821AbhJBLHJ (ORCPT ); Sat, 2 Oct 2021 07:07:09 -0400 Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0B67C061570; Sat, 2 Oct 2021 04:05:23 -0700 (PDT) Received: by mail-vs1-xe33.google.com with SMTP id y28so447443vsd.3; Sat, 02 Oct 2021 04:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lOvScWWdsWCsTrT9qAyN9hFCi3UuNxTHx/MbnP0X/8w=; b=eDB0oNVafDTVhCe4pMIfJK9Mt77dkoTCfFD7fFEOfugZAuhWkUbHwE0SnYahtcNKh8 8PY70r5RXCS4Wf+eB3UADhNuyHgLiBmbL5WLpMtloWhunmTW0xDPhKBluAH/+udwYwkE aqdDG2ok4sf5/ScKdcIUFrTAf3QUmA49bImqk1AFeCeBk7p+Ez2aHa+xKpgGymSiSQdQ FpzcW+w50fPo6ARbHEFcZNh+ktGsic6WAOPm0LPn8k9ARKYVAqd4rvtrb8P4EtRzG6dz PHqidp0wulGCdCyl8trZWfNxENS3IR1yVBTNTTRiDaeOd7rjMIOSytI9DzmRRJOpp43e tQKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lOvScWWdsWCsTrT9qAyN9hFCi3UuNxTHx/MbnP0X/8w=; b=hQ/U4xDc+UjoS0D338l137a6APgtN7oO7/sea2nHAVLRdoA1KjuxRPauCXQ329Cy9q L6N5KfUXfNbMSzq+802f7aNUhV8G9bud4Zs2gbY+pUMQo2rSTG73ZkS1uSMmhcbTsjGg 2WDyc57eH7/oN6jw6e5OGcw+Eujl5/URponvJ6bZj1QyRd7c5bW8l2xzbXeA5eNhpnJK +hyjpTs1TsC7IjH3tFcKpbm04rJfp5bmOCOjvlPvQlcb3VW8dN38IY8KcJ7uYdksnPnn GvPBxRGV0fUuC3re5oJ9kWOpBcuxfo4dju5P3q310NR/gLI24Xg94swZ596qP/EdbDFN 2iQQ== X-Gm-Message-State: AOAM530QNhub2tTlrFxcqn0HRoUByQqkEd9LriedR0V8QBDIBgtnPOEF 8Kmt/KoYZJ0kMnfV+7n0dXjwYKB+3LcvKGENZ6Y= X-Received: by 2002:a67:ee12:: with SMTP id f18mr8135716vsp.20.1633172723091; Sat, 02 Oct 2021 04:05:23 -0700 (PDT) MIME-Version: 1.0 References: <20210927064300.624279-1-chenhuacai@loongson.cn> <20210927064300.624279-8-chenhuacai@loongson.cn> In-Reply-To: From: Huacai Chen Date: Sat, 2 Oct 2021 19:05:10 +0800 Message-ID: Subject: Re: [PATCH V4 07/22] LoongArch: Add atomic/locking headers To: Peter Zijlstra , yili0568@gmail.com Cc: Huacai Chen , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , "open list:DOCUMENTATION" , LKML , Xuefeng Li , Yanteng Si , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Peter, On Fri, Oct 1, 2021 at 7:04 PM Peter Zijlstra wrote: > > On Mon, Sep 27, 2021 at 02:42:44PM +0800, Huacai Chen wrote: > > diff --git a/arch/loongarch/include/asm/spinlock.h b/arch/loongarch/include/asm/spinlock.h > > new file mode 100644 > > index 000000000000..2544ee546596 > > --- /dev/null > > +++ b/arch/loongarch/include/asm/spinlock.h > > @@ -0,0 +1,12 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* > > + * Copyright (C) 2020-2021 Loongson Technology Corporation Limited > > + */ > > +#ifndef _ASM_SPINLOCK_H > > +#define _ASM_SPINLOCK_H > > + > > +#include > > +#include > > +#include > > + > > +#endif /* _ASM_SPINLOCK_H */ > > diff --git a/arch/loongarch/include/asm/spinlock_types.h b/arch/loongarch/include/asm/spinlock_types.h > > new file mode 100644 > > index 000000000000..91f258401ef9 > > --- /dev/null > > +++ b/arch/loongarch/include/asm/spinlock_types.h > > @@ -0,0 +1,11 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* > > + * Copyright (C) 2020-2021 Loongson Technology Corporation Limited > > + */ > > +#ifndef _ASM_SPINLOCK_TYPES_H > > +#define _ASM_SPINLOCK_TYPES_H > > + > > +#include > > +#include > > + > > +#endif > > Also see the many lkml threads on this, is there big enough loongson to > justify qspinlock? Have you tried a ticket lock? Loongson-3A5000 supports NUMA, we have as many as 16 nodes, 64 cores in total. And we have tried ticket lock which is worse than qspinlock. Maybe Jun Yi (yili0568@gmail.com) can give some performace data? Huacai