Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp186528pxf; Wed, 31 Mar 2021 00:14:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygdPm+WaiTPRJbi3tBODiaFr6IUCOdtnBROz5ifMmAkvNePWGsQCvVI2oMpTc8ipc4agCd X-Received: by 2002:a17:906:6bd1:: with SMTP id t17mr2038187ejs.319.1617174855554; Wed, 31 Mar 2021 00:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617174855; cv=none; d=google.com; s=arc-20160816; b=Pk21UDgNV8ReOEtjS//hs/9ACQfGGuPu7u/Cv+QO+i37AZtVdk2Upi8YPl7UuBN+fi /NjzmsQrFnWhvxVcxS0gXUQrzEMYTCSlkLtKeaNoDHmLiBmjh315j3kM6WDT/QvM1Ggh 5poB1OooCANA8WCIck9uEMijgEYl/1lXQQUObmWe/4sQMqiM2Plh2C71XgpmITGUiAPl by4UDu7FhBFrwZ+v6VKeW/IhznsPOzgrmu1ebhg9RzHAH0pafe8ELYKi0+NX0OCIjej2 82WnfwAYF6957pQjNkoCXBvDY7ee3/P6/6aB3fDHM/9iuScvDFfgH6qcPio6RVfsxDK3 1hwQ== 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; bh=8OmrvaEh9c2P8uKQFiovyHWB9kHyn1pdjuEhIQzIHAs=; b=RheXIM9/KX9GPXlGifSBYY88u9uITHUd1IdhVD9Nb6z0n1sNOjKBqWWk1aiNQhUEo9 1w9daUJCnjKDi+LsjubJgxivILlAEBTfkqL2TR/rqw5edJdsqfi6vkkP/okjaZwN28Qr CcTVbXNOcJXdHqt4JLcfqn0Qlt9jYWTDtvy/Ne2phGOwAg1KOTgA0tya5A72hl9MYZIK 2u0Um89lqpX9FRzHPoLkicKtMhpoCYnefXEUhPjkNRxqHgla/CEMFgXYtNLiJ55FKl6g 75iwKUqBdYVyTy91zd/xIGuunZQvnWQO15+/4FGw7C35/o+/Okz0rFfQSrbFSJU2Vu/Q 2AvQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si1115591ejd.203.2021.03.31.00.13.51; Wed, 31 Mar 2021 00:14:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234003AbhCaHMy (ORCPT + 99 others); Wed, 31 Mar 2021 03:12:54 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:39941 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234049AbhCaHMX (ORCPT ); Wed, 31 Mar 2021 03:12:23 -0400 Received: from mail-ot1-f41.google.com ([209.85.210.41]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MlNYj-1ltOCO0s3R-00lkAd; Wed, 31 Mar 2021 09:12:21 +0200 Received: by mail-ot1-f41.google.com with SMTP id 31-20020a9d00220000b02901b64b9b50b1so18031279ota.9; Wed, 31 Mar 2021 00:12:20 -0700 (PDT) X-Gm-Message-State: AOAM532bQTsnUGyigP0s3eh2YvOR3hUzUGBBUtc+R2nMMlYZyQAdxsdV GAQp7GxTR0iltHiQL5A5FPq35xW3UQgXop3xM+M= X-Received: by 2002:a9d:758b:: with SMTP id s11mr1622938otk.305.1617174739722; Wed, 31 Mar 2021 00:12:19 -0700 (PDT) MIME-Version: 1.0 References: <1616868399-82848-1-git-send-email-guoren@kernel.org> <1616868399-82848-4-git-send-email-guoren@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 31 Mar 2021 09:12:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 3/4] locking/qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32 To: Guo Ren Cc: Peter Zijlstra , linux-riscv , Linux Kernel Mailing List , linux-csky@vger.kernel.org, linux-arch , Guo Ren , Will Deacon , Ingo Molnar , Waiman Long , Anup Patel , Sebastian Andrzej Siewior Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:2DyaxPUAz+RptwI9Ku7FGAF0b+L3WKMSYl8jBJ7nLVS3NCFt+Y9 epHIOuq46qnputgSXY2FeS4dWcLPByTIhUDdoucYGR55qnhqdGF8KZ4TUp/VHDAqssKTCjs ctlkF0Edf6qfF2IDITbj05lXESoRCSZPpRmdSntuPHXMPyV0bfjm5bEUmWDrwsZRQ/B86hz BJarld8qxKWiI4nfn9GxQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zY+hQ+YCRp4=:jzbxuh3vaXmenlvenWzG78 MqJiAj/Pzm9HebecbpFAAZRcXo0UNzKcbuOSuHXGycgczQjIplWoC/36afoY6h4DvOgIeaxN7 3hd8BPK5TlUz4pEIVjs+q7y+LUL2vCgdXyUTUK5A83sSCs4A+D+keJ4Cu0Z+f3uQimR+8Fwdw mrf9J3125qbeCUXB2jYIFzBHZ+isc5Eyi+MsyqYG0p0Wv52r2X4nKfVJp24iuzjiCcLExfWjC gH48IH8fjc8NaQEoTBBUUiI/+tEqBmUhUIW5TAUBXJMkQYEO9zwS5+7IdiKEshLIH/eUylBnI BlxQb76AZ2q3pkkxYYXpkIklGymtUEo/HOqkubssgKtIfBjG9IkdwLSTcu4DTiLuuH85tKndL qp/hQaNFL9e5m37HddR3PcQMu5TXqFWKs6JGZDZepc5TvxVJ3fM3sfqjYRzN8I+7rlsHoLlN3 +y9PFwyRyUCfHZ5ZvDzoRrjkBcp8vZEomCwNf9QYVve/M1NOxUI/WL6N4xLsYnXPuBSrXn6UA pBbt3GQytgocHC2+tgHkgIrgb4f2cM8hYTtALYi5duKA6GVKYS3HjeHS5rsKWq+4L1N22asqC QU+dajR66w2zs1lC2yoywaighhIDKL9ab8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 8:44 AM Guo Ren wrote: > On Wed, Mar 31, 2021 at 12:18 PM Guo Ren wrote: > > On Tue, Mar 30, 2021 at 3:12 PM Arnd Bergmann wrote: > > > On Tue, Mar 30, 2021 at 4:26 AM Guo Ren wrote: > > > As I understand, this example must not cause a deadlock on > > > a compliant hardware implementation when the underlying memory > > > has RsrvEventual behavior, but could deadlock in case of > > > RsrvNonEventual > > Thx for the nice explanation: > > - RsrvNonEventual - depends on software fall-back mechanisms, and > > just I'm worried about. > > - RsrvEventual - HW would provide the eventual success guarantee. > In riscv-spec 8.3 Eventual Success of Store-Conditional Instructions > > I found: > "As a consequence of the eventuality guarantee, if some harts in an > execution environment are > executing constrained LR/SC loops, and no other harts or devices in > the execution environment > execute an unconditional store or AMO to that reservation set, then at > least one hart will > eventually exit its constrained LR/SC loop. *** By contrast, if other > harts or devices continue to > write to that reservation set, it ***is not guaranteed*** that any > hart will exit its LR/SC loop.*** " > > Seems RsrvEventual couldn't solve the code's problem I've mentioned. Ok, got it. Arnd