From patchwork Wed May 10 18:16:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 92270 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3842225vqo; Wed, 10 May 2023 11:44:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4f1ZMYpk5V+VY3/+Ps+XIn5+R+MZETYJqWdXKLSnKhoSXcn4ya+1Axoy6zaExivNazoX7J X-Received: by 2002:a17:902:ecd0:b0:1ac:76a6:a1f with SMTP id a16-20020a170902ecd000b001ac76a60a1fmr14394743plh.16.1683744250476; Wed, 10 May 2023 11:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744250; cv=none; d=google.com; s=arc-20160816; b=VkNIe3vDgPL1m1Sa4t//iDAohDMOMGDyK9WW12KVisqgvslbq7aVIeAhtG/31Ep7tY KtwgmcjqSs8lvlDpdRyZW3EnHb9DNifEZ8i8svivxI5dJE9ccHVbQ+qM+hLX8E4bU7UA zJfzDbDTDim0kI06tPQhcfpivmLT6JsUjY7i8oMJKufzodOeenxsGpCHT6DkklV5R9w2 pbc1eChhU9KfXwdNBljO0ksSoAu+I/qjqHXnfnDTqQ4W1R8DR2y3wSP4yKBkr4lAuAxZ P/4adQzhihvnvQuMvE5RcFcdCIAo8eerPjZiPq/vtT+pIQmnLiyGP+y1vFNiEy+45kug qiDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ipj1qfce2sFGKakpKaWKAtYY2Vx5yUi3mXhH0FhE7HE=; b=iaBcv2i9Cg2Y12hiwoR1cD9crwG5XC0YHWykE75jwrQw+pJjqY8WthtROxhYS0pxF8 3ZaJNqBnGVeOG0A5MxCHCgGFNv0BgPQFJ6X8Vji9Gi3bsq1LcneT/IRd3h2hsPDzHTEs 7kCVNpmJHFTDM+269T0v70Bf0LzlolGBy2I2Dsh8jeuWa/NgUdHXUsMlFpR3iwY4LWje EWcHeXaVBOjMQJedoe4LFS4SFEytGKLDbO9gVUpgV/BCJzl2sK7SnC7faGfC/pTZwwqZ QZFPJFJx8YdBMvvdWX1BRzJdr7iJiIETHYYQfJLst8EvGVLSwSFv/Za9w0DDi9LRklBg 4BHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AD+barTa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a170902768900b001ab147e4539si4530964pll.419.2023.05.10.11.43.58; Wed, 10 May 2023 11:44:10 -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=@kernel.org header.s=k20201202 header.b=AD+barTa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236055AbjEJSSQ (ORCPT + 99 others); Wed, 10 May 2023 14:18:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236089AbjEJSSE (ORCPT ); Wed, 10 May 2023 14:18:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722B57A8A; Wed, 10 May 2023 11:17:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CB5D163F7A; Wed, 10 May 2023 18:17:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32FCFC433D2; Wed, 10 May 2023 18:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742639; bh=KB8lXc7zZ3+DrRqeJZSACdw3EUil7+a97nQI2II+M98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AD+barTaVX8y+DNIVRHjyZVk6aMS9U9wGnwdUs+i6L7QVRCp2GNxW0J4DvKl8xUNp bef+WyWRqxQ2qNXW0T4LmPXu0Tb/ybPtFbl+QQpTI1slzRMZRQszn8vuuhXH/Zr/Z3 WGIICvcEU0TWzGd5ZK76KKHSI2Yu/RyGaXDFWRZrKjuOwaOCsBrB4nle1fUDxbdL+L zSBm6cWODgesfyDPnvqjTkKlymAb4LaVjjTQ0bNTlKYK/28BkVarf4OtUL5sBx1xZC IwFBwpnaBe1ltvrGZxViCB1Tpmx9dF1IE8bHX8muehsIXUXqQtxJPkYkuB+562ZEst BCQf7NrxipUUw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D024CCE120B; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 01/19] locking/atomic: Fix fetch_add_unless missing-period typo Date: Wed, 10 May 2023 11:16:59 -0700 Message-Id: <20230510181717.2200934-1-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765533811076190420?= X-GMAIL-MSGID: =?utf-8?q?1765533811076190420?= The fetch_add_unless() kernel-doc header is missing a period ("."). Therefore, add it. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 6 +++--- scripts/atomic/fallbacks/fetch_add_unless | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index a6e4437c5f36..c4087c32fb0e 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1351,7 +1351,7 @@ arch_atomic_add_negative(int i, atomic_t *v) * @u: ...unless v is equal to u. * * Atomically adds @a to @v, so long as @v was not already @u. - * Returns original value of @v + * Returns original value of @v. */ static __always_inline int arch_atomic_fetch_add_unless(atomic_t *v, int a, int u) @@ -2567,7 +2567,7 @@ arch_atomic64_add_negative(s64 i, atomic64_t *v) * @u: ...unless v is equal to u. * * Atomically adds @a to @v, so long as @v was not already @u. - * Returns original value of @v + * Returns original value of @v. */ static __always_inline s64 arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u) @@ -2668,4 +2668,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// ad2e2b4d168dbc60a73922616047a9bfa446af36 +// 201cc01b616875888e0b2c79965c569a89c0edcd diff --git a/scripts/atomic/fallbacks/fetch_add_unless b/scripts/atomic/fallbacks/fetch_add_unless index 68ce13c8b9da..a1692df0d514 100755 --- a/scripts/atomic/fallbacks/fetch_add_unless +++ b/scripts/atomic/fallbacks/fetch_add_unless @@ -6,7 +6,7 @@ cat << EOF * @u: ...unless v is equal to u. * * Atomically adds @a to @v, so long as @v was not already @u. - * Returns original value of @v + * Returns original value of @v. */ static __always_inline ${int} arch_${atomic}_fetch_add_unless(${atomic}_t *v, ${int} a, ${int} u) From patchwork Wed May 10 18:17:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 92276 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3844593vqo; Wed, 10 May 2023 11:48:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pNsscd9eqYFR+zSNl8H2eUIbnHU/H9OwC8ob8xr1l3LYiPwMo8l8CIxZ7eNSq2zjCWPBS X-Received: by 2002:a17:902:e752:b0:1ac:7072:cfc with SMTP id p18-20020a170902e75200b001ac70720cfcmr15712412plf.16.1683744516411; Wed, 10 May 2023 11:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744516; cv=none; d=google.com; s=arc-20160816; b=07mouIXd92AoVpxeBlp993Sqykguh6RHunf4HMzCc9G4ZyPr/dCICCWmwyX6J1oGq3 BH3FyL98ErqcUpuvjajVWQfpc7n3RrBrsAqkaZ6vIGr2xkmBinPopytGKI5lFT46lHGI +KnA6OOoYzUCwpj4gPrLmTOAawEA2QqHoYOaOzdnrvzw39VCdDXtUqp4lfWJl+UWE2tf P2hgKyOmDkHVaoU0bQ/9WMDTokj1f8eme2pCmK4ceMx1bHcMVw5DPQgvuhy9woZJOxeN fByTCbc61hHiVIyx+XRMFpHyw0EnzsLnG44xThPn0+J0JKVxS8oMOq0/VBFBmqZVj2KC H3xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6ja/AvFavoiCdeHZHGwH4EQACJNR3cSQrF4h8bT6Wuk=; b=g1akM99GACX/GxwUb2VI4ykgE+nHxgwJDFhY+rEo+GvIAzqUX+vJwBjX0aKkvXHFDP lLX7QQt8rActwEwN2ufELu/jRnx+7Pg2QAbAhLpaJ6cIuy7YfIWsVML6fYcLGVdt6e/S i46dzc/74eyWo8wMGGdPY+dzvrkjOe8ajdURBRRZOeufact6XSzzzI6wy9D62cGDcfon r0Uzkz3j4B1dW3RneJsUcvb+lPX9hFzX7WoAwpmwSvpkEh04MMqCsD1gU2Z8Gm8VaD4d Pya0Y9FA9648aL+DA10rorS2d5UpHmVaWdXtC9eATwAiXJJXBJoYLBrz11jCrFVdnFeh ilTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RJdm728O; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170902d4cd00b001a95b85b070si4830767plg.604.2023.05.10.11.48.23; Wed, 10 May 2023 11:48:36 -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=@kernel.org header.s=k20201202 header.b=RJdm728O; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236153AbjEJSSU (ORCPT + 99 others); Wed, 10 May 2023 14:18:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236092AbjEJSSF (ORCPT ); Wed, 10 May 2023 14:18:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F9E7AAE; Wed, 10 May 2023 11:17:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F291563EE6; Wed, 10 May 2023 18:17:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AD45C433EF; Wed, 10 May 2023 18:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742639; bh=36kMQE5a3mUqBnp2yXq6LdyUZdUoydgWI1lu5/K5gTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJdm728OldYRMOkLRNzQ5FI7eRVArdLmRojLBRIw/3w316Tm8cEfVRjCTi6+XsdB3 rsfpXso8EI7pyIDJlMfe7zbCQpd5s6fVcumn3e2xPoEXuWy1jSJWVq8QUYHUX98/0P ju7Xj4Xur9Xu3vYcP0zeMZpbCikL7BwGlC095+KqyXP+7dkZPq4dawTBDN1PG24B0Q RGltBOKBc9qdA887lnd0OmopaQUDDVHo6bPiidSwzhANNp9FrjJC1tIEa84aOukw3Y bGOzYKkQx6XOJ4+Qytdwy8u8qs6aVXuM4uBC95d3e1nPTXP0wOOJwOTOmjZLPL391M g5MJXe9Af31aQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D37EDCE134A; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 02/19] locking/atomic: Add "@" before "true" and "false" for fallback templates Date: Wed, 10 May 2023 11:17:00 -0700 Message-Id: <20230510181717.2200934-2-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765534089862830922?= X-GMAIL-MSGID: =?utf-8?q?1765534089862830922?= Fix up kernel-doc pretty-printing by adding "@" before "true" and "false" for atomic-operation fallback scripts lacking them. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 54 ++++++++++----------- scripts/atomic/fallbacks/add_negative | 4 +- scripts/atomic/fallbacks/add_unless | 2 +- scripts/atomic/fallbacks/dec_and_test | 2 +- scripts/atomic/fallbacks/inc_and_test | 2 +- scripts/atomic/fallbacks/inc_not_zero | 2 +- scripts/atomic/fallbacks/sub_and_test | 2 +- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index c4087c32fb0e..606be9d3aa22 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1185,7 +1185,7 @@ arch_atomic_try_cmpxchg(atomic_t *v, int *old, int new) * @v: pointer of type atomic_t * * Atomically subtracts @i from @v and returns - * true if the result is zero, or false for all + * @true if the result is zero, or @false for all * other cases. */ static __always_inline bool @@ -1202,7 +1202,7 @@ arch_atomic_sub_and_test(int i, atomic_t *v) * @v: pointer of type atomic_t * * Atomically decrements @v by 1 and - * returns true if the result is 0, or false for all other + * returns @true if the result is 0, or @false for all other * cases. */ static __always_inline bool @@ -1219,7 +1219,7 @@ arch_atomic_dec_and_test(atomic_t *v) * @v: pointer of type atomic_t * * Atomically increments @v by 1 - * and returns true if the result is zero, or false for all + * and returns @true if the result is zero, or @false for all * other cases. */ static __always_inline bool @@ -1243,8 +1243,8 @@ arch_atomic_inc_and_test(atomic_t *v) * @i: integer value to add * @v: pointer of type atomic_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic_add_negative(int i, atomic_t *v) @@ -1260,8 +1260,8 @@ arch_atomic_add_negative(int i, atomic_t *v) * @i: integer value to add * @v: pointer of type atomic_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic_add_negative_acquire(int i, atomic_t *v) @@ -1277,8 +1277,8 @@ arch_atomic_add_negative_acquire(int i, atomic_t *v) * @i: integer value to add * @v: pointer of type atomic_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic_add_negative_release(int i, atomic_t *v) @@ -1294,8 +1294,8 @@ arch_atomic_add_negative_release(int i, atomic_t *v) * @i: integer value to add * @v: pointer of type atomic_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic_add_negative_relaxed(int i, atomic_t *v) @@ -1376,7 +1376,7 @@ arch_atomic_fetch_add_unless(atomic_t *v, int a, int u) * @u: ...unless v is equal to u. * * Atomically adds @a to @v, if @v was not already @u. - * Returns true if the addition was done. + * Returns @true if the addition was done. */ static __always_inline bool arch_atomic_add_unless(atomic_t *v, int a, int u) @@ -1392,7 +1392,7 @@ arch_atomic_add_unless(atomic_t *v, int a, int u) * @v: pointer of type atomic_t * * Atomically increments @v by 1, if @v is non-zero. - * Returns true if the increment was done. + * Returns @true if the increment was done. */ static __always_inline bool arch_atomic_inc_not_zero(atomic_t *v) @@ -2401,7 +2401,7 @@ arch_atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new) * @v: pointer of type atomic64_t * * Atomically subtracts @i from @v and returns - * true if the result is zero, or false for all + * @true if the result is zero, or @false for all * other cases. */ static __always_inline bool @@ -2418,7 +2418,7 @@ arch_atomic64_sub_and_test(s64 i, atomic64_t *v) * @v: pointer of type atomic64_t * * Atomically decrements @v by 1 and - * returns true if the result is 0, or false for all other + * returns @true if the result is 0, or @false for all other * cases. */ static __always_inline bool @@ -2435,7 +2435,7 @@ arch_atomic64_dec_and_test(atomic64_t *v) * @v: pointer of type atomic64_t * * Atomically increments @v by 1 - * and returns true if the result is zero, or false for all + * and returns @true if the result is zero, or @false for all * other cases. */ static __always_inline bool @@ -2459,8 +2459,8 @@ arch_atomic64_inc_and_test(atomic64_t *v) * @i: integer value to add * @v: pointer of type atomic64_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic64_add_negative(s64 i, atomic64_t *v) @@ -2476,8 +2476,8 @@ arch_atomic64_add_negative(s64 i, atomic64_t *v) * @i: integer value to add * @v: pointer of type atomic64_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) @@ -2493,8 +2493,8 @@ arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) * @i: integer value to add * @v: pointer of type atomic64_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic64_add_negative_release(s64 i, atomic64_t *v) @@ -2510,8 +2510,8 @@ arch_atomic64_add_negative_release(s64 i, atomic64_t *v) * @i: integer value to add * @v: pointer of type atomic64_t * - * Atomically adds @i to @v and returns true if the result is negative, - * or false when the result is greater than or equal to zero. + * Atomically adds @i to @v and returns @true if the result is negative, + * or @false when the result is greater than or equal to zero. */ static __always_inline bool arch_atomic64_add_negative_relaxed(s64 i, atomic64_t *v) @@ -2592,7 +2592,7 @@ arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u) * @u: ...unless v is equal to u. * * Atomically adds @a to @v, if @v was not already @u. - * Returns true if the addition was done. + * Returns @true if the addition was done. */ static __always_inline bool arch_atomic64_add_unless(atomic64_t *v, s64 a, s64 u) @@ -2608,7 +2608,7 @@ arch_atomic64_add_unless(atomic64_t *v, s64 a, s64 u) * @v: pointer of type atomic64_t * * Atomically increments @v by 1, if @v is non-zero. - * Returns true if the increment was done. + * Returns @true if the increment was done. */ static __always_inline bool arch_atomic64_inc_not_zero(atomic64_t *v) @@ -2668,4 +2668,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 201cc01b616875888e0b2c79965c569a89c0edcd +// e914194a1a82dfbc39d4d1c79ce1f59f64fb37da diff --git a/scripts/atomic/fallbacks/add_negative b/scripts/atomic/fallbacks/add_negative index e5980abf5904..c032e8bec6e2 100755 --- a/scripts/atomic/fallbacks/add_negative +++ b/scripts/atomic/fallbacks/add_negative @@ -4,8 +4,8 @@ cat < X-Patchwork-Id: 92275 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3844337vqo; Wed, 10 May 2023 11:48:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4dranNORm6CzjC5SAxRyQXCTAfeRXzK5Llv6NEq6yvePv01WV/nY0Yv9dOhXB3SZoIFRG+ X-Received: by 2002:a17:90b:945:b0:24c:df8:8efa with SMTP id dw5-20020a17090b094500b0024c0df88efamr18537357pjb.39.1683744484901; Wed, 10 May 2023 11:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744484; cv=none; d=google.com; s=arc-20160816; b=09wltyc0qZdJcFj2lu5HSgfcODbQO5dOgpsBOSU6SnBmSb+WeGx77Fsq2jV93Vxghm bMSNJDWqMJCOHGG0Bgdz5OtWlGfSQl9X25OAhiPh8e+d6pZiqY0PLhB0/ik3Pld9jFvY m4b0J8El4bNts1XsbP5k8bUnsMmmyx7huiJYT58hn3/UbaCWVbEAIXm9oquhumVsCIuI 9Ay4aLnUs+9NHspOjFuqKiKIW4YN6NO+MQZToeJJDB9Nh9dGnDaLc1/HU118zH7hf5wn DjrnEyw9soikiubkh3c0kIZKrOv2pHD29iUt6i6y52vgvgUl6dMDWwRPQ5QgGRWOSzTX TTJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fESAnyUxyWRzQVPoLmwiwSH9Wu2b5R7e/KQ97joqibQ=; b=B3KlhH95TpCg/aQwNubGSBQW2wGvitELv42FFB1BHQKLShnaANWVhzq694qQ+tOvnZ uaDCK31Swu7R6VUfWZDk3sJM9bdYV+kWq2/KwTEgwojHwDmwBAfJD4LKha566HW/efJ9 Gd9k4e/fiaG0mJiwoYisHDQvVz09LIffNTGDySbKg2EoqEIY5jNVudtHgUbtl6hg9lVb wE71nTimLGHcxNISiML2xXwtdp07JMiMEIZtZXu4NUzqMTjAiliHOFZ/x6gwDVUuCaai QCAf6dKsen1uHgsk82tvEy4LwnvsE/p7fUSjEqGis6WEdl2nZEJCY8/7WBF2q7nKxTSM Qh4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GhQTAUXK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk1-20020a17090b4a0100b002524da9db57si1517545pjb.172.2023.05.10.11.47.52; Wed, 10 May 2023 11:48:04 -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=@kernel.org header.s=k20201202 header.b=GhQTAUXK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236284AbjEJSSa (ORCPT + 99 others); Wed, 10 May 2023 14:18:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjEJSSG (ORCPT ); Wed, 10 May 2023 14:18:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7406B7A9D; Wed, 10 May 2023 11:17:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0366663F81; Wed, 10 May 2023 18:17:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50F60C4339B; Wed, 10 May 2023 18:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742639; bh=UwZIwbcSgLfsaScEbsCZq/hnSjYCEy/ueiOBHUYJX6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GhQTAUXKMTyOnQFt7BEN9Y2D0WN99QxH3SqWLZWZzfHfGsk3XDp4e8r63Wmoaf4La x2aFHC2HX7iLHEFsERqXgtBPRRlezKgbsZQRQZQOrHB9FSA+9ol9nCiwyveyQFoz18 v3bRFf0Nx6taPwGFpCi0ZMOp0ogDYD5wufl7qPFZdKJfKbJDy2QMieXjywzo18k9nb imVCnaSdzav9fssB0HmPsPtASXkH32U0roh6B/uq8Wkjv/wSBkjSE0YUfWk/SzqAsj 4rBuhwAEyoKhit2rNb1+kb+Z6/n7kxT4TzKYqDHb2pfYutJFXdFH9hpZIVHoXlewH6 M8ai/dtpBfUzA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D603DCE134D; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 03/19] locking/atomic: Add kernel-doc and docbook_oldnew variables for headers Date: Wed, 10 May 2023 11:17:01 -0700 Message-Id: <20230510181717.2200934-3-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765534057242319788?= X-GMAIL-MSGID: =?utf-8?q?1765534057242319788?= The andnot, dec, inc, and try_cmpxchg files in the scripts/atomic/fallbacks directory do not supply kernel-doc headers. One reason for this is that there is currently no reasonably way to document either the ordering or whether the old or the new value is returned. Therefore, supply docbook_order and docbook_oldnew sh variables that contain the needed information. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- scripts/atomic/gen-atomic-fallback.sh | 17 +++++++++++++++++ scripts/atomic/gen-atomic-instrumented.sh | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/scripts/atomic/gen-atomic-fallback.sh b/scripts/atomic/gen-atomic-fallback.sh index 6e853f0dad8d..697da5f16f98 100755 --- a/scripts/atomic/gen-atomic-fallback.sh +++ b/scripts/atomic/gen-atomic-fallback.sh @@ -24,6 +24,23 @@ gen_template_fallback() local params="$(gen_params "${int}" "${atomic}" "$@")" local args="$(gen_args "$@")" + local docbook_order=full + if test "${order}" = "_relaxed" + then + local docbook_order=no + elif test -n "${order}" + then + docbook_order="`echo $order | sed -e 's/_//'`" + fi + local docbook_oldnew="new" + if test "${pfx}" = "fetch_" + then + docbook_oldnew="old" + elif test "${sfx}" != "_return" + then + docbook_oldnew="no" + fi + if [ ! -z "${template}" ]; then printf "#ifndef ${atomicname}\n" . ${template} diff --git a/scripts/atomic/gen-atomic-instrumented.sh b/scripts/atomic/gen-atomic-instrumented.sh index d9ffd74f73ca..99c72393d362 100755 --- a/scripts/atomic/gen-atomic-instrumented.sh +++ b/scripts/atomic/gen-atomic-instrumented.sh @@ -68,6 +68,23 @@ gen_proto_order_variant() local args="$(gen_args "$@")" local retstmt="$(gen_ret_stmt "${meta}")" + local docbook_order=full + if test "${order}" = "_relaxed" + then + local docbook_order=no + elif test -n "${order}" + then + docbook_order="`echo $order | sed -e 's/_//'`" + fi + local docbook_oldnew="new" + if test "${pfx}" = "fetch_" + then + docbook_oldnew="old" + elif test "${sfx}" != "_return" + then + docbook_oldnew="no" + fi + cat < X-Patchwork-Id: 92257 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3828693vqo; Wed, 10 May 2023 11:18:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52amSAhgxQzr4RgM9kQ2/+2xmV3dJkD1u0lBXgwKZLSu5OCCwqyQV6nBtfsv94vQZbUU0w X-Received: by 2002:a05:6a00:885:b0:63d:3595:26db with SMTP id q5-20020a056a00088500b0063d359526dbmr24368866pfj.23.1683742726558; Wed, 10 May 2023 11:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742726; cv=none; d=google.com; s=arc-20160816; b=r6xxCUMvHtfQsivigtiQlqNlCkPbs87SQOZpnJCg27MN/T3jmtU4oZITgJv6rfKR5k bCKAd5gflnfQJlk1mm4MBY1Ctax9A7tI4nlByFlAQETi2aPrUSkzPAw7K8eIEmeFfDtR 66yO+Fqjs3Uxi3ZNIa4z0mpG/ZO13X7+JIz42XbdSY6gveA0cSIL30gY5ddIiVRDeKVN 4W5H2CfScBRy66ZwYV3dUfebOCvIlWxqvLGfjCynBHhRyGiI+IrjBshk8i95VY3E3Y+G bbQrfSbAyGx9dPrREQSCI70gvtTMPs+vc9RW/4CfItrepLxy0Js2iXCAvqDKlT5A5+yg eN8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=21Qd0+XqJatcuA/kvwiAIAneLU3z8kAk984JRLf7fQg=; b=fNXEXGMWWoplqeQhY/VkVm+dUyjG59hRkrw7jMAqOOfk3eQvqqSOcc6H2acULs0BXQ ZDq4/lVLZuuqbBUwrkI2whdU76FIG4e4xNGbsaNIjYUn+0/AkPz7jlwUM1c/14mC+uGj tVr9T2cigeyfLhIu9Wfv1Hdtem6AidVFE56ER9g1V7AuF4K1nvcYjsoK2VRnK1yWnxoA bUktae1JPEEj4o9XJbH++7MLU1J6TzrslWBwz8RCEZ1ZrYwFHWz8jBJwbv95JzSxzqpO /2+KKb8w2Na/qs8nRzC7eZ18UTTnbhiJiDDcEPr//LM5g+oSaDKPCT7pr4P+pFVg3DFj 0E/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=swv48Cj1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a633719000000b0050aad8e18a5si4624211pga.545.2023.05.10.11.18.31; Wed, 10 May 2023 11:18:46 -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=@kernel.org header.s=k20201202 header.b=swv48Cj1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236042AbjEJSR5 (ORCPT + 99 others); Wed, 10 May 2023 14:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbjEJSRr (ORCPT ); Wed, 10 May 2023 14:17:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 450C87698; Wed, 10 May 2023 11:17:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1468F63F84; Wed, 10 May 2023 18:17:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B39EC4339E; Wed, 10 May 2023 18:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742639; bh=zZ3XxzsBzG+T4eWG6R7cIa9XtqUZca0NtqY/PyOE+Z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=swv48Cj1DjA/SiutaZI0kAPe3JBqdZVJj69UGOZftIExWF3qhIZqkZZOAWh83vSO5 a9VP3DvFqvvpszxK0GiRuAGbaYBGKDXTI1NgoT2E0evA4PrbQiG1ozJMO7Ep402ILQ /QThqrF6oNUKKHgIuk/NNVpJNaRir0ME6MHVpGF47m3LQOs3pnJdATnP++cBUELZ5D 5kt8v2dA4BU7ImSHvZBuG9jafj6ActIPAMgD2tFopWFNI9178lIUnQulcvNbqjK379 L3G303Nx+P6o8NADwMIOlb38RgN00GmSYIJOQxdVhChEdTQ/cqg/mPojGhXax7TtNG d8eQSA+Nxmv2A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D89F7CE1400; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 04/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}inc${sfx}${order} Date: Wed, 10 May 2023 11:17:02 -0700 Message-Id: <20230510181717.2200934-4-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532213305841488?= X-GMAIL-MSGID: =?utf-8?q?1765532213305841488?= Add kernel-doc header template for arch_${atomic}_${pfx}inc${sfx}${order} function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 128 +++++++++++++++++++- scripts/atomic/fallbacks/inc | 7 ++ 2 files changed, 134 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index 606be9d3aa22..e7e83f18d192 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -440,6 +440,13 @@ arch_atomic_fetch_sub(int i, atomic_t *v) #endif /* arch_atomic_fetch_sub_relaxed */ #ifndef arch_atomic_inc +/** + * arch_atomic_inc - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with full ordering, + * returning no value. + */ static __always_inline void arch_atomic_inc(atomic_t *v) { @@ -456,6 +463,13 @@ arch_atomic_inc(atomic_t *v) #endif /* arch_atomic_inc_return */ #ifndef arch_atomic_inc_return +/** + * arch_atomic_inc_return - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with full ordering, + * returning new value. + */ static __always_inline int arch_atomic_inc_return(atomic_t *v) { @@ -465,6 +479,13 @@ arch_atomic_inc_return(atomic_t *v) #endif #ifndef arch_atomic_inc_return_acquire +/** + * arch_atomic_inc_return_acquire - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with acquire ordering, + * returning new value. + */ static __always_inline int arch_atomic_inc_return_acquire(atomic_t *v) { @@ -474,6 +495,13 @@ arch_atomic_inc_return_acquire(atomic_t *v) #endif #ifndef arch_atomic_inc_return_release +/** + * arch_atomic_inc_return_release - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with release ordering, + * returning new value. + */ static __always_inline int arch_atomic_inc_return_release(atomic_t *v) { @@ -483,6 +511,13 @@ arch_atomic_inc_return_release(atomic_t *v) #endif #ifndef arch_atomic_inc_return_relaxed +/** + * arch_atomic_inc_return_relaxed - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with no ordering, + * returning new value. + */ static __always_inline int arch_atomic_inc_return_relaxed(atomic_t *v) { @@ -537,6 +572,13 @@ arch_atomic_inc_return(atomic_t *v) #endif /* arch_atomic_fetch_inc */ #ifndef arch_atomic_fetch_inc +/** + * arch_atomic_fetch_inc - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with full ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_inc(atomic_t *v) { @@ -546,6 +588,13 @@ arch_atomic_fetch_inc(atomic_t *v) #endif #ifndef arch_atomic_fetch_inc_acquire +/** + * arch_atomic_fetch_inc_acquire - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with acquire ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_inc_acquire(atomic_t *v) { @@ -555,6 +604,13 @@ arch_atomic_fetch_inc_acquire(atomic_t *v) #endif #ifndef arch_atomic_fetch_inc_release +/** + * arch_atomic_fetch_inc_release - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with release ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_inc_release(atomic_t *v) { @@ -564,6 +620,13 @@ arch_atomic_fetch_inc_release(atomic_t *v) #endif #ifndef arch_atomic_fetch_inc_relaxed +/** + * arch_atomic_fetch_inc_relaxed - Atomic increment + * @v: pointer of type atomic_t + * + * Atomically increment @v with no ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_inc_relaxed(atomic_t *v) { @@ -1656,6 +1719,13 @@ arch_atomic64_fetch_sub(s64 i, atomic64_t *v) #endif /* arch_atomic64_fetch_sub_relaxed */ #ifndef arch_atomic64_inc +/** + * arch_atomic64_inc - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with full ordering, + * returning no value. + */ static __always_inline void arch_atomic64_inc(atomic64_t *v) { @@ -1672,6 +1742,13 @@ arch_atomic64_inc(atomic64_t *v) #endif /* arch_atomic64_inc_return */ #ifndef arch_atomic64_inc_return +/** + * arch_atomic64_inc_return - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with full ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_inc_return(atomic64_t *v) { @@ -1681,6 +1758,13 @@ arch_atomic64_inc_return(atomic64_t *v) #endif #ifndef arch_atomic64_inc_return_acquire +/** + * arch_atomic64_inc_return_acquire - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with acquire ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_inc_return_acquire(atomic64_t *v) { @@ -1690,6 +1774,13 @@ arch_atomic64_inc_return_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_inc_return_release +/** + * arch_atomic64_inc_return_release - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with release ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_inc_return_release(atomic64_t *v) { @@ -1699,6 +1790,13 @@ arch_atomic64_inc_return_release(atomic64_t *v) #endif #ifndef arch_atomic64_inc_return_relaxed +/** + * arch_atomic64_inc_return_relaxed - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with no ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_inc_return_relaxed(atomic64_t *v) { @@ -1753,6 +1851,13 @@ arch_atomic64_inc_return(atomic64_t *v) #endif /* arch_atomic64_fetch_inc */ #ifndef arch_atomic64_fetch_inc +/** + * arch_atomic64_fetch_inc - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with full ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_inc(atomic64_t *v) { @@ -1762,6 +1867,13 @@ arch_atomic64_fetch_inc(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_inc_acquire +/** + * arch_atomic64_fetch_inc_acquire - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with acquire ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_inc_acquire(atomic64_t *v) { @@ -1771,6 +1883,13 @@ arch_atomic64_fetch_inc_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_inc_release +/** + * arch_atomic64_fetch_inc_release - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with release ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_inc_release(atomic64_t *v) { @@ -1780,6 +1899,13 @@ arch_atomic64_fetch_inc_release(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_inc_relaxed +/** + * arch_atomic64_fetch_inc_relaxed - Atomic increment + * @v: pointer of type atomic64_t + * + * Atomically increment @v with no ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_inc_relaxed(atomic64_t *v) { @@ -2668,4 +2794,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// e914194a1a82dfbc39d4d1c79ce1f59f64fb37da +// 17cefb0ff9b450685d4072202d4a1c309b0606c2 diff --git a/scripts/atomic/fallbacks/inc b/scripts/atomic/fallbacks/inc index 3c2c3739169e..3f2c0730cd0c 100755 --- a/scripts/atomic/fallbacks/inc +++ b/scripts/atomic/fallbacks/inc @@ -1,4 +1,11 @@ cat < X-Patchwork-Id: 92274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3844084vqo; Wed, 10 May 2023 11:47:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5qsHvqb5G2lL7b0TdJ3xkf+cBMxF6yCTx1nX6+BZT2dZ8EzRLEdIdKkv7l4yWbUjCuzZwZ X-Received: by 2002:a17:902:ce8d:b0:1aa:fc8c:8f1f with SMTP id f13-20020a170902ce8d00b001aafc8c8f1fmr23399172plg.50.1683744453798; Wed, 10 May 2023 11:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744453; cv=none; d=google.com; s=arc-20160816; b=k8Pn5l6C3fGabhVS4X+K0yqTdg9sndeIhKO32ay4x0pS6TawLSeJCdNM7s3oWyuHRc mMZ/1eDj+oHF4OUaZdCxG7gUzNGcc4lzGb46T/5J7tZUXv/um2bgfnHST3Be2sCwc6i6 NuepobcTKmlKVN2slyPwkgREcatA0EUw7ipC4MnZuE5SaEHPbAxTDWYJug2oQWDZ+x1D 7Mo8Xm/KmtTXnrmjaRZOPGozJpM3VnOWRflxsELjVc7WsGa5KTwsOqLZl69rimaA/fr9 xsCbTzGftoDSzfWWTcw+jBLwzjADcXbjAt64JgcmRk2lhLr1HIbL84QSUnc2blrtIUep JgIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SRK8r8xbV7ZJuJzuh+V/3Onr9hR1M/vGorAOOzIM0fs=; b=nuQToA/zMY+VNK6Jw7s15POuJBp3lUoMIvJmxK2S8E29zVor/QbtUtYT+A0C4rM9yR t14d8VTB3JYiodsGFVLjl9DQ5VHgOGQ6YvvwGoX9hVN0U0w6Ta/rN0DgIhZvzGQnsIoU 84YLZ5z07kdUoExiTVZCgtVnC+TtUGkD/mKjVsPrdB2MgXXlSp/4+9Tzw6fOFakZqQWn m/P/TCDqo2UIfV0zcMd/uiTVaGmA2XRAT7m3pOhTV3HyYykyPjX0G2/D1tq4sjwMyWFI cxndcxFtAi/IA4Ds97DvlLg4iBeOo1P/NqPqamO1LYX27HOl1B/iRphf76kn3vwSnXPC VELA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pGXkvifB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk1-20020a17090b4a0100b002524da9db57si1517545pjb.172.2023.05.10.11.47.21; Wed, 10 May 2023 11:47:33 -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=@kernel.org header.s=k20201202 header.b=pGXkvifB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236215AbjEJSSX (ORCPT + 99 others); Wed, 10 May 2023 14:18:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236114AbjEJSSF (ORCPT ); Wed, 10 May 2023 14:18:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7D2B7AA7; Wed, 10 May 2023 11:17:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1CFA663F85; Wed, 10 May 2023 18:17:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72391C4339C; Wed, 10 May 2023 18:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742639; bh=iiJ/VzQpstXqdm3RN63oyTIvoY5ZmUM0BoWf7nHGo3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pGXkvifBANBwFxv+VhyFewAoIZARO3vmZjp8qrln5HSEa39f99X5TL1K1btzJ+wze bH/wE4vffWqeAnEDdXwkuIYxOc3oyZCvOkYoXrz/BWKTjQswIn0Q1Jgv5RkwZ4CFBI xjvsZpoMkPBB1AwXZ8LXp8aa5SSh1TaU85MGp5mK4FNcOMKsuaMAQme9SxNvoND7q7 8M+I+qLP4mtAdh7By0Hgbr5cEw8Yd5QRa2E6MjaxwE6WcAwvO6rAzOpYzNPtbxvKDD DMahCot6e0rdpS9+VfermloCH/UpqRfK1l79qyTdddGG9O8Ho+hgQzNj/xmOIrFol7 beH4ALztdlpeA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DB181CE1434; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 05/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}dec${sfx}${order} Date: Wed, 10 May 2023 11:17:03 -0700 Message-Id: <20230510181717.2200934-5-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765534024673184473?= X-GMAIL-MSGID: =?utf-8?q?1765534024673184473?= Add kernel-doc header template for arch_${atomic}_${pfx}dec${sfx}${order} function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 128 +++++++++++++++++++- scripts/atomic/fallbacks/dec | 7 ++ 2 files changed, 134 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index e7e83f18d192..41e43e8dff8d 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -674,6 +674,13 @@ arch_atomic_fetch_inc(atomic_t *v) #endif /* arch_atomic_fetch_inc_relaxed */ #ifndef arch_atomic_dec +/** + * arch_atomic_dec - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with full ordering, + * returning no value. + */ static __always_inline void arch_atomic_dec(atomic_t *v) { @@ -690,6 +697,13 @@ arch_atomic_dec(atomic_t *v) #endif /* arch_atomic_dec_return */ #ifndef arch_atomic_dec_return +/** + * arch_atomic_dec_return - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with full ordering, + * returning new value. + */ static __always_inline int arch_atomic_dec_return(atomic_t *v) { @@ -699,6 +713,13 @@ arch_atomic_dec_return(atomic_t *v) #endif #ifndef arch_atomic_dec_return_acquire +/** + * arch_atomic_dec_return_acquire - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with acquire ordering, + * returning new value. + */ static __always_inline int arch_atomic_dec_return_acquire(atomic_t *v) { @@ -708,6 +729,13 @@ arch_atomic_dec_return_acquire(atomic_t *v) #endif #ifndef arch_atomic_dec_return_release +/** + * arch_atomic_dec_return_release - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with release ordering, + * returning new value. + */ static __always_inline int arch_atomic_dec_return_release(atomic_t *v) { @@ -717,6 +745,13 @@ arch_atomic_dec_return_release(atomic_t *v) #endif #ifndef arch_atomic_dec_return_relaxed +/** + * arch_atomic_dec_return_relaxed - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with no ordering, + * returning new value. + */ static __always_inline int arch_atomic_dec_return_relaxed(atomic_t *v) { @@ -771,6 +806,13 @@ arch_atomic_dec_return(atomic_t *v) #endif /* arch_atomic_fetch_dec */ #ifndef arch_atomic_fetch_dec +/** + * arch_atomic_fetch_dec - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with full ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_dec(atomic_t *v) { @@ -780,6 +822,13 @@ arch_atomic_fetch_dec(atomic_t *v) #endif #ifndef arch_atomic_fetch_dec_acquire +/** + * arch_atomic_fetch_dec_acquire - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with acquire ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_dec_acquire(atomic_t *v) { @@ -789,6 +838,13 @@ arch_atomic_fetch_dec_acquire(atomic_t *v) #endif #ifndef arch_atomic_fetch_dec_release +/** + * arch_atomic_fetch_dec_release - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with release ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_dec_release(atomic_t *v) { @@ -798,6 +854,13 @@ arch_atomic_fetch_dec_release(atomic_t *v) #endif #ifndef arch_atomic_fetch_dec_relaxed +/** + * arch_atomic_fetch_dec_relaxed - Atomic decrement + * @v: pointer of type atomic_t + * + * Atomically decrement @v with no ordering, + * returning old value. + */ static __always_inline int arch_atomic_fetch_dec_relaxed(atomic_t *v) { @@ -1953,6 +2016,13 @@ arch_atomic64_fetch_inc(atomic64_t *v) #endif /* arch_atomic64_fetch_inc_relaxed */ #ifndef arch_atomic64_dec +/** + * arch_atomic64_dec - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with full ordering, + * returning no value. + */ static __always_inline void arch_atomic64_dec(atomic64_t *v) { @@ -1969,6 +2039,13 @@ arch_atomic64_dec(atomic64_t *v) #endif /* arch_atomic64_dec_return */ #ifndef arch_atomic64_dec_return +/** + * arch_atomic64_dec_return - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with full ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_dec_return(atomic64_t *v) { @@ -1978,6 +2055,13 @@ arch_atomic64_dec_return(atomic64_t *v) #endif #ifndef arch_atomic64_dec_return_acquire +/** + * arch_atomic64_dec_return_acquire - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with acquire ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_dec_return_acquire(atomic64_t *v) { @@ -1987,6 +2071,13 @@ arch_atomic64_dec_return_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_dec_return_release +/** + * arch_atomic64_dec_return_release - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with release ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_dec_return_release(atomic64_t *v) { @@ -1996,6 +2087,13 @@ arch_atomic64_dec_return_release(atomic64_t *v) #endif #ifndef arch_atomic64_dec_return_relaxed +/** + * arch_atomic64_dec_return_relaxed - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with no ordering, + * returning new value. + */ static __always_inline s64 arch_atomic64_dec_return_relaxed(atomic64_t *v) { @@ -2050,6 +2148,13 @@ arch_atomic64_dec_return(atomic64_t *v) #endif /* arch_atomic64_fetch_dec */ #ifndef arch_atomic64_fetch_dec +/** + * arch_atomic64_fetch_dec - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with full ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_dec(atomic64_t *v) { @@ -2059,6 +2164,13 @@ arch_atomic64_fetch_dec(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_dec_acquire +/** + * arch_atomic64_fetch_dec_acquire - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with acquire ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_dec_acquire(atomic64_t *v) { @@ -2068,6 +2180,13 @@ arch_atomic64_fetch_dec_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_dec_release +/** + * arch_atomic64_fetch_dec_release - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with release ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_dec_release(atomic64_t *v) { @@ -2077,6 +2196,13 @@ arch_atomic64_fetch_dec_release(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_dec_relaxed +/** + * arch_atomic64_fetch_dec_relaxed - Atomic decrement + * @v: pointer of type atomic64_t + * + * Atomically decrement @v with no ordering, + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_dec_relaxed(atomic64_t *v) { @@ -2794,4 +2920,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 17cefb0ff9b450685d4072202d4a1c309b0606c2 +// 1a1d30491494653253bfe3b5d2e2c6583cb57473 diff --git a/scripts/atomic/fallbacks/dec b/scripts/atomic/fallbacks/dec index 8c144c818e9e..e99c8edd36a3 100755 --- a/scripts/atomic/fallbacks/dec +++ b/scripts/atomic/fallbacks/dec @@ -1,4 +1,11 @@ cat < X-Patchwork-Id: 92260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3829241vqo; Wed, 10 May 2023 11:19:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/sRx/7VrQgaBz6vWV26AiVj/1Trrf+1lOIwtK5xi5hHaS6/DwzFa6ChfvuWS8ovNtK9kx X-Received: by 2002:a17:90b:85:b0:246:91d0:9e6f with SMTP id bb5-20020a17090b008500b0024691d09e6fmr18672049pjb.3.1683742790436; Wed, 10 May 2023 11:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742790; cv=none; d=google.com; s=arc-20160816; b=E+63k/bq1t/GqixEqxUUuGMablDP3mWRXcLJGSbW5JVm9K6esK1bVn143/uUztfewp 7ppfuH4d2Rtr7tDKPkUIlP5xiE9DKQJYMzuUM+cwxMN9MdphtkDWx03IEz8E46vS46KP 8bjWT6L44bGYD9B221Kb6QQ7CDxGuf6D0pLVa+IHnBNBQoCpeLpUiyI1W9HjbR9ejM+o u22kx/IkNCVmpkS63hY8dvV7U0VnJhSHtgDXC7RIgyOxRqZ9j4WbSykZek1vfbqDYEZl 1S2yfYwIxpn2KcbyHMSZF1GP7+0Xte0NATSomIQgfddq7HxIep0Ea/n3CK1uk1lNr0tU PJ9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1vsdFZ8p2aFKiyOXdjunNHkx5V4TcQnFUxl/fBEBaBM=; b=jPStwN7U/dBpONH0nT4116XTVa7VD+LFfBrwz84NPyXbrIzNfxRroCLX9Bb/ZJbbH/ B1ntJXj3KvJCMT8F30wfE0Nj0CzGJVwutpSMDmVjWzwC5K7rasgAMd5pr22TqezuZ3wK Qp/vkoe95RSSkzYXNDYssvXg8p7TFcFXqlTxc3bt+/cutTIeXxezC3pWtZODYZBgEva4 YuRTXqcDsJOQU2ZlhBXVNY7FPx3OxS/3XNRyuTTFxRBnszGaeZc2L82g66ds59s8I4xJ j8wvQM43DgqQk+5zmDKG/m9au8/56NBW+UFIvay3MZI6oWNnJRitQT46a7Qjj2FVqyoO Fp0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PkJiGnQe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mz7-20020a17090b378700b0024e0eec665fsi18292934pjb.73.2023.05.10.11.19.33; Wed, 10 May 2023 11:19:50 -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=@kernel.org header.s=k20201202 header.b=PkJiGnQe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236404AbjEJSTA (ORCPT + 99 others); Wed, 10 May 2023 14:19:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236076AbjEJSSQ (ORCPT ); Wed, 10 May 2023 14:18:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E76457ED6; Wed, 10 May 2023 11:18:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 317EB63F87; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 970B4C433D2; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=0NNr6pXpT4nPPvOEzgx3h6iYrhe2MKVVK49PaoO8bUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PkJiGnQerc3TzX9FDzvkK0UUi8VoowqO17Bvc8Qkmk4MgxT0yW1ov0ieLq/k85k04 53uap/CnEtEHlOQDl4Nvh/O7z1phP+S2JjGGbRGPZIDCXLLywN3DUnQlpt/UXo330q niA/E173A+Fewiy5EMprfUqmqE1AGqkblzsb1a1SYhWOKjRJMmcF8Qx1A395qKvaGy Dg4uIZ97XwwFRs9hIbOqWEx92vvWSycBV+qrUnJpXKnjHp70Fx2ol4e1dQN8yOet0q lZDjjBKHNUIVPxvc6XSwKl/w3aX37wPfqX4XNNKf8HJIEIozqslPe5DM5HYjHYP//t FJ0D2H36Wxftw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DD7FECE16A7; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 06/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}andnot${sfx}${order} Date: Wed, 10 May 2023 11:17:04 -0700 Message-Id: <20230510181717.2200934-6-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532280117960642?= X-GMAIL-MSGID: =?utf-8?q?1765532280117960642?= Add kernel-doc header template for arch_${atomic}_${pfx}andnot${sfx}${order} function family. [ paulmck: Apply feedback from Akira Yokosawa. ] Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 82 ++++++++++++++++++++- scripts/atomic/fallbacks/andnot | 8 ++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index 41e43e8dff8d..d5ff29a7128d 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -950,6 +950,14 @@ arch_atomic_fetch_and(int i, atomic_t *v) #endif /* arch_atomic_fetch_and_relaxed */ #ifndef arch_atomic_andnot +/** + * arch_atomic_andnot - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic_t + * + * Atomically and-not @i with @v using full ordering. + * returning no value. + */ static __always_inline void arch_atomic_andnot(int i, atomic_t *v) { @@ -966,6 +974,14 @@ arch_atomic_andnot(int i, atomic_t *v) #endif /* arch_atomic_fetch_andnot */ #ifndef arch_atomic_fetch_andnot +/** + * arch_atomic_fetch_andnot - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic_t + * + * Atomically and-not @i with @v using full ordering. + * returning old value. + */ static __always_inline int arch_atomic_fetch_andnot(int i, atomic_t *v) { @@ -975,6 +991,14 @@ arch_atomic_fetch_andnot(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_andnot_acquire +/** + * arch_atomic_fetch_andnot_acquire - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic_t + * + * Atomically and-not @i with @v using acquire ordering. + * returning old value. + */ static __always_inline int arch_atomic_fetch_andnot_acquire(int i, atomic_t *v) { @@ -984,6 +1008,14 @@ arch_atomic_fetch_andnot_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_andnot_release +/** + * arch_atomic_fetch_andnot_release - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic_t + * + * Atomically and-not @i with @v using release ordering. + * returning old value. + */ static __always_inline int arch_atomic_fetch_andnot_release(int i, atomic_t *v) { @@ -993,6 +1025,14 @@ arch_atomic_fetch_andnot_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_andnot_relaxed +/** + * arch_atomic_fetch_andnot_relaxed - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic_t + * + * Atomically and-not @i with @v using no ordering. + * returning old value. + */ static __always_inline int arch_atomic_fetch_andnot_relaxed(int i, atomic_t *v) { @@ -2292,6 +2332,14 @@ arch_atomic64_fetch_and(s64 i, atomic64_t *v) #endif /* arch_atomic64_fetch_and_relaxed */ #ifndef arch_atomic64_andnot +/** + * arch_atomic64_andnot - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic64_t + * + * Atomically and-not @i with @v using full ordering. + * returning no value. + */ static __always_inline void arch_atomic64_andnot(s64 i, atomic64_t *v) { @@ -2308,6 +2356,14 @@ arch_atomic64_andnot(s64 i, atomic64_t *v) #endif /* arch_atomic64_fetch_andnot */ #ifndef arch_atomic64_fetch_andnot +/** + * arch_atomic64_fetch_andnot - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic64_t + * + * Atomically and-not @i with @v using full ordering. + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_andnot(s64 i, atomic64_t *v) { @@ -2317,6 +2373,14 @@ arch_atomic64_fetch_andnot(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_andnot_acquire +/** + * arch_atomic64_fetch_andnot_acquire - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic64_t + * + * Atomically and-not @i with @v using acquire ordering. + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v) { @@ -2326,6 +2390,14 @@ arch_atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_andnot_release +/** + * arch_atomic64_fetch_andnot_release - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic64_t + * + * Atomically and-not @i with @v using release ordering. + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_andnot_release(s64 i, atomic64_t *v) { @@ -2335,6 +2407,14 @@ arch_atomic64_fetch_andnot_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_andnot_relaxed +/** + * arch_atomic64_fetch_andnot_relaxed - Atomic and-not + * @i: the quantity to and-not with *@v + * @v: pointer of type atomic64_t + * + * Atomically and-not @i with @v using no ordering. + * returning old value. + */ static __always_inline s64 arch_atomic64_fetch_andnot_relaxed(s64 i, atomic64_t *v) { @@ -2920,4 +3000,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 1a1d30491494653253bfe3b5d2e2c6583cb57473 +// e403f06ce98fe72ae0698e8f2c78f8a45894e465 diff --git a/scripts/atomic/fallbacks/andnot b/scripts/atomic/fallbacks/andnot index 5a42f54a3595..9fbc0ce75a7c 100755 --- a/scripts/atomic/fallbacks/andnot +++ b/scripts/atomic/fallbacks/andnot @@ -1,4 +1,12 @@ cat < X-Patchwork-Id: 92268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3840425vqo; Wed, 10 May 2023 11:40:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ktSxN23LQSyxkIYAg2km3KYgK77Tkg3sXEa4Ka6op5rGzeZdKzylbaKMdwg8zGbDCWYSk X-Received: by 2002:a05:6a21:3299:b0:100:6863:8be7 with SMTP id yt25-20020a056a21329900b0010068638be7mr14576587pzb.62.1683744056042; Wed, 10 May 2023 11:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744056; cv=none; d=google.com; s=arc-20160816; b=ZKOpDpuAPJLpq7oX2BRw9actiiczuSLW62kKobwkSjJBPfgAj+S6tpzLNISPYocRNo eRgxqWgUdJbd2fM+tYq2kR5LK+jau6vTmzPWNCVrYxjPiTlIBsMj0um7PYH9W8CFRdmS KD6VtbN3SxBdLKraHV8iRdXZvVQzBLon+sR05mmU0l8KrQ4iwkw3nEUenCZHddpZ9eTF 4J09SpIAWPdY0Psu6Pi3iJhvi0EeVzMMmGn2uB6L+LcruKBMH3DrUB0ePs74UKU3hhZ4 p04REVCBu6fkKrNGyq8ShrW66fS4PBXTvDwCyxxlsNNq8F1Pfow2LI5yFNSfkrfK8FBA mjww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aVVWiTo16l58AxYf7GWfP6j8l3i2d8aJsOtbQzrObbk=; b=RIuntpvfHgjqN/UMo5oDY74Gafw3rwu7WcHlkpGvZUWD0u+1nz94JX4R9WQjnnf1W5 GcVhJF2RJWZ2xT0Z/k2ymGyEwyQzC7g9yWnbWpyF19aJQICi322T8hDj8dPqoODmkL/C vr0ZSfgvr0bDRDHHHXawVumvSCiWMpGdh6Bup8acoSpinsvKuI/5LQwAC/Hp0YCEupfo odPNvSKybaK8KDKrgBYZa88qrVBkp62kHvpotnJXCM8/BJLbr8U0NJRKztCK/VBOwn2c IND6Hdt5DapbD+u57BcJ3SkrzPcqlSdfu1l2iyKw6Pa0YWI63n5aHU9nVlsPY0L0UOgx Llcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TUE0DR8K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020aa78f27000000b0064354230c2asi5510635pfr.367.2023.05.10.11.40.43; Wed, 10 May 2023 11:40:56 -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=@kernel.org header.s=k20201202 header.b=TUE0DR8K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235708AbjEJSTS (ORCPT + 99 others); Wed, 10 May 2023 14:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236117AbjEJSST (ORCPT ); Wed, 10 May 2023 14:18:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4C4D659D; Wed, 10 May 2023 11:18:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C27F063F92; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA228C433A7; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=cpvv3VEJW+5eargd3gZNCUUoeAAIBIzdoTFRowhV52A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TUE0DR8KKEgUfULoaQ+FPC48KAJ1L4SA47gpCRvQARqdCe61E9oPwdXH5TvmAMA1N Ximd1pFgunErS+/C2N7OswCuWRiBM2JrRGZrbVNKpa6jMch5KLANSc7n9Hz1opC1lg 7I9ym2zcUBki9qM2mDr23AcFxIdIQBqfAeDiCfQ9kDk0+gwy4YJBGjI+aaOC3XuhcN 2zMAHHHwArF12aGVqQCrGQ3PtH6JxeRAMBWQqJanuNjgpNq55KYM4jQeS/4oG5ichb B5O4g4J81HHy77Mrt2dUPkQn/Xd0Sq53vgt31PPCyeDqCiZ0l1MMq91uPqZ5gyGmgJ 2lmUW3agwjV+g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E039ACE18F0; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 07/19] locking/atomic: Add kernel-doc header for arch_${atomic}_try_cmpxchg${order} Date: Wed, 10 May 2023 11:17:05 -0700 Message-Id: <20230510181717.2200934-7-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765533607386189179?= X-GMAIL-MSGID: =?utf-8?q?1765533607386189179?= Add kernel-doc header template for arch_${atomic}_try_cmpxchg${order} function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 82 ++++++++++++++++++++- scripts/atomic/fallbacks/try_cmpxchg | 10 +++ 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index d5ff29a7128d..ed72d94346e9 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1255,6 +1255,16 @@ arch_atomic_cmpxchg(atomic_t *v, int old, int new) #endif /* arch_atomic_try_cmpxchg */ #ifndef arch_atomic_try_cmpxchg +/** + * arch_atomic_try_cmpxchg - Atomic cmpxchg with bool return value + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing full ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic_try_cmpxchg(atomic_t *v, int *old, int new) { @@ -1268,6 +1278,16 @@ arch_atomic_try_cmpxchg(atomic_t *v, int *old, int new) #endif #ifndef arch_atomic_try_cmpxchg_acquire +/** + * arch_atomic_try_cmpxchg_acquire - Atomic cmpxchg with bool return value + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing acquire ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new) { @@ -1281,6 +1301,16 @@ arch_atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new) #endif #ifndef arch_atomic_try_cmpxchg_release +/** + * arch_atomic_try_cmpxchg_release - Atomic cmpxchg with bool return value + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing release ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic_try_cmpxchg_release(atomic_t *v, int *old, int new) { @@ -1294,6 +1324,16 @@ arch_atomic_try_cmpxchg_release(atomic_t *v, int *old, int new) #endif #ifndef arch_atomic_try_cmpxchg_relaxed +/** + * arch_atomic_try_cmpxchg_relaxed - Atomic cmpxchg with bool return value + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing no ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic_try_cmpxchg_relaxed(atomic_t *v, int *old, int new) { @@ -2637,6 +2677,16 @@ arch_atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new) #endif /* arch_atomic64_try_cmpxchg */ #ifndef arch_atomic64_try_cmpxchg +/** + * arch_atomic64_try_cmpxchg - Atomic cmpxchg with bool return value + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing full ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new) { @@ -2650,6 +2700,16 @@ arch_atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new) #endif #ifndef arch_atomic64_try_cmpxchg_acquire +/** + * arch_atomic64_try_cmpxchg_acquire - Atomic cmpxchg with bool return value + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing acquire ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new) { @@ -2663,6 +2723,16 @@ arch_atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new) #endif #ifndef arch_atomic64_try_cmpxchg_release +/** + * arch_atomic64_try_cmpxchg_release - Atomic cmpxchg with bool return value + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing release ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new) { @@ -2676,6 +2746,16 @@ arch_atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new) #endif #ifndef arch_atomic64_try_cmpxchg_relaxed +/** + * arch_atomic64_try_cmpxchg_relaxed - Atomic cmpxchg with bool return value + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, stores @new to *@v, + * providing no ordering. + * Returns @true if the cmpxchg operation succeeded, and false otherwise. + */ static __always_inline bool arch_atomic64_try_cmpxchg_relaxed(atomic64_t *v, s64 *old, s64 new) { @@ -3000,4 +3080,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// e403f06ce98fe72ae0698e8f2c78f8a45894e465 +// 3b29d5595f48f921507f19bc794c91aecb782ad3 diff --git a/scripts/atomic/fallbacks/try_cmpxchg b/scripts/atomic/fallbacks/try_cmpxchg index 890f850ede37..baf7412f9bf4 100755 --- a/scripts/atomic/fallbacks/try_cmpxchg +++ b/scripts/atomic/fallbacks/try_cmpxchg @@ -1,4 +1,14 @@ cat < X-Patchwork-Id: 92263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3830092vqo; Wed, 10 May 2023 11:21:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43p/12GBdX5odX1Bx4mhHfrTSYtYMctDK5pkrDvnsJgD6LBya0IoyMr6FAmkTBpXwZnVU6 X-Received: by 2002:a05:6a20:5483:b0:100:442b:52f8 with SMTP id i3-20020a056a20548300b00100442b52f8mr14681271pzk.22.1683742887222; Wed, 10 May 2023 11:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742887; cv=none; d=google.com; s=arc-20160816; b=W7GXHyoaPMAqEHseGP7HjoJj91vFfDJwFMKnEMs6HbnJXlZP243ZpwWZP4wmlpbikr w4YXdlELByodQgXWQ6Tc0TqqZJdfhcFRSZusTm2v6isK1r5z8pZvysX3ufRqRObqKRfC gl3wZUPYehhPFbF69kyw9AYezGf2ow6gjhXFjMHz2auSGXc6gygc+96N0yWeaXo3Qq7P GSBsFqHalkV2U9bTgLPogea+m5AFfJ/IFRt/OTHlLy7YXbFmsv60/pp5Ab1fW6TC4bXx OaPZa9SgUfLx2FcYGF+mkkx0F9VXdTVxpcx+cpV+PXtzryUsgOgWa/OppmGYH16wjCRR 0FoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NHuC+8jlI7bfnoyqxU4mlGdTZF3jMrWMDyfLelsJaTw=; b=TQnCD073ziEW14RIzP27OaJVQVfCA9ZeArMIvgVcpRpFcHLZw0sPcAZlGJwkJvtpde Mv89luziRq6O4ktWCy4j0JE4ehI39Ucn1W0CogQw2P8u28z0kha3I1bpmfz0w35taPp0 Rt63/lX5nT2iLkofgMQKROjItJ3Na4LzBozrBqT94NtUj4kUqMDJqlwiQb56S6+YB+Y1 ZUv/JLerbdA5QdqgvvrEaMid4w600TAz2i6N/E2UGAeu1SNRj67u1MOsYR/CtYYB/b9K sO3ZlblAmDww0HKbuAodY4ISKzhDuqujMtyGIjydLIyiDVrCNvtmJMSX3wEgr5zmV+sC +Vng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ikm2NLQz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a633719000000b0050aad8e18a5si4624211pga.545.2023.05.10.11.21.12; Wed, 10 May 2023 11:21:27 -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=@kernel.org header.s=k20201202 header.b=Ikm2NLQz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236620AbjEJST3 (ORCPT + 99 others); Wed, 10 May 2023 14:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236175AbjEJSSV (ORCPT ); Wed, 10 May 2023 14:18:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D0AE8691; Wed, 10 May 2023 11:18:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B804263F8C; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7BE4C433A1; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=8scz+UOnvZTcnS7Ykx6CtnedJmiFq1UdjUUnARLlRyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ikm2NLQzY332FjMNQM5/hRKYkRj1qvK9ycCfMuNvYarVrdkH7vu9gGrRyZzmY39W3 csCAizD3aExQlgib+ooni6h+XqWhfDENU0i4TX4ordvGKdI+LcmEEmHi8WcSw8BxeU KCyFlSqhuxoaEYD/zv9ggp7VUAMRCS+MtSMsNarZSe2eBE55lvF/rDi4EUSutdhjBm jod4i728JsV3IwNVAEZs9audTUe7WRlVUaj7DoqsgEGleeLf8InmphipjzJVtwiDIt xv9Xx2nhOLMQXNVBdpZp2G7CfiHA/p6V6B7sIhiJZV3jVWWOQssXQFBWqxj66ArXCb zU/CeO0M/1dTA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E2BB4CE1BC1; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 08/19] locking/atomic: Add kernel-doc header for arch_${atomic}_dec_if_positive Date: Wed, 10 May 2023 11:17:06 -0700 Message-Id: <20230510181717.2200934-8-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532381647654582?= X-GMAIL-MSGID: =?utf-8?q?1765532381647654582?= Add kernel-doc header template for arch_${atomic}_dec_if_positive function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 22 ++++++++++++++++++++- scripts/atomic/fallbacks/dec_if_positive | 10 ++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index ed72d94346e9..4d4d94925cb0 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1641,6 +1641,16 @@ arch_atomic_dec_unless_positive(atomic_t *v) #endif #ifndef arch_atomic_dec_if_positive +/** + * arch_atomic_dec_if_positive - Atomic decrement if old value is positive + * @v: pointer of type atomic_t + * + * Atomically decrement @v, but only if the original value is greater than zero, + * returning new value. Note that the desired new value will be returned + * even if the decrement did not occur, so that if the old value is -3, then + * there @v will not be decremented, but -4 will be returned. As a result, + * if the return value is non-negative, then the value was in fact decremented. + */ static __always_inline int arch_atomic_dec_if_positive(atomic_t *v) { @@ -3063,6 +3073,16 @@ arch_atomic64_dec_unless_positive(atomic64_t *v) #endif #ifndef arch_atomic64_dec_if_positive +/** + * arch_atomic64_dec_if_positive - Atomic decrement if old value is positive + * @v: pointer of type atomic64_t + * + * Atomically decrement @v, but only if the original value is greater than zero, + * returning new value. Note that the desired new value will be returned + * even if the decrement did not occur, so that if the old value is -3, then + * there @v will not be decremented, but -4 will be returned. As a result, + * if the return value is non-negative, then the value was in fact decremented. + */ static __always_inline s64 arch_atomic64_dec_if_positive(atomic64_t *v) { @@ -3080,4 +3100,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 3b29d5595f48f921507f19bc794c91aecb782ad3 +// c7041896e7e66a52d8005ba021f3b3b05f99bcb3 diff --git a/scripts/atomic/fallbacks/dec_if_positive b/scripts/atomic/fallbacks/dec_if_positive index 86bdced3428d..dedbdbc1487d 100755 --- a/scripts/atomic/fallbacks/dec_if_positive +++ b/scripts/atomic/fallbacks/dec_if_positive @@ -1,4 +1,14 @@ cat < X-Patchwork-Id: 92258 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3828831vqo; Wed, 10 May 2023 11:19:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7rIjrEGLrPIY0OLR1vIM1ulBp2TAAdQ71jdu5T4lkX+J9sG3zgZVOLeJ77evu+OuuvCNCK X-Received: by 2002:a05:6a20:4285:b0:100:7ac0:b32d with SMTP id o5-20020a056a20428500b001007ac0b32dmr14509342pzj.44.1683742743964; Wed, 10 May 2023 11:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742743; cv=none; d=google.com; s=arc-20160816; b=tEO9AB23Gpmu7vKa3G92Deiumttr/Wi1llIIJ2Zkv9X/BahNx544ZD/wrKjB4HG8jm 7naU1Wm09bns2B1vt/q4Wp/j9+b1kuQZXzCqG/ly/PtGTOD/716l8+nnBmj6XzBEiuXb cA+TYkOys+xCvXnXSyWvJf5p6eWXtgvXyrejApb++x1nNaIrkn1GXJDFHMAGhB/foJ4n 6mG1A4UXl/5kkoK3UGKDE94tL6Gvfzbk7ugKelJT6wGqcvWZYsK3CUp75tmDySTv9wYp 2rbePUv5euD3xuEdg28wqrUUotm2ONsknwrmXY8b9OvPafbUYuqmsDaf+1gVLCKbsNHu sPAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=A7bbr8+iLCKU83UMzTEzYPojmEwM9IK7vZiRuk3Gao0=; b=oHvu1V8YKR9ojyNTUmfpxoe+CLV1wdZ2quWykYhjJIB3SvN1xNoo9AzsJM9ZC092Wh nU+SkbcOm+fzENJEJfha0edS4gvETkqgAPynDg7KizLmVSKucICGzlhCLrMg22CqxmAv WAGPd1ASoHS3ATSdEaTlqmVpAmfprUx9yl/RQV5n4Y7dikh92Yxk0BLJxJPfL3eKIJIh Ywp+siZg5dpeeZ5cGYAlkiZKSBQPKGALAjbdrLYudz8AkS+G4sLpP/Qduin7B9Hep2jI Vhkor/J644vJEirKA0XE2XXiLJX6dwTHF41cPnrV6X/6JoRt/9T5e6EQYJSWpJyMNhpL JTcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YsOXDi3w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020aa799c7000000b006434e20d023si5336640pfi.399.2023.05.10.11.18.44; Wed, 10 May 2023 11:19:03 -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=@kernel.org header.s=k20201202 header.b=YsOXDi3w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235824AbjEJSSN (ORCPT + 99 others); Wed, 10 May 2023 14:18:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236102AbjEJSSF (ORCPT ); Wed, 10 May 2023 14:18:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C76307AA5; Wed, 10 May 2023 11:17:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2CA5663F7D; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F1E7C4339C; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=FJU5RCiZpCrQOcJ2eziBcfOGyF3Kln3b8QgDAQjPb0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YsOXDi3wcldqoNlczsWnUe0VqUlSDba9kRlBkTjBNyD5GfWBuPsQ6GMqNIy3ZxO73 Fofi/sB282sOwraaAHmdPVfVYdRYGRJErdiEFiDEL7dus4SnzmP9C24g5YF10XAPc9 Q3zVOE9TdfIQDdH8pPduLG6Bk5uqP1evwK+U9fjrKdMW0oHUnS46EsbSt7z1XbaciT vW7LaqDpej4orDgfHVFIemJoyvJzWD74aTacJHOiZ7c8POxIpSqeugknoZSPD7ibt5 JoXltZkq1O2tmZIoUpH9RUSJJKdNmCY7q8pFu1pyY9EeGfZglkS60RYU7mD8JSnmrT pVP8EKLCbsziQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E537DCE1C80; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 09/19] locking/atomic: Add kernel-doc header for arch_${atomic}_dec_unless_positive Date: Wed, 10 May 2023 11:17:07 -0700 Message-Id: <20230510181717.2200934-9-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532231505221006?= X-GMAIL-MSGID: =?utf-8?q?1765532231505221006?= Add kernel-doc header template for arch_${atomic}_dec_unless_positive function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 18 +++++++++++++++++- scripts/atomic/fallbacks/dec_unless_positive | 8 ++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index 4d4d94925cb0..e6c7356d5dfc 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1625,6 +1625,14 @@ arch_atomic_inc_unless_negative(atomic_t *v) #endif #ifndef arch_atomic_dec_unless_positive +/** + * arch_atomic_dec_unless_positive - Atomic decrement if old value is non-positive + * @v: pointer of type atomic_t + * + * Atomically decrement @v, but only if the original value is less + * than or equal to zero. Return @true if the decrement happened and + * @false otherwise. + */ static __always_inline bool arch_atomic_dec_unless_positive(atomic_t *v) { @@ -3057,6 +3065,14 @@ arch_atomic64_inc_unless_negative(atomic64_t *v) #endif #ifndef arch_atomic64_dec_unless_positive +/** + * arch_atomic64_dec_unless_positive - Atomic decrement if old value is non-positive + * @v: pointer of type atomic64_t + * + * Atomically decrement @v, but only if the original value is less + * than or equal to zero. Return @true if the decrement happened and + * @false otherwise. + */ static __always_inline bool arch_atomic64_dec_unless_positive(atomic64_t *v) { @@ -3100,4 +3116,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// c7041896e7e66a52d8005ba021f3b3b05f99bcb3 +// 225b2fe3eb6bbe34729abed7a856b91abc8d434e diff --git a/scripts/atomic/fallbacks/dec_unless_positive b/scripts/atomic/fallbacks/dec_unless_positive index c531d5afecc4..c3d01d201c63 100755 --- a/scripts/atomic/fallbacks/dec_unless_positive +++ b/scripts/atomic/fallbacks/dec_unless_positive @@ -1,4 +1,12 @@ cat < X-Patchwork-Id: 92259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3829095vqo; Wed, 10 May 2023 11:19:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WZGmzFKMrrKWucUS4FQkzbfVUv44fqdn3aia4HcCt2+UbwXkZzx/dFcmbAGO0EaN4AaPy X-Received: by 2002:a17:902:b702:b0:1aa:f3c4:74ea with SMTP id d2-20020a170902b70200b001aaf3c474eamr19333925pls.53.1683742775274; Wed, 10 May 2023 11:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742775; cv=none; d=google.com; s=arc-20160816; b=ClAwGKUPMhIMNtHa6PySwxYl3eio5fZt6MQChYJ9x9iK2b1gauhyxif1zEaG/tCdnx kk1WzM1vAtoDX+35dVCWK1MAb7WWV9F/od+E+UD/g+DiXCGR2b/tyzY3ZjaQxh4NpwHZ 45GCjM0AxGIiVD0roHu0Ub/JtWjuOCzDYUgWKVH5L3Jah/EbkFddh8ae3iX6R05NM0aN /WTaYOFSrlnIZbAn1RWhaRat/CoM3XZIS31D2sPWgPs6wi4l3e4V6RO1o5AHS5L8CVOh zNDJp0leHPYQV9urMPLgNv/n22yInUKvQOLFVaAvB6oLmPVMA1WQFTycJivtUH7H60nU X6tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O/7ZpNtwcFKLHmXgB4vUQ9B7dXsN3EzGuM0tGUcYnGs=; b=rG6PfIz0DZ9d3W3rS5m1RtrG+ROt7/wbEPRK77la2BGV4bUcPYef5TZKi+gCgDjqbm YDO1lRc8eqvfAFRcG+wQS1QZi2Vojk/ab0kTtExvpfAYQ3kzNeXPL2E4o2ygZCE55RgI +07rar+Y/WoUQ1uPnmr1drxHpgCpwQym08/5gLMai8iCQlN0/qwBYCEirCxUrbnLAqA3 KdLrbfCUAMzYD6ZzvYesRVnvMN33+3PPIObE+Dco16B+RLM1+ZrB1Cvq09KKXkrOzZaz R2SLh4+x8SRurqLW4Uryr9QU1dVslojXdLBALNGhnubUqTNqjb5pgwo60aS9AEcWnU5S x1DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Em+tJutP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jk7-20020a170903330700b001aaebc66877si4448529plb.147.2023.05.10.11.19.19; Wed, 10 May 2023 11:19:35 -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=@kernel.org header.s=k20201202 header.b=Em+tJutP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236303AbjEJSSf (ORCPT + 99 others); Wed, 10 May 2023 14:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236057AbjEJSSP (ORCPT ); Wed, 10 May 2023 14:18:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6EA07DBD; Wed, 10 May 2023 11:18:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 383C563F89; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0B34C433EF; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=5orfwLg08dIm14Vms6sjyzzLD3V/C5KXtMlKMkWcY24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Em+tJutPuctz8SiLrvZzic/5pGf+w4amVFJR944sz9bai88jhwKqi+nkCtPNnUE4n gvJ7WNeAmDAecOWnnm9LAhq1pOA7s5sF+Aj1HfAG2b7ec6xio+WcM5tEVk6D9eVBAJ xaDu4viqi/AhOtY/Y7OAhfY+lsgFYFsk4Y19MQg8wh57lYQGCpXlpddJjK3q2TzDhj pOYVPPG5/nJgGCaZPksnNeYZYE4+Ek7oPmPbBmBtpy7wtFkFjLB09x1gJce76W7rpR qqFOumnKGEA+Fxy9CHm41NYF0K4a1/CpYljDtxu7CiuY4N2f/Cj6qJe7UvpYm69xX0 yGHqD5hGTjgrA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E8047CE1D7A; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 10/19] locking/atomic: Add kernel-doc header for arch_${atomic}_inc_unless_negative Date: Wed, 10 May 2023 11:17:08 -0700 Message-Id: <20230510181717.2200934-10-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532263850771165?= X-GMAIL-MSGID: =?utf-8?q?1765532263850771165?= Add kernel-doc header template for arch_${atomic}_inc_unless_negative function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 18 +++++++++++++++++- scripts/atomic/fallbacks/inc_unless_negative | 8 ++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index e6c7356d5dfc..a90ee496bb81 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1609,6 +1609,14 @@ arch_atomic_inc_not_zero(atomic_t *v) #endif #ifndef arch_atomic_inc_unless_negative +/** + * arch_atomic_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type atomic_t + * + * Atomically increment @v, but only if the original value is greater + * than or equal to zero. Return @true if the increment happened and + * @false otherwise. + */ static __always_inline bool arch_atomic_inc_unless_negative(atomic_t *v) { @@ -3049,6 +3057,14 @@ arch_atomic64_inc_not_zero(atomic64_t *v) #endif #ifndef arch_atomic64_inc_unless_negative +/** + * arch_atomic64_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type atomic64_t + * + * Atomically increment @v, but only if the original value is greater + * than or equal to zero. Return @true if the increment happened and + * @false otherwise. + */ static __always_inline bool arch_atomic64_inc_unless_negative(atomic64_t *v) { @@ -3116,4 +3132,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 225b2fe3eb6bbe34729abed7a856b91abc8d434e +// 3fd0ec685588b84c6428145b7628f79ce23a464c diff --git a/scripts/atomic/fallbacks/inc_unless_negative b/scripts/atomic/fallbacks/inc_unless_negative index 95d8ce48233f..98830b0dcdb1 100755 --- a/scripts/atomic/fallbacks/inc_unless_negative +++ b/scripts/atomic/fallbacks/inc_unless_negative @@ -1,4 +1,12 @@ cat < X-Patchwork-Id: 92261 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3829251vqo; Wed, 10 May 2023 11:19:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7jlFFFrGkVdPVoQo1r9r3Pa2TIq5Q5rgRXt7PTa42PVWHj9qX61DJ1PbJxx6JJ8FCEI/nc X-Received: by 2002:a17:903:2289:b0:1a6:84be:a08f with SMTP id b9-20020a170903228900b001a684bea08fmr22668210plh.64.1683742790894; Wed, 10 May 2023 11:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742790; cv=none; d=google.com; s=arc-20160816; b=jNRzLla/ShyuadY38nLL/RksBvPuh0XnZrnVDRaXxVYuE4QJDtQPVfEmxcLK5u7eDe mLmLm7e+3y67QgNG0YgE/j6FRgjXUxG0q3HZOoQ6Cj4CGsSHPK2M4q+iIqudnPVDTPY6 ttReyGEDdEXOI/xZ3kffbRBSdIFMKDp2BCuI2z+7VKqMmjsxeJuZxEW617BUJhxIYypN sCj8pC1Cksw9HNAhBztUiu+b9lOepX4u0QmMWL7NBvYZv2kinoACUxLU8DfA3WA5dPw8 58SIE9tSmasEsoDxHJk/tb5b3WbUi99P6SfQNFW4weCqsxQal5e5kflHrRN/0SH6kqrO D6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aheu2F40vnH9i2Zujo0TojrK+n4g7W55UhYp+zpM+mA=; b=ywbDVTNluA0I2SABQBHkqim3gxiVf3G2/i8IfMan4ze6IeLzvqAcSdtj8ixZJJB2pU TElhYW3PkJjRUmPh59jU93Dlan+Vbw8RJ81v2VI9y4nLmxrnpZU8h4FYbEt/YYhQMvnu fwq4WcHuZgh4dGmONOHhC2C7zlZ6jMtZXTyLvqzEaXquX+ncMdPmvdcJLMEyVhLF246T PtCsLorZLGDqGhBYAoz+CQ1cQbkXHOwb0C3ocdG5FuvrzX8TJ4/vl/OVKPEmaZgzjuRm PMHXl+ORfZJocqtVZVBft9I8voK26PIwGZb16uTwRuZMuE6RO3zaPewTnRGkmU++hnfu qWWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hrtuScck; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a170902be0300b0019c93e0dce0si4435751pls.254.2023.05.10.11.19.35; Wed, 10 May 2023 11:19:50 -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=@kernel.org header.s=k20201202 header.b=hrtuScck; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236451AbjEJSTC (ORCPT + 99 others); Wed, 10 May 2023 14:19:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236086AbjEJSSQ (ORCPT ); Wed, 10 May 2023 14:18:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6097B35AB; Wed, 10 May 2023 11:18:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C262163F8B; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B494DC433A8; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=938G6zjstowu8jkLfQwOfPppGEFi6/h20gxxEv4pKds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hrtuScckU1FqLRkp02MZHPh7X2V9uGIK3cXaf6OJl9tOUkIrNKx6WICOIN68mBOkT tcppCT7rbf2yDmS0eyK1RfcUdPLm/78ZtwryjthZRMyU2Ak51mhlpBsTBmrZEvMfpM vXksW7Iu/pE6tInVfjjwJF1hVnai5vO6dO7V1zZR1PPayYRPxLL5eAngyDYuJpUY7C mgkvebQHfLxC8SvO6ZcjE9KUdX9kQjP273voEX6fH/og2ODkfLOvqB5ih1yDJW0y44 FHQufgCMlP9nLVCUOrfCtV2GWCvFMF+WTtwKSicprf4gDVXLltL3pdhHReHTfRLRhX mZsRC/o1HcIew== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id EAA23CE1EA5; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 11/19] locking/atomic: Add kernel-doc header for arch_${atomic}_set_release Date: Wed, 10 May 2023 11:17:09 -0700 Message-Id: <20230510181717.2200934-11-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532280557720406?= X-GMAIL-MSGID: =?utf-8?q?1765532280557720406?= Add kernel-doc header template for arch_${atomic}_set_release function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 16 +++++++++++++++- scripts/atomic/fallbacks/set_release | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index a90ee496bb81..7ba75143c149 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -258,6 +258,13 @@ arch_atomic_read_acquire(const atomic_t *v) #endif #ifndef arch_atomic_set_release +/** + * arch_atomic_set_release - Atomic store release + * @v: pointer of type atomic_t + * @i: value to store + * + * Atomically store @i into *@v with release ordering. + */ static __always_inline void arch_atomic_set_release(atomic_t *v, int i) { @@ -1706,6 +1713,13 @@ arch_atomic64_read_acquire(const atomic64_t *v) #endif #ifndef arch_atomic64_set_release +/** + * arch_atomic64_set_release - Atomic store release + * @v: pointer of type atomic64_t + * @i: value to store + * + * Atomically store @i into *@v with release ordering. + */ static __always_inline void arch_atomic64_set_release(atomic64_t *v, s64 i) { @@ -3132,4 +3146,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 3fd0ec685588b84c6428145b7628f79ce23a464c +// c46693a9f3b3ceacef003cd42764251148e3457d diff --git a/scripts/atomic/fallbacks/set_release b/scripts/atomic/fallbacks/set_release index 05cdb7f42477..46effb6203e5 100755 --- a/scripts/atomic/fallbacks/set_release +++ b/scripts/atomic/fallbacks/set_release @@ -1,4 +1,11 @@ cat < X-Patchwork-Id: 92271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3842656vqo; Wed, 10 May 2023 11:44:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4IlrSrlhXZzvjcWW7mJRXVOzgIdgOOdYhrp5hhrd8NP72wKT4fH3QNSE+9PdNKz64omB7P X-Received: by 2002:a17:903:1252:b0:1aa:f0a7:933 with SMTP id u18-20020a170903125200b001aaf0a70933mr24053886plh.25.1683744299036; Wed, 10 May 2023 11:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744299; cv=none; d=google.com; s=arc-20160816; b=R/MozpH9OXW2yK4dCs9SqUJDUVn5AKCdfAAE/7EDkYpcMypNn4zS3Wy/J0CMVy+ff3 DTZ3N7WmCy312QasZtH6dZnBfnBTpzCP+XGUA+FnYWLDvE2M8+zabXXPqymCVr8NgU7K RvIoD2s8dPOg+8VgzRfW6fibRa2VyDaBFQ7jVCA41aak+IDK8lJjuafpMO7n7I06PRbO PVZ0c0OwE7L4P3wP+MSsqPOCbWkbBRsPR8bLwIVVpiLZ+Pi5r9ZiEPGtYO06CtVZf25Y mWv6q3Yyxuv3HEddI9QukHMdMgLV5MkpbD+2Q+y9zTAJO7iUzWWpGekcXdKNFAW+gKVx ODFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Iee6c3HcX5cRPO13nlKtHGzGcdkOhzlkSiez7e6wYsA=; b=pkEDqEmIm/ZGP8qx9/+fRarcPXZp7UHXy6itfhRLZiByVnBXiZ3QnF0+tc13OH3igD Qs1gNmA1ZPR/RBgJVnIuPmr50Q46F766NbhwMtYEI7PR8nOkqv7MB5sWcxfQPrZ2m0AR xeuQWtZDYyYkkAvb63HS3PZ/gRzMrbIq389M9s9Tu7RP4YFBEGIc9xXy/u4m/MDAqkpu LqhJh1QHdm7WavaBmCkQxpAetIf5MFVbenUyqD9RmbDcxn/xrhqRVYbYv5yj5DiHf6cW yXG332nkUfdxdkADjDTr3iYIDoA/WD6bDPLluKpSED8UXcRNxfs14Cq9i0DncYHCI7wi s+mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KczCrmqF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a170902768900b001ab147e4539si4530964pll.419.2023.05.10.11.44.46; Wed, 10 May 2023 11:44:59 -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=@kernel.org header.s=k20201202 header.b=KczCrmqF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236261AbjEJSTY (ORCPT + 99 others); Wed, 10 May 2023 14:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236162AbjEJSSV (ORCPT ); Wed, 10 May 2023 14:18:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 176F883FE; Wed, 10 May 2023 11:18:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C6F0A63F93; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0535C433A4; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=yeFIpFg/iKGrZfbrxdL351Lmjv0weFLzV3+gdTLgI4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KczCrmqFj0Mj9lVEKpCkKbR+cm3lmfrnsq6ph/rLxQPUY+3KS99z2fYFnAaxrNXYt ewEw3q7zLrYqCXYAC267dJXzLZDHdxa2BlunY0o81j/Fv9e2EkrkLszKb4bOrVJXpG 1seEH1u0jnsKeAHY4/CjKJjlDjyhvM5gsTuDtRQs7+hMbcoSYH0CoLvXvCwzr2s1UZ JeJqhAdHm+MlXQ3v8z/HF7Bl7KS9DAxaahoQcpRQk+vQzg5WLDOYw0yosc8wdzYe66 b66ezsnYiWZLckNNlTA4tSy+ukcmlyrRsm7Y3IAquPvKL5u7PE+csZS2h6TspLUcSh YY4vkUIRp1NYQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id ED174CE1ED9; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 12/19] locking/atomic: Add kernel-doc header for arch_${atomic}_read_acquire Date: Wed, 10 May 2023 11:17:10 -0700 Message-Id: <20230510181717.2200934-12-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765533862180836726?= X-GMAIL-MSGID: =?utf-8?q?1765533862180836726?= Add kernel-doc header template for arch_${atomic}_read_acquire function family. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 16 +++++++++++++++- scripts/atomic/fallbacks/read_acquire | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index 7ba75143c149..c3552b83bf49 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -240,6 +240,13 @@ #endif /* arch_try_cmpxchg64_local */ #ifndef arch_atomic_read_acquire +/** + * arch_atomic_read_acquire - Atomic load acquire + * @v: pointer of type atomic_t + * + * Atomically load from *@v with acquire ordering, returning the value + * loaded. + */ static __always_inline int arch_atomic_read_acquire(const atomic_t *v) { @@ -1695,6 +1702,13 @@ arch_atomic_dec_if_positive(atomic_t *v) #endif #ifndef arch_atomic64_read_acquire +/** + * arch_atomic64_read_acquire - Atomic load acquire + * @v: pointer of type atomic64_t + * + * Atomically load from *@v with acquire ordering, returning the value + * loaded. + */ static __always_inline s64 arch_atomic64_read_acquire(const atomic64_t *v) { @@ -3146,4 +3160,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// c46693a9f3b3ceacef003cd42764251148e3457d +// 96c8a3c4d13b12c9f3e0f715709c8af1653a7e79 diff --git a/scripts/atomic/fallbacks/read_acquire b/scripts/atomic/fallbacks/read_acquire index a0ea1d26e6b2..779f40c07018 100755 --- a/scripts/atomic/fallbacks/read_acquire +++ b/scripts/atomic/fallbacks/read_acquire @@ -1,4 +1,11 @@ cat < X-Patchwork-Id: 92269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3840797vqo; Wed, 10 May 2023 11:41:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ICRYdgGmPBBTPUdVBlakvsFNYqVHh2mOsxUzNrEh04AFUsdrvlb+RtVmXEplsehd4+qu8 X-Received: by 2002:a05:6a00:2483:b0:648:64fe:b14b with SMTP id c3-20020a056a00248300b0064864feb14bmr3815543pfv.32.1683744090468; Wed, 10 May 2023 11:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744090; cv=none; d=google.com; s=arc-20160816; b=One/X4US7NBtC+iKbiTWp8GHX2qrW40UsfTnBTN+co15Ki3FR1a4Pys8zJzgRMohUK 2ho7lvlEafknQvIrHsv2T5OdLUkzuQaY4SW8ASUHVJmBvFsERRewsJTY0P1YvMG6X17p qsh64teqBJHJ3KHX4XW6TMrHmvGLq4Q9YVSxVhZY84MmbrqWmY7u2Z7wP18dE3T8xJUt djSmugnVGioJAwCT91TR+STvqoGNSueydwSZ26/Mht1O+w3ORhQyETjp/QPNHCNmYubM 7xnA/aZg2Z0mZ5u8KpNkWpQHPODw5qQl1HBsYowlNxRAYKK/3zxCsBiycQhuDEUO9CJ8 KEnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5xB9zgrPGRFH2AfNBD6V0/7nLP242FIxDrR/4YI5MyA=; b=GFC7LJUvUaIhL+Q2+2wHuRaHLfmDKVw+nWN2Pz8iwZ4w9Flk2ckjEWIgrGY1+qpwMX jvnHZ0r21hr60lAihIh/3KteedQI6ch+mY13AasNP0OnTde+U99pL17nt/+jXaghZtru 5Ar5IAQkcP8UrcynvJcxYasI3MV/CvtgQWRaxB+4RlpNmOh6CsFU786dtJYjub4mjw1P 7WZSnOkGtvu1BEcmYeGphT9Jw5uIaT5kHtLik7BqJPGD1myClGmxHoYvjCckaLtFrrZM Ra5QmlS9iwUUvkK96CW3L9fwvUW6HcPnrStKFRRLfclE0bAhhc01XHMyP+tPAb2OZG2T HvDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IwNrKLQi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i63-20020a626d42000000b00645fc3fff58si5440511pfc.138.2023.05.10.11.41.17; Wed, 10 May 2023 11:41:30 -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=@kernel.org header.s=k20201202 header.b=IwNrKLQi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236241AbjEJSS1 (ORCPT + 99 others); Wed, 10 May 2023 14:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235791AbjEJSSG (ORCPT ); Wed, 10 May 2023 14:18:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D99847ABB; Wed, 10 May 2023 11:17:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2CBD563F7E; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EB2BC4339B; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=M24YCjX89zrGo9hYrVbnM541YXT/QdSaa04NmGeV1Kw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwNrKLQiM4yEdY6dWQJDqXWcesIHahzZBEqAGGtQ447tYWiSNEApxDQwXUOjpEp6R J+wReUPEoXom8oYdwM6CqS1S2LdicSusW+2/fo373mB/XtrVjEnPSdLSbEDbfgHsbj GJMYhpQEDHxblTH31IUYtifLIMO/tsxJmH4Xjz5I+NvuMKDpu4iY6C7rOJQyR+vzvF dQbx0460xkB/3k7AvmWYCbbkBmUX4GyXue1UKOgK2xQyEdaKbNtUi6s9x6D2kWk8mE EBsBIyMdV+b//2hbywVmq7VxMgxiQvkqiQTTa+VYdP/OtkpzHMmD2JVy1UNjQT7z6C Qru4NcBSFkTWA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id EFA9CCE1F4C; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 13/19] locking/atomic: Script to auto-generate acquire, fence, and release headers Date: Wed, 10 May 2023 11:17:11 -0700 Message-Id: <20230510181717.2200934-13-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765533643217657803?= X-GMAIL-MSGID: =?utf-8?q?1765533643217657803?= The scripts/atomic/fallbacks/{acquire,fence,release} scripts require almost identical scripting to automatically generated the required kernel-doci headers. Therefore, provide a single acqrel.sh script that does this work. This new script is to be invoked from each of those scripts using the "." command, and with the shell variable "acqrel" set to either "acquire", "full", or "release". Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- scripts/atomic/acqrel.sh | 67 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 scripts/atomic/acqrel.sh diff --git a/scripts/atomic/acqrel.sh b/scripts/atomic/acqrel.sh new file mode 100644 index 000000000000..5009a54fdac5 --- /dev/null +++ b/scripts/atomic/acqrel.sh @@ -0,0 +1,67 @@ +echo ${args} | tr -d ' ' | tr ',' '\012' | + awk -v atomic=${atomic} \ + -v name_op=${name} \ + -v ret=${ret} \ + -v oldnew=${docbook_oldnew} \ + -v acqrel=${acqrel} \ + -v basefuncname=arch_${atomic}_${pfx}${name}${sfx} ' + BEGIN { + print "/**"; + sfxord = "_" acqrel; + if (acqrel == "full") + sfxord = ""; + print " * " basefuncname sfxord " - Atomic " name_op " with " acqrel " ordering"; + longname["add"] = "add"; + longname["sub"] = "subtract"; + longname["inc"] = "increment"; + longname["dec"] = "decrement"; + longname["and"] = "AND"; + longname["andnot"] = "complement then AND"; + longname["or"] = "OR"; + longname["xor"] = "XOR"; + longname["xchg"] = "exchange"; + longname["add_negative"] = "add"; + desc["i"] = "value to " longname[name_op]; + desc["v"] = "pointer of type " atomic "_t"; + desc["old"] = "desired old value to match"; + desc["new"] = "new value to put in"; + opmod = "with"; + if (name_op == "add") + opmod = "to"; + else if (name_op == "sub") + opmod = "from"; + } + + { + print " * @" $1 ": " desc[$1]; + have[$1] = 1; + } + + END { + print " *"; + if (name_op ~ /cmpxchg/) { + print " * Atomically compares @new to *@v, and if equal,"; + print " * stores @new to *@v, providing " acqrel " ordering."; + } else if (have["i"]) { + print " * Atomically " longname[name_op] " @i " opmod " @v using " acqrel " ordering."; + } else { + print " * Atomically " longname[name_op] " @v using " acqrel " ordering."; + } + if (name_op ~ /cmpxchg/ && ret == "bool") { + print " * Returns @true if the cmpxchg operation succeeded,"; + print " * and false otherwise. Either way, stores the old"; + print " * value of *@v to *@old."; + } else if (name_op == "cmpxchg") { + print " * Returns the old value *@v regardless of the result of"; + print " * the comparison. Therefore, if the return value is not"; + print " * equal to @old, the cmpxchg operation failed."; + } else if (name_op == "xchg") { + print " * Return old value."; + } else if (name_op == "add_negative") { + print " * Return @true if the result is negative, or @false when" + print " * the result is greater than or equal to zero."; + } else { + print " * Return " oldnew " value."; + } + print " */"; + }' From patchwork Wed May 10 18:17:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 92267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3839361vqo; Wed, 10 May 2023 11:38:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WFxNOeT3Q5KS54TU134Jig34j+hLZpP9JRWabSA2ImU+kjINEFJAGCj+/8jHMEdq5peAx X-Received: by 2002:a05:6a00:1741:b0:646:421f:500b with SMTP id j1-20020a056a00174100b00646421f500bmr17048930pfc.10.1683743918815; Wed, 10 May 2023 11:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683743918; cv=none; d=google.com; s=arc-20160816; b=jX7reZbv6ahj2MskH67SfPaYrsjlFT758sSYsq7F69Vnz6i01mTrWx1Sz06yHc7j+T z7nQt7YocMPmfnydON2D4VK5qMxDJUxZUj7HgOreG0vIlXr7creKjl164TmIkkab01Oa BOzn3TOeHkI583wIJJC+3j4y6xyDTMhhAh5o0SdnpyB4olSZ2u9qRrIF1UXibirCH6+E I8gPOvZpvP9Fq3nSqcIsO6BVNa2V6oKA2G4jRK4Id5mxLTwfqGzpK43BeADFa7WCpiR2 c1TmIAKo4N4Ych3TZpB+uxA4GRnbJR7PrEDZwakgLWt9P/13lOXY9EEjkO3l+uQ1q7/s Atpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KFB5D7z7f4KyurcdPsyT8TgSY7dNhP7+XSOagxa80Mc=; b=MGUtTJK99nlGaelS30PxTAiBt4ooXHog314O6TUqtE3J19sIDZ9lWGaACbgq37hmTh Pa+qqzVb7y7f7uGf2It1OjNz0vHoQL9FWgGx4oKfOJpntod3uj7m0KGcdD1iBng4NL9x ySIAyeqciuybndtkUHwI6NJL2L1X8/RNXNql8rQZoORgYdGxAF0WU9ad2xBatKWjiwwh LfPEu3+SdGmUAd0eBhDR/MuJ2OH5g9qwACyxCUz4kRaivgu21dwE7pbByutqDI8Nshn1 e5C53ZqWrYD/hvQCx9HaG672JP8XwRXYwypOkZug5LEju7WE1mJ5y8rdz/S0lhlYlj2b ZU4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nguuQFdD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u132-20020a63798a000000b0052c59f647c0si4420949pgc.73.2023.05.10.11.38.25; Wed, 10 May 2023 11:38:38 -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=@kernel.org header.s=k20201202 header.b=nguuQFdD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236568AbjEJSTV (ORCPT + 99 others); Wed, 10 May 2023 14:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236163AbjEJSSV (ORCPT ); Wed, 10 May 2023 14:18:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1289B4; Wed, 10 May 2023 11:18:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3293D63F88; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A0B9C4339E; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=VbR1Phwuz3aHPV2NlTFLb/EDzs8Ul66u7yy6d5bFcic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nguuQFdDUOXv21uxQD87l1plbiHh/tRqZwj0yCk7865P/p6EfkFlS+RuGkq8vOgZL 1Yc2kXzqoCdL0TlUSWCzDFK8x50N1TQm9Gi3zEP0QkRXhWVbXgd9rZoSVB+/Rl+j2+ RXhBV3Ls7SSn5rN4EZCYrjSYitwR75OzAZ2ygMqFJlYfnbs43iaZXBDSkldB5hr8eQ PgLErOpzvfty35MRYaHWqq+TmTAEXINl4x8Tygbr1dfbQtfQir5u9wR3ekGlK1X4pO KN7F6MZaXD6HZ1zZuqa50NQp8h9x/8csRLTMgIqWCOFfomcBrNstsnuIQ723DxqZjX uFq1tTfwV6khg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id F295CCE1F76; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 14/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}${name}${sfx}_acquire Date: Wed, 10 May 2023 11:17:12 -0700 Message-Id: <20230510181717.2200934-14-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765533463359264211?= X-GMAIL-MSGID: =?utf-8?q?1765533463359264211?= Add kernel-doc header template for arch_${atomic}_${pfx}${name}${sfx}_acquire function family with the help of my good friend awk, as encapsulated in acqrel.sh. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 268 +++++++++++++++++++- scripts/atomic/fallbacks/acquire | 4 +- 2 files changed, 270 insertions(+), 2 deletions(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index c3552b83bf49..fc80113ca60a 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -292,6 +292,14 @@ arch_atomic_set_release(atomic_t *v, int i) #else /* arch_atomic_add_return_relaxed */ #ifndef arch_atomic_add_return_acquire +/** + * arch_atomic_add_return_acquire - Atomic add with acquire ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i to @v using acquire ordering. + * Return new value. + */ static __always_inline int arch_atomic_add_return_acquire(int i, atomic_t *v) { @@ -334,6 +342,14 @@ arch_atomic_add_return(int i, atomic_t *v) #else /* arch_atomic_fetch_add_relaxed */ #ifndef arch_atomic_fetch_add_acquire +/** + * arch_atomic_fetch_add_acquire - Atomic add with acquire ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i to @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_add_acquire(int i, atomic_t *v) { @@ -376,6 +392,14 @@ arch_atomic_fetch_add(int i, atomic_t *v) #else /* arch_atomic_sub_return_relaxed */ #ifndef arch_atomic_sub_return_acquire +/** + * arch_atomic_sub_return_acquire - Atomic sub with acquire ordering + * @i: value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtract @i from @v using acquire ordering. + * Return new value. + */ static __always_inline int arch_atomic_sub_return_acquire(int i, atomic_t *v) { @@ -418,6 +442,14 @@ arch_atomic_sub_return(int i, atomic_t *v) #else /* arch_atomic_fetch_sub_relaxed */ #ifndef arch_atomic_fetch_sub_acquire +/** + * arch_atomic_fetch_sub_acquire - Atomic sub with acquire ordering + * @i: value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtract @i from @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_sub_acquire(int i, atomic_t *v) { @@ -543,6 +575,13 @@ arch_atomic_inc_return_relaxed(atomic_t *v) #else /* arch_atomic_inc_return_relaxed */ #ifndef arch_atomic_inc_return_acquire +/** + * arch_atomic_inc_return_acquire - Atomic inc with acquire ordering + * @v: pointer of type atomic_t + * + * Atomically increment @v using acquire ordering. + * Return new value. + */ static __always_inline int arch_atomic_inc_return_acquire(atomic_t *v) { @@ -652,6 +691,13 @@ arch_atomic_fetch_inc_relaxed(atomic_t *v) #else /* arch_atomic_fetch_inc_relaxed */ #ifndef arch_atomic_fetch_inc_acquire +/** + * arch_atomic_fetch_inc_acquire - Atomic inc with acquire ordering + * @v: pointer of type atomic_t + * + * Atomically increment @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_inc_acquire(atomic_t *v) { @@ -777,6 +823,13 @@ arch_atomic_dec_return_relaxed(atomic_t *v) #else /* arch_atomic_dec_return_relaxed */ #ifndef arch_atomic_dec_return_acquire +/** + * arch_atomic_dec_return_acquire - Atomic dec with acquire ordering + * @v: pointer of type atomic_t + * + * Atomically decrement @v using acquire ordering. + * Return new value. + */ static __always_inline int arch_atomic_dec_return_acquire(atomic_t *v) { @@ -886,6 +939,13 @@ arch_atomic_fetch_dec_relaxed(atomic_t *v) #else /* arch_atomic_fetch_dec_relaxed */ #ifndef arch_atomic_fetch_dec_acquire +/** + * arch_atomic_fetch_dec_acquire - Atomic dec with acquire ordering + * @v: pointer of type atomic_t + * + * Atomically decrement @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_dec_acquire(atomic_t *v) { @@ -928,6 +988,14 @@ arch_atomic_fetch_dec(atomic_t *v) #else /* arch_atomic_fetch_and_relaxed */ #ifndef arch_atomic_fetch_and_acquire +/** + * arch_atomic_fetch_and_acquire - Atomic and with acquire ordering + * @i: value to AND + * @v: pointer of type atomic_t + * + * Atomically AND @i with @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_and_acquire(int i, atomic_t *v) { @@ -1058,6 +1126,14 @@ arch_atomic_fetch_andnot_relaxed(int i, atomic_t *v) #else /* arch_atomic_fetch_andnot_relaxed */ #ifndef arch_atomic_fetch_andnot_acquire +/** + * arch_atomic_fetch_andnot_acquire - Atomic andnot with acquire ordering + * @i: value to complement then AND + * @v: pointer of type atomic_t + * + * Atomically complement then AND @i with @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_andnot_acquire(int i, atomic_t *v) { @@ -1100,6 +1176,14 @@ arch_atomic_fetch_andnot(int i, atomic_t *v) #else /* arch_atomic_fetch_or_relaxed */ #ifndef arch_atomic_fetch_or_acquire +/** + * arch_atomic_fetch_or_acquire - Atomic or with acquire ordering + * @i: value to OR + * @v: pointer of type atomic_t + * + * Atomically OR @i with @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_or_acquire(int i, atomic_t *v) { @@ -1142,6 +1226,14 @@ arch_atomic_fetch_or(int i, atomic_t *v) #else /* arch_atomic_fetch_xor_relaxed */ #ifndef arch_atomic_fetch_xor_acquire +/** + * arch_atomic_fetch_xor_acquire - Atomic xor with acquire ordering + * @i: value to XOR + * @v: pointer of type atomic_t + * + * Atomically XOR @i with @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_xor_acquire(int i, atomic_t *v) { @@ -1184,6 +1276,14 @@ arch_atomic_fetch_xor(int i, atomic_t *v) #else /* arch_atomic_xchg_relaxed */ #ifndef arch_atomic_xchg_acquire +/** + * arch_atomic_xchg_acquire - Atomic xchg with acquire ordering + * @v: pointer of type atomic_t + * @i: value to exchange + * + * Atomically exchange @i with @v using acquire ordering. + * Return old value. + */ static __always_inline int arch_atomic_xchg_acquire(atomic_t *v, int i) { @@ -1226,6 +1326,18 @@ arch_atomic_xchg(atomic_t *v, int i) #else /* arch_atomic_cmpxchg_relaxed */ #ifndef arch_atomic_cmpxchg_acquire +/** + * arch_atomic_cmpxchg_acquire - Atomic cmpxchg with acquire ordering + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing acquire ordering. + * Returns the old value *@v regardless of the result of + * the comparison. Therefore, if the return value is not + * equal to @old, the cmpxchg operation failed. + */ static __always_inline int arch_atomic_cmpxchg_acquire(atomic_t *v, int old, int new) { @@ -1363,6 +1475,18 @@ arch_atomic_try_cmpxchg_relaxed(atomic_t *v, int *old, int new) #else /* arch_atomic_try_cmpxchg_relaxed */ #ifndef arch_atomic_try_cmpxchg_acquire +/** + * arch_atomic_try_cmpxchg_acquire - Atomic try_cmpxchg with acquire ordering + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing acquire ordering. + * Returns @true if the cmpxchg operation succeeded, + * and false otherwise. Either way, stores the old + * value of *@v to *@old. + */ static __always_inline bool arch_atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new) { @@ -1528,6 +1652,15 @@ arch_atomic_add_negative_relaxed(int i, atomic_t *v) #else /* arch_atomic_add_negative_relaxed */ #ifndef arch_atomic_add_negative_acquire +/** + * arch_atomic_add_negative_acquire - Atomic add_negative with acquire ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i with @v using acquire ordering. + * Return @true if the result is negative, or @false when + * the result is greater than or equal to zero. + */ static __always_inline bool arch_atomic_add_negative_acquire(int i, atomic_t *v) { @@ -1754,6 +1887,14 @@ arch_atomic64_set_release(atomic64_t *v, s64 i) #else /* arch_atomic64_add_return_relaxed */ #ifndef arch_atomic64_add_return_acquire +/** + * arch_atomic64_add_return_acquire - Atomic add with acquire ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i to @v using acquire ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_add_return_acquire(s64 i, atomic64_t *v) { @@ -1796,6 +1937,14 @@ arch_atomic64_add_return(s64 i, atomic64_t *v) #else /* arch_atomic64_fetch_add_relaxed */ #ifndef arch_atomic64_fetch_add_acquire +/** + * arch_atomic64_fetch_add_acquire - Atomic add with acquire ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i to @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_add_acquire(s64 i, atomic64_t *v) { @@ -1838,6 +1987,14 @@ arch_atomic64_fetch_add(s64 i, atomic64_t *v) #else /* arch_atomic64_sub_return_relaxed */ #ifndef arch_atomic64_sub_return_acquire +/** + * arch_atomic64_sub_return_acquire - Atomic sub with acquire ordering + * @i: value to subtract + * @v: pointer of type atomic64_t + * + * Atomically subtract @i from @v using acquire ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_sub_return_acquire(s64 i, atomic64_t *v) { @@ -1880,6 +2037,14 @@ arch_atomic64_sub_return(s64 i, atomic64_t *v) #else /* arch_atomic64_fetch_sub_relaxed */ #ifndef arch_atomic64_fetch_sub_acquire +/** + * arch_atomic64_fetch_sub_acquire - Atomic sub with acquire ordering + * @i: value to subtract + * @v: pointer of type atomic64_t + * + * Atomically subtract @i from @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_sub_acquire(s64 i, atomic64_t *v) { @@ -2005,6 +2170,13 @@ arch_atomic64_inc_return_relaxed(atomic64_t *v) #else /* arch_atomic64_inc_return_relaxed */ #ifndef arch_atomic64_inc_return_acquire +/** + * arch_atomic64_inc_return_acquire - Atomic inc with acquire ordering + * @v: pointer of type atomic64_t + * + * Atomically increment @v using acquire ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_inc_return_acquire(atomic64_t *v) { @@ -2114,6 +2286,13 @@ arch_atomic64_fetch_inc_relaxed(atomic64_t *v) #else /* arch_atomic64_fetch_inc_relaxed */ #ifndef arch_atomic64_fetch_inc_acquire +/** + * arch_atomic64_fetch_inc_acquire - Atomic inc with acquire ordering + * @v: pointer of type atomic64_t + * + * Atomically increment @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_inc_acquire(atomic64_t *v) { @@ -2239,6 +2418,13 @@ arch_atomic64_dec_return_relaxed(atomic64_t *v) #else /* arch_atomic64_dec_return_relaxed */ #ifndef arch_atomic64_dec_return_acquire +/** + * arch_atomic64_dec_return_acquire - Atomic dec with acquire ordering + * @v: pointer of type atomic64_t + * + * Atomically decrement @v using acquire ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_dec_return_acquire(atomic64_t *v) { @@ -2348,6 +2534,13 @@ arch_atomic64_fetch_dec_relaxed(atomic64_t *v) #else /* arch_atomic64_fetch_dec_relaxed */ #ifndef arch_atomic64_fetch_dec_acquire +/** + * arch_atomic64_fetch_dec_acquire - Atomic dec with acquire ordering + * @v: pointer of type atomic64_t + * + * Atomically decrement @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_dec_acquire(atomic64_t *v) { @@ -2390,6 +2583,14 @@ arch_atomic64_fetch_dec(atomic64_t *v) #else /* arch_atomic64_fetch_and_relaxed */ #ifndef arch_atomic64_fetch_and_acquire +/** + * arch_atomic64_fetch_and_acquire - Atomic and with acquire ordering + * @i: value to AND + * @v: pointer of type atomic64_t + * + * Atomically AND @i with @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_and_acquire(s64 i, atomic64_t *v) { @@ -2520,6 +2721,14 @@ arch_atomic64_fetch_andnot_relaxed(s64 i, atomic64_t *v) #else /* arch_atomic64_fetch_andnot_relaxed */ #ifndef arch_atomic64_fetch_andnot_acquire +/** + * arch_atomic64_fetch_andnot_acquire - Atomic andnot with acquire ordering + * @i: value to complement then AND + * @v: pointer of type atomic64_t + * + * Atomically complement then AND @i with @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v) { @@ -2562,6 +2771,14 @@ arch_atomic64_fetch_andnot(s64 i, atomic64_t *v) #else /* arch_atomic64_fetch_or_relaxed */ #ifndef arch_atomic64_fetch_or_acquire +/** + * arch_atomic64_fetch_or_acquire - Atomic or with acquire ordering + * @i: value to OR + * @v: pointer of type atomic64_t + * + * Atomically OR @i with @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_or_acquire(s64 i, atomic64_t *v) { @@ -2604,6 +2821,14 @@ arch_atomic64_fetch_or(s64 i, atomic64_t *v) #else /* arch_atomic64_fetch_xor_relaxed */ #ifndef arch_atomic64_fetch_xor_acquire +/** + * arch_atomic64_fetch_xor_acquire - Atomic xor with acquire ordering + * @i: value to XOR + * @v: pointer of type atomic64_t + * + * Atomically XOR @i with @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_xor_acquire(s64 i, atomic64_t *v) { @@ -2646,6 +2871,14 @@ arch_atomic64_fetch_xor(s64 i, atomic64_t *v) #else /* arch_atomic64_xchg_relaxed */ #ifndef arch_atomic64_xchg_acquire +/** + * arch_atomic64_xchg_acquire - Atomic xchg with acquire ordering + * @v: pointer of type atomic64_t + * @i: value to exchange + * + * Atomically exchange @i with @v using acquire ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_xchg_acquire(atomic64_t *v, s64 i) { @@ -2688,6 +2921,18 @@ arch_atomic64_xchg(atomic64_t *v, s64 i) #else /* arch_atomic64_cmpxchg_relaxed */ #ifndef arch_atomic64_cmpxchg_acquire +/** + * arch_atomic64_cmpxchg_acquire - Atomic cmpxchg with acquire ordering + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing acquire ordering. + * Returns the old value *@v regardless of the result of + * the comparison. Therefore, if the return value is not + * equal to @old, the cmpxchg operation failed. + */ static __always_inline s64 arch_atomic64_cmpxchg_acquire(atomic64_t *v, s64 old, s64 new) { @@ -2825,6 +3070,18 @@ arch_atomic64_try_cmpxchg_relaxed(atomic64_t *v, s64 *old, s64 new) #else /* arch_atomic64_try_cmpxchg_relaxed */ #ifndef arch_atomic64_try_cmpxchg_acquire +/** + * arch_atomic64_try_cmpxchg_acquire - Atomic try_cmpxchg with acquire ordering + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing acquire ordering. + * Returns @true if the cmpxchg operation succeeded, + * and false otherwise. Either way, stores the old + * value of *@v to *@old. + */ static __always_inline bool arch_atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new) { @@ -2990,6 +3247,15 @@ arch_atomic64_add_negative_relaxed(s64 i, atomic64_t *v) #else /* arch_atomic64_add_negative_relaxed */ #ifndef arch_atomic64_add_negative_acquire +/** + * arch_atomic64_add_negative_acquire - Atomic add_negative with acquire ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i with @v using acquire ordering. + * Return @true if the result is negative, or @false when + * the result is greater than or equal to zero. + */ static __always_inline bool arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) { @@ -3160,4 +3426,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 96c8a3c4d13b12c9f3e0f715709c8af1653a7e79 +// a7944792460cf5adb72d49025850800d2cd178be diff --git a/scripts/atomic/fallbacks/acquire b/scripts/atomic/fallbacks/acquire index ef764085c79a..08fc6c30a9ef 100755 --- a/scripts/atomic/fallbacks/acquire +++ b/scripts/atomic/fallbacks/acquire @@ -1,4 +1,6 @@ -cat < X-Patchwork-Id: 92265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3832850vqo; Wed, 10 May 2023 11:26:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gd03RQoa9u1vFeKBlHQRkvOx7nPur+9sILdii9Bs5rcONKdtO4nAgnS5DIskWsWqmY74a X-Received: by 2002:a05:6a21:6d9f:b0:100:b8fc:8c6c with SMTP id wl31-20020a056a216d9f00b00100b8fc8c6cmr12980732pzb.19.1683743193835; Wed, 10 May 2023 11:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683743193; cv=none; d=google.com; s=arc-20160816; b=Ye7VblAotFBJmPEWNkV+yeuoYwPyTthHJnW++y4Q7QVXiV70MbySmS1JmSNyyOBi4y p9si6335splBmFOsnqw+zOgpoEPLM7XwhlpRsVsVWJVVVbe7tlMIT+t1MtFWgDgTbvDg TujRXOgm+oh4uiLBFngVOz3wnLMZw1ZEvc6dTCYYTKACh27KOvYFZX0EH07bQbd474rN DZxttTj4WHeD8XAUl9IeigNgwdZ1z++W5ziiPLdc/zEUuc41UolG3CT0BqYsi2mgzW4K KQQ9DJ8S+dkjcIvT/TM4qMPUxLDOfxEtXb+qcPbuB4SpRwn7BOMaT1l9tKaZ7AF1GQT6 F5BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yGOrs2FTmf0HI7c8X1Csl0n7BHZljqBFrejtzEN3n/U=; b=JQOnDjQ7bBdp54+xlP0tBpxzICBTqcdG/58hjciS9+QN13lxfWmDyrKO9wwc/0ldgM HyCrqPXOVVnxCZdHN5yYdhmV/ASYvUtfvw09lUB4+a/bB+Dy3q+aC8lAkB5p0lzds4RL ii5KBENj5TwaguAiRKDXYQKhB+tCqs+oSpC0pBoV6W8RQC+ZRO7tUL7B3hPafBqpj7aS dHHNG2k7UUnCuKEjrHbZul+Gzbp0aTyZ4saf20DO240EhfUHMJAFkNjOz2O2erBdakV0 aonFy95qGRvLe6A3iwxsEBjWktFQ9t4VfASeEbgmJYk5ZcNRysHzuj196GrutGUC+Exn nPVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LR+TmNQN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y192-20020a638ac9000000b00527d158ec73si4995275pgd.3.2023.05.10.11.26.19; Wed, 10 May 2023 11:26:33 -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=@kernel.org header.s=k20201202 header.b=LR+TmNQN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236225AbjEJSTO (ORCPT + 99 others); Wed, 10 May 2023 14:19:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236145AbjEJSSU (ORCPT ); Wed, 10 May 2023 14:18:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D54BC6A78; Wed, 10 May 2023 11:18:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B805863F8D; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A544AC433A0; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=7habnDi2108xRXlvaQYflFtpvA2CnKXlKIA8xuT2KGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LR+TmNQNnhVZZ8MbTBFbBRWP0+QTufKpQ6+gR5YylKgr31b6xj270/v70vNdk1RAH KR6I4sNhSj+o28mu240yw8sG8I2NE8GfIMa13RuQ14IG476ycX2PQ7W2uxN092Hne1 q7ZLFydJmhMFl2lh9EIombYLjFqINHOlDXWIMhRLUCGQ6Oh+4uTjLmley+HBCcRk7z b8F/U/+G23TCIOJlM0aYAwbAJCzodYHVnfrHu7yo4SenldBgfLGbTdaPYJzQLy7ZA/ KMEDBTYPuzDtuTgNnnb6vFYPmvdjPYG7cd5KouuddaijUBg7WlVxLMt29j6fUV7WUz 7NDuqTg4Yy8oQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 00EC3CE21C0; Wed, 10 May 2023 11:17:18 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 15/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}${name}${sfx}_release Date: Wed, 10 May 2023 11:17:13 -0700 Message-Id: <20230510181717.2200934-15-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532703257393432?= X-GMAIL-MSGID: =?utf-8?q?1765532703257393432?= Add kernel-doc header template for arch_${atomic}_${pfx}${name}${sfx}_release function family with the help of my good friend awk, as encapsulated in acqrel.sh. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 268 +++++++++++++++++++- scripts/atomic/fallbacks/release | 2 + 2 files changed, 269 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index fc80113ca60a..ec6821b4bbc1 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -311,6 +311,14 @@ arch_atomic_add_return_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_add_return_release +/** + * arch_atomic_add_return_release - Atomic add with release ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i to @v using release ordering. + * Return new value. + */ static __always_inline int arch_atomic_add_return_release(int i, atomic_t *v) { @@ -361,6 +369,14 @@ arch_atomic_fetch_add_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_add_release +/** + * arch_atomic_fetch_add_release - Atomic add with release ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i to @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_add_release(int i, atomic_t *v) { @@ -411,6 +427,14 @@ arch_atomic_sub_return_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_sub_return_release +/** + * arch_atomic_sub_return_release - Atomic sub with release ordering + * @i: value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtract @i from @v using release ordering. + * Return new value. + */ static __always_inline int arch_atomic_sub_return_release(int i, atomic_t *v) { @@ -461,6 +485,14 @@ arch_atomic_fetch_sub_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_sub_release +/** + * arch_atomic_fetch_sub_release - Atomic sub with release ordering + * @i: value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtract @i from @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_sub_release(int i, atomic_t *v) { @@ -593,6 +625,13 @@ arch_atomic_inc_return_acquire(atomic_t *v) #endif #ifndef arch_atomic_inc_return_release +/** + * arch_atomic_inc_return_release - Atomic inc with release ordering + * @v: pointer of type atomic_t + * + * Atomically increment @v using release ordering. + * Return new value. + */ static __always_inline int arch_atomic_inc_return_release(atomic_t *v) { @@ -709,6 +748,13 @@ arch_atomic_fetch_inc_acquire(atomic_t *v) #endif #ifndef arch_atomic_fetch_inc_release +/** + * arch_atomic_fetch_inc_release - Atomic inc with release ordering + * @v: pointer of type atomic_t + * + * Atomically increment @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_inc_release(atomic_t *v) { @@ -841,6 +887,13 @@ arch_atomic_dec_return_acquire(atomic_t *v) #endif #ifndef arch_atomic_dec_return_release +/** + * arch_atomic_dec_return_release - Atomic dec with release ordering + * @v: pointer of type atomic_t + * + * Atomically decrement @v using release ordering. + * Return new value. + */ static __always_inline int arch_atomic_dec_return_release(atomic_t *v) { @@ -957,6 +1010,13 @@ arch_atomic_fetch_dec_acquire(atomic_t *v) #endif #ifndef arch_atomic_fetch_dec_release +/** + * arch_atomic_fetch_dec_release - Atomic dec with release ordering + * @v: pointer of type atomic_t + * + * Atomically decrement @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_dec_release(atomic_t *v) { @@ -1007,6 +1067,14 @@ arch_atomic_fetch_and_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_and_release +/** + * arch_atomic_fetch_and_release - Atomic and with release ordering + * @i: value to AND + * @v: pointer of type atomic_t + * + * Atomically AND @i with @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_and_release(int i, atomic_t *v) { @@ -1145,6 +1213,14 @@ arch_atomic_fetch_andnot_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_andnot_release +/** + * arch_atomic_fetch_andnot_release - Atomic andnot with release ordering + * @i: value to complement then AND + * @v: pointer of type atomic_t + * + * Atomically complement then AND @i with @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_andnot_release(int i, atomic_t *v) { @@ -1195,6 +1271,14 @@ arch_atomic_fetch_or_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_or_release +/** + * arch_atomic_fetch_or_release - Atomic or with release ordering + * @i: value to OR + * @v: pointer of type atomic_t + * + * Atomically OR @i with @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_or_release(int i, atomic_t *v) { @@ -1245,6 +1329,14 @@ arch_atomic_fetch_xor_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_xor_release +/** + * arch_atomic_fetch_xor_release - Atomic xor with release ordering + * @i: value to XOR + * @v: pointer of type atomic_t + * + * Atomically XOR @i with @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_xor_release(int i, atomic_t *v) { @@ -1295,6 +1387,14 @@ arch_atomic_xchg_acquire(atomic_t *v, int i) #endif #ifndef arch_atomic_xchg_release +/** + * arch_atomic_xchg_release - Atomic xchg with release ordering + * @v: pointer of type atomic_t + * @i: value to exchange + * + * Atomically exchange @i with @v using release ordering. + * Return old value. + */ static __always_inline int arch_atomic_xchg_release(atomic_t *v, int i) { @@ -1349,6 +1449,18 @@ arch_atomic_cmpxchg_acquire(atomic_t *v, int old, int new) #endif #ifndef arch_atomic_cmpxchg_release +/** + * arch_atomic_cmpxchg_release - Atomic cmpxchg with release ordering + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing release ordering. + * Returns the old value *@v regardless of the result of + * the comparison. Therefore, if the return value is not + * equal to @old, the cmpxchg operation failed. + */ static __always_inline int arch_atomic_cmpxchg_release(atomic_t *v, int old, int new) { @@ -1498,6 +1610,18 @@ arch_atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new) #endif #ifndef arch_atomic_try_cmpxchg_release +/** + * arch_atomic_try_cmpxchg_release - Atomic try_cmpxchg with release ordering + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing release ordering. + * Returns @true if the cmpxchg operation succeeded, + * and false otherwise. Either way, stores the old + * value of *@v to *@old. + */ static __always_inline bool arch_atomic_try_cmpxchg_release(atomic_t *v, int *old, int new) { @@ -1672,6 +1796,15 @@ arch_atomic_add_negative_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_add_negative_release +/** + * arch_atomic_add_negative_release - Atomic add_negative with release ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i with @v using release ordering. + * Return @true if the result is negative, or @false when + * the result is greater than or equal to zero. + */ static __always_inline bool arch_atomic_add_negative_release(int i, atomic_t *v) { @@ -1906,6 +2039,14 @@ arch_atomic64_add_return_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_add_return_release +/** + * arch_atomic64_add_return_release - Atomic add with release ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i to @v using release ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_add_return_release(s64 i, atomic64_t *v) { @@ -1956,6 +2097,14 @@ arch_atomic64_fetch_add_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_add_release +/** + * arch_atomic64_fetch_add_release - Atomic add with release ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i to @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_add_release(s64 i, atomic64_t *v) { @@ -2006,6 +2155,14 @@ arch_atomic64_sub_return_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_sub_return_release +/** + * arch_atomic64_sub_return_release - Atomic sub with release ordering + * @i: value to subtract + * @v: pointer of type atomic64_t + * + * Atomically subtract @i from @v using release ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_sub_return_release(s64 i, atomic64_t *v) { @@ -2056,6 +2213,14 @@ arch_atomic64_fetch_sub_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_sub_release +/** + * arch_atomic64_fetch_sub_release - Atomic sub with release ordering + * @i: value to subtract + * @v: pointer of type atomic64_t + * + * Atomically subtract @i from @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_sub_release(s64 i, atomic64_t *v) { @@ -2188,6 +2353,13 @@ arch_atomic64_inc_return_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_inc_return_release +/** + * arch_atomic64_inc_return_release - Atomic inc with release ordering + * @v: pointer of type atomic64_t + * + * Atomically increment @v using release ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_inc_return_release(atomic64_t *v) { @@ -2304,6 +2476,13 @@ arch_atomic64_fetch_inc_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_inc_release +/** + * arch_atomic64_fetch_inc_release - Atomic inc with release ordering + * @v: pointer of type atomic64_t + * + * Atomically increment @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_inc_release(atomic64_t *v) { @@ -2436,6 +2615,13 @@ arch_atomic64_dec_return_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_dec_return_release +/** + * arch_atomic64_dec_return_release - Atomic dec with release ordering + * @v: pointer of type atomic64_t + * + * Atomically decrement @v using release ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_dec_return_release(atomic64_t *v) { @@ -2552,6 +2738,13 @@ arch_atomic64_fetch_dec_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_dec_release +/** + * arch_atomic64_fetch_dec_release - Atomic dec with release ordering + * @v: pointer of type atomic64_t + * + * Atomically decrement @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_dec_release(atomic64_t *v) { @@ -2602,6 +2795,14 @@ arch_atomic64_fetch_and_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_and_release +/** + * arch_atomic64_fetch_and_release - Atomic and with release ordering + * @i: value to AND + * @v: pointer of type atomic64_t + * + * Atomically AND @i with @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_and_release(s64 i, atomic64_t *v) { @@ -2740,6 +2941,14 @@ arch_atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_andnot_release +/** + * arch_atomic64_fetch_andnot_release - Atomic andnot with release ordering + * @i: value to complement then AND + * @v: pointer of type atomic64_t + * + * Atomically complement then AND @i with @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_andnot_release(s64 i, atomic64_t *v) { @@ -2790,6 +2999,14 @@ arch_atomic64_fetch_or_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_or_release +/** + * arch_atomic64_fetch_or_release - Atomic or with release ordering + * @i: value to OR + * @v: pointer of type atomic64_t + * + * Atomically OR @i with @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_or_release(s64 i, atomic64_t *v) { @@ -2840,6 +3057,14 @@ arch_atomic64_fetch_xor_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_xor_release +/** + * arch_atomic64_fetch_xor_release - Atomic xor with release ordering + * @i: value to XOR + * @v: pointer of type atomic64_t + * + * Atomically XOR @i with @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_xor_release(s64 i, atomic64_t *v) { @@ -2890,6 +3115,14 @@ arch_atomic64_xchg_acquire(atomic64_t *v, s64 i) #endif #ifndef arch_atomic64_xchg_release +/** + * arch_atomic64_xchg_release - Atomic xchg with release ordering + * @v: pointer of type atomic64_t + * @i: value to exchange + * + * Atomically exchange @i with @v using release ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_xchg_release(atomic64_t *v, s64 i) { @@ -2944,6 +3177,18 @@ arch_atomic64_cmpxchg_acquire(atomic64_t *v, s64 old, s64 new) #endif #ifndef arch_atomic64_cmpxchg_release +/** + * arch_atomic64_cmpxchg_release - Atomic cmpxchg with release ordering + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing release ordering. + * Returns the old value *@v regardless of the result of + * the comparison. Therefore, if the return value is not + * equal to @old, the cmpxchg operation failed. + */ static __always_inline s64 arch_atomic64_cmpxchg_release(atomic64_t *v, s64 old, s64 new) { @@ -3093,6 +3338,18 @@ arch_atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new) #endif #ifndef arch_atomic64_try_cmpxchg_release +/** + * arch_atomic64_try_cmpxchg_release - Atomic try_cmpxchg with release ordering + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing release ordering. + * Returns @true if the cmpxchg operation succeeded, + * and false otherwise. Either way, stores the old + * value of *@v to *@old. + */ static __always_inline bool arch_atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new) { @@ -3267,6 +3524,15 @@ arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_add_negative_release +/** + * arch_atomic64_add_negative_release - Atomic add_negative with release ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i with @v using release ordering. + * Return @true if the result is negative, or @false when + * the result is greater than or equal to zero. + */ static __always_inline bool arch_atomic64_add_negative_release(s64 i, atomic64_t *v) { @@ -3426,4 +3692,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// a7944792460cf5adb72d49025850800d2cd178be +// 2caf9e8360f71f3841789431533b32b620a12c1e diff --git a/scripts/atomic/fallbacks/release b/scripts/atomic/fallbacks/release index b46feb56d69c..bce3a1cbd497 100755 --- a/scripts/atomic/fallbacks/release +++ b/scripts/atomic/fallbacks/release @@ -1,3 +1,5 @@ +acqrel=release +. ${ATOMICDIR}/acqrel.sh cat < X-Patchwork-Id: 92264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3830937vqo; Wed, 10 May 2023 11:22:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7efvDjdlWTkjXApN+6QIalffQ/ZMI/trN+LUYjcH1Zt8XlA3qdeHAFiFFikxoXFfiY4Oyq X-Received: by 2002:a05:6a20:244d:b0:101:7761:ad2a with SMTP id t13-20020a056a20244d00b001017761ad2amr6498323pzc.5.1683742976967; Wed, 10 May 2023 11:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742976; cv=none; d=google.com; s=arc-20160816; b=pQKG5XJ03SlzJskHbtKAfDEcV3tcwfb1ey3g5KtS6ViqfSIHl21qkMW4V0pMPbkJ9k E+5AijcrFmJStz6bIo/xirss+5lnXfgHcydQ0f3oCCO7GWY17+fQ/iOLXqONkhC4fI7F II06AW+xnL6bUjyDs/CnBXukU/Q7PluVvRwND+djkgMUNJ5HLEFdCdVSeUDdrGRjifjr KUZrXYNKjsxpmWwGBSKooZ0ozQeswmWXL4eyJaFbBiW3uqiamPJ09aCRx4V5zxnt0rtB vPPknRo1gEa9YZHUXZ6kiKWa8OxazCIS7i/MCwuXH/85xwlCVgmPJ5v0LTbe5nm0w0v5 +jDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mA8kzTrllIfFFMd85cvVmay9sp2/sVM2MVlMUYOWU68=; b=FlB7zbU6H9Una65Fp3la9YuAHTsRVl/HWjDOF1qWTBcom65u6IBq0cVPcSC3IefLng yZTnPnY7EgTP7dqk6V7kD/x5yo6qoq3uT4qRPuyuNvYkjxTF16lHwRYDTVRG757dc6bf LvGYSeHA1kj+IvS6QlUrJiKvZJJhDBc2QZ7jvWPBC2LTZGRkAXQhwKbIaeok0MWypknP kWPxBlSGNWfYID5Mx01JO/K56yBq1A1I6xunuVizQlxM9ofPL1l4/fEK2tbGbPCbyLeE IO0Cr48ghRePnn+wIfsCwu2WWAgy3kaVxsJ9cHlXG0g1jEt4hm4Bus/Y8/WOmtDj85lF VlKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MN2a7GB4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a633719000000b0050aad8e18a5si4624211pga.545.2023.05.10.11.22.41; Wed, 10 May 2023 11:22:56 -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=@kernel.org header.s=k20201202 header.b=MN2a7GB4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236625AbjEJSTc (ORCPT + 99 others); Wed, 10 May 2023 14:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235203AbjEJSSY (ORCPT ); Wed, 10 May 2023 14:18:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31D3365BD; Wed, 10 May 2023 11:18:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D56A463F9A; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1356C433AA; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=nBj3d4LCCUMW5/TfWa3VcbQzjTyzaZ4UhHxKnXGM9cY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MN2a7GB4jBlLpLdWwglaVMtLRtX0PlxxY2MebnjJWSUHXCE2Gb5AgMNmkp/Sf9Zxs cVEZydotkLzbTjB8d6sjgVj2Hd7mwa1t0D/sk4jSn/eVU7YA6zICa29gp+4USaAkqD jov0LW49r4S5ibs1FJa4zAwVIMcwsi2zmFVP/cscRnm0BJ8fbwYqwdhhA27QVe8W2J 00RUTqy1EiZ3h0iqTs5DKqCtYW0j/ypp3X0cYr7iWA8e3wIV/XaHB6pYk7Gq6xrR31 y4y60InlwF8j8J0HyqgdC5mX7R5Wy3ctHISfsq1LHH+uS2EdWX1kKvfAZy8GgrenpL +uGU+UZ5A5Mng== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 03C35CE21C8; Wed, 10 May 2023 11:17:19 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 16/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}${name}${sfx} Date: Wed, 10 May 2023 11:17:14 -0700 Message-Id: <20230510181717.2200934-16-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532475507703233?= X-GMAIL-MSGID: =?utf-8?q?1765532475507703233?= Add kernel-doc header template for arch_${atomic}_${pfx}${name}${sfx} function family with the help of my good friend awk, as encapsulated in acqrel.sh. Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 268 +++++++++++++++++++- scripts/atomic/fallbacks/fence | 2 + 2 files changed, 269 insertions(+), 1 deletion(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index ec6821b4bbc1..41aa94f0aacd 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -329,6 +329,14 @@ arch_atomic_add_return_release(int i, atomic_t *v) #endif #ifndef arch_atomic_add_return +/** + * arch_atomic_add_return - Atomic add with full ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i to @v using full ordering. + * Return new value. + */ static __always_inline int arch_atomic_add_return(int i, atomic_t *v) { @@ -387,6 +395,14 @@ arch_atomic_fetch_add_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_add +/** + * arch_atomic_fetch_add - Atomic add with full ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i to @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_add(int i, atomic_t *v) { @@ -445,6 +461,14 @@ arch_atomic_sub_return_release(int i, atomic_t *v) #endif #ifndef arch_atomic_sub_return +/** + * arch_atomic_sub_return - Atomic sub with full ordering + * @i: value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtract @i from @v using full ordering. + * Return new value. + */ static __always_inline int arch_atomic_sub_return(int i, atomic_t *v) { @@ -503,6 +527,14 @@ arch_atomic_fetch_sub_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_sub +/** + * arch_atomic_fetch_sub - Atomic sub with full ordering + * @i: value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtract @i from @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_sub(int i, atomic_t *v) { @@ -642,6 +674,13 @@ arch_atomic_inc_return_release(atomic_t *v) #endif #ifndef arch_atomic_inc_return +/** + * arch_atomic_inc_return - Atomic inc with full ordering + * @v: pointer of type atomic_t + * + * Atomically increment @v using full ordering. + * Return new value. + */ static __always_inline int arch_atomic_inc_return(atomic_t *v) { @@ -765,6 +804,13 @@ arch_atomic_fetch_inc_release(atomic_t *v) #endif #ifndef arch_atomic_fetch_inc +/** + * arch_atomic_fetch_inc - Atomic inc with full ordering + * @v: pointer of type atomic_t + * + * Atomically increment @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_inc(atomic_t *v) { @@ -904,6 +950,13 @@ arch_atomic_dec_return_release(atomic_t *v) #endif #ifndef arch_atomic_dec_return +/** + * arch_atomic_dec_return - Atomic dec with full ordering + * @v: pointer of type atomic_t + * + * Atomically decrement @v using full ordering. + * Return new value. + */ static __always_inline int arch_atomic_dec_return(atomic_t *v) { @@ -1027,6 +1080,13 @@ arch_atomic_fetch_dec_release(atomic_t *v) #endif #ifndef arch_atomic_fetch_dec +/** + * arch_atomic_fetch_dec - Atomic dec with full ordering + * @v: pointer of type atomic_t + * + * Atomically decrement @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_dec(atomic_t *v) { @@ -1085,6 +1145,14 @@ arch_atomic_fetch_and_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_and +/** + * arch_atomic_fetch_and - Atomic and with full ordering + * @i: value to AND + * @v: pointer of type atomic_t + * + * Atomically AND @i with @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_and(int i, atomic_t *v) { @@ -1231,6 +1299,14 @@ arch_atomic_fetch_andnot_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_andnot +/** + * arch_atomic_fetch_andnot - Atomic andnot with full ordering + * @i: value to complement then AND + * @v: pointer of type atomic_t + * + * Atomically complement then AND @i with @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_andnot(int i, atomic_t *v) { @@ -1289,6 +1365,14 @@ arch_atomic_fetch_or_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_or +/** + * arch_atomic_fetch_or - Atomic or with full ordering + * @i: value to OR + * @v: pointer of type atomic_t + * + * Atomically OR @i with @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_or(int i, atomic_t *v) { @@ -1347,6 +1431,14 @@ arch_atomic_fetch_xor_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_xor +/** + * arch_atomic_fetch_xor - Atomic xor with full ordering + * @i: value to XOR + * @v: pointer of type atomic_t + * + * Atomically XOR @i with @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_fetch_xor(int i, atomic_t *v) { @@ -1405,6 +1497,14 @@ arch_atomic_xchg_release(atomic_t *v, int i) #endif #ifndef arch_atomic_xchg +/** + * arch_atomic_xchg - Atomic xchg with full ordering + * @v: pointer of type atomic_t + * @i: value to exchange + * + * Atomically exchange @i with @v using full ordering. + * Return old value. + */ static __always_inline int arch_atomic_xchg(atomic_t *v, int i) { @@ -1471,6 +1571,18 @@ arch_atomic_cmpxchg_release(atomic_t *v, int old, int new) #endif #ifndef arch_atomic_cmpxchg +/** + * arch_atomic_cmpxchg - Atomic cmpxchg with full ordering + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing full ordering. + * Returns the old value *@v regardless of the result of + * the comparison. Therefore, if the return value is not + * equal to @old, the cmpxchg operation failed. + */ static __always_inline int arch_atomic_cmpxchg(atomic_t *v, int old, int new) { @@ -1632,6 +1744,18 @@ arch_atomic_try_cmpxchg_release(atomic_t *v, int *old, int new) #endif #ifndef arch_atomic_try_cmpxchg +/** + * arch_atomic_try_cmpxchg - Atomic try_cmpxchg with full ordering + * @v: pointer of type atomic_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing full ordering. + * Returns @true if the cmpxchg operation succeeded, + * and false otherwise. Either way, stores the old + * value of *@v to *@old. + */ static __always_inline bool arch_atomic_try_cmpxchg(atomic_t *v, int *old, int new) { @@ -1815,6 +1939,15 @@ arch_atomic_add_negative_release(int i, atomic_t *v) #endif #ifndef arch_atomic_add_negative +/** + * arch_atomic_add_negative - Atomic add_negative with full ordering + * @i: value to add + * @v: pointer of type atomic_t + * + * Atomically add @i with @v using full ordering. + * Return @true if the result is negative, or @false when + * the result is greater than or equal to zero. + */ static __always_inline bool arch_atomic_add_negative(int i, atomic_t *v) { @@ -2057,6 +2190,14 @@ arch_atomic64_add_return_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_add_return +/** + * arch_atomic64_add_return - Atomic add with full ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i to @v using full ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_add_return(s64 i, atomic64_t *v) { @@ -2115,6 +2256,14 @@ arch_atomic64_fetch_add_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_add +/** + * arch_atomic64_fetch_add - Atomic add with full ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i to @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_add(s64 i, atomic64_t *v) { @@ -2173,6 +2322,14 @@ arch_atomic64_sub_return_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_sub_return +/** + * arch_atomic64_sub_return - Atomic sub with full ordering + * @i: value to subtract + * @v: pointer of type atomic64_t + * + * Atomically subtract @i from @v using full ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_sub_return(s64 i, atomic64_t *v) { @@ -2231,6 +2388,14 @@ arch_atomic64_fetch_sub_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_sub +/** + * arch_atomic64_fetch_sub - Atomic sub with full ordering + * @i: value to subtract + * @v: pointer of type atomic64_t + * + * Atomically subtract @i from @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_sub(s64 i, atomic64_t *v) { @@ -2370,6 +2535,13 @@ arch_atomic64_inc_return_release(atomic64_t *v) #endif #ifndef arch_atomic64_inc_return +/** + * arch_atomic64_inc_return - Atomic inc with full ordering + * @v: pointer of type atomic64_t + * + * Atomically increment @v using full ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_inc_return(atomic64_t *v) { @@ -2493,6 +2665,13 @@ arch_atomic64_fetch_inc_release(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_inc +/** + * arch_atomic64_fetch_inc - Atomic inc with full ordering + * @v: pointer of type atomic64_t + * + * Atomically increment @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_inc(atomic64_t *v) { @@ -2632,6 +2811,13 @@ arch_atomic64_dec_return_release(atomic64_t *v) #endif #ifndef arch_atomic64_dec_return +/** + * arch_atomic64_dec_return - Atomic dec with full ordering + * @v: pointer of type atomic64_t + * + * Atomically decrement @v using full ordering. + * Return new value. + */ static __always_inline s64 arch_atomic64_dec_return(atomic64_t *v) { @@ -2755,6 +2941,13 @@ arch_atomic64_fetch_dec_release(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_dec +/** + * arch_atomic64_fetch_dec - Atomic dec with full ordering + * @v: pointer of type atomic64_t + * + * Atomically decrement @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_dec(atomic64_t *v) { @@ -2813,6 +3006,14 @@ arch_atomic64_fetch_and_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_and +/** + * arch_atomic64_fetch_and - Atomic and with full ordering + * @i: value to AND + * @v: pointer of type atomic64_t + * + * Atomically AND @i with @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_and(s64 i, atomic64_t *v) { @@ -2959,6 +3160,14 @@ arch_atomic64_fetch_andnot_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_andnot +/** + * arch_atomic64_fetch_andnot - Atomic andnot with full ordering + * @i: value to complement then AND + * @v: pointer of type atomic64_t + * + * Atomically complement then AND @i with @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_andnot(s64 i, atomic64_t *v) { @@ -3017,6 +3226,14 @@ arch_atomic64_fetch_or_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_or +/** + * arch_atomic64_fetch_or - Atomic or with full ordering + * @i: value to OR + * @v: pointer of type atomic64_t + * + * Atomically OR @i with @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_or(s64 i, atomic64_t *v) { @@ -3075,6 +3292,14 @@ arch_atomic64_fetch_xor_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_xor +/** + * arch_atomic64_fetch_xor - Atomic xor with full ordering + * @i: value to XOR + * @v: pointer of type atomic64_t + * + * Atomically XOR @i with @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_fetch_xor(s64 i, atomic64_t *v) { @@ -3133,6 +3358,14 @@ arch_atomic64_xchg_release(atomic64_t *v, s64 i) #endif #ifndef arch_atomic64_xchg +/** + * arch_atomic64_xchg - Atomic xchg with full ordering + * @v: pointer of type atomic64_t + * @i: value to exchange + * + * Atomically exchange @i with @v using full ordering. + * Return old value. + */ static __always_inline s64 arch_atomic64_xchg(atomic64_t *v, s64 i) { @@ -3199,6 +3432,18 @@ arch_atomic64_cmpxchg_release(atomic64_t *v, s64 old, s64 new) #endif #ifndef arch_atomic64_cmpxchg +/** + * arch_atomic64_cmpxchg - Atomic cmpxchg with full ordering + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing full ordering. + * Returns the old value *@v regardless of the result of + * the comparison. Therefore, if the return value is not + * equal to @old, the cmpxchg operation failed. + */ static __always_inline s64 arch_atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new) { @@ -3360,6 +3605,18 @@ arch_atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new) #endif #ifndef arch_atomic64_try_cmpxchg +/** + * arch_atomic64_try_cmpxchg - Atomic try_cmpxchg with full ordering + * @v: pointer of type atomic64_t + * @old: desired old value to match + * @new: new value to put in + * + * Atomically compares @new to *@v, and if equal, + * stores @new to *@v, providing full ordering. + * Returns @true if the cmpxchg operation succeeded, + * and false otherwise. Either way, stores the old + * value of *@v to *@old. + */ static __always_inline bool arch_atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new) { @@ -3543,6 +3800,15 @@ arch_atomic64_add_negative_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_add_negative +/** + * arch_atomic64_add_negative - Atomic add_negative with full ordering + * @i: value to add + * @v: pointer of type atomic64_t + * + * Atomically add @i with @v using full ordering. + * Return @true if the result is negative, or @false when + * the result is greater than or equal to zero. + */ static __always_inline bool arch_atomic64_add_negative(s64 i, atomic64_t *v) { @@ -3692,4 +3958,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 2caf9e8360f71f3841789431533b32b620a12c1e +// 7c2c97cd48cf9c672efc44b9fed5a37b8970dde4 diff --git a/scripts/atomic/fallbacks/fence b/scripts/atomic/fallbacks/fence index 07757d8e338e..975855dfba25 100755 --- a/scripts/atomic/fallbacks/fence +++ b/scripts/atomic/fallbacks/fence @@ -1,3 +1,5 @@ +acqrel=full +. ${ATOMICDIR}/acqrel.sh cat < X-Patchwork-Id: 92262 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3829310vqo; Wed, 10 May 2023 11:19:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5G5xlwdQ0Jdn3fcddy3mWZwpV/3iGlOKlLU3zAq5kdalZfYpRl4iScBjyRyzdRdjvSOrlx X-Received: by 2002:a05:6a00:990:b0:638:edbc:74ca with SMTP id u16-20020a056a00099000b00638edbc74camr25724180pfg.0.1683742798241; Wed, 10 May 2023 11:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683742798; cv=none; d=google.com; s=arc-20160816; b=Cv2VskVzHgoNoXWcjsbG4CMH2iXJO/VVcKRxoiziZSHM4qJE/35yZoEjXHKyl1jl0C ac8Oqxj3VrsHCQHcvY6z8Hux4FgY0woCfWT/oIwIZviJMICCgSL8A4EsuNE7B6Oxxsle OGsr6ZSGcBJbeYUpjFpplcpe8VbH3pmyQCLgnNgXFxcxreSGs9dWVTs3zXCmY6Kqvmzf xVFUJwa7pfYfWGqZ9oomVigTlEf9qoSRZ8oYwrfCRwCYc8HFrHbTAHfSDpluqROhCZ9y 3tz9jgD4LBpMAce2yQ7aqjwkqas4UwzSuRLd0hGLKWeXPCU4zfElmVnJPLE4e9f8zBIh YHpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+NzFVM00EVqII97kF8HEz/nOooSX77FvHK45gvFOFQg=; b=isKS76T+n3pI/zZhf98FnNgVkPpWU/H01jbEugiEZ8t92m5oM0clupoIQ+P8u4aeSE M8ge7jrEMsLU6EEFN7pDMUKgetq8gcvxZzy1twF9FQ8nDi9yLQG4+HE/+l7jpuF5EQyv HZWxvOmoZGcZSrW1JknM6EeEejNb+2AJBT+JleBJD8vsy90l98PrKQzONfrvsn3087mB APZJe9RjrpwgI2uY6XOH6jRGQDmmVjanJNPbbbNOhZqGyt8C2sl9b+JH7ks1VLGcPVjf 2PtxbPiy5ES+mVifsdfw1ryBPAcBKYwJzOBM751BkUIdF1MgCPAcwLYQbzs57idTZ7zF aiow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xce+75Gf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a633719000000b0050aad8e18a5si4624211pga.545.2023.05.10.11.19.44; Wed, 10 May 2023 11:19:58 -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=@kernel.org header.s=k20201202 header.b=Xce+75Gf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236017AbjEJSTL (ORCPT + 99 others); Wed, 10 May 2023 14:19:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236144AbjEJSSU (ORCPT ); Wed, 10 May 2023 14:18:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1730B83E7; Wed, 10 May 2023 11:18:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C80E963F94; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E139EC433AE; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742644; bh=O5+R08c8ff/9UCItSQg4aHCY6O5NYgQTn22+Zu0iVq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xce+75GfENdMWBpO3VsBhIq+md1L1PO/sfpQ26MlP7lpDMWE8xELlYvvI7F9H6Ndi VaCKiOScuM6OKVzlkdJSlnVy7YeKReqJcuqcbEUkTBGGE3LoH+hYCX5pZPbqBVuSe8 zO87kovaSZAGKDRIS8UaMgLQGxxZcOeXNjWxbrOaVdyRqjIDOyabSjgel2z2fI3mxz GHx65Y2Rf8mCE4QpBXQ9G+CNjMsVFSYNL3Gq9EhIJIUZTZs+FQIpCfbiwqfK5kmUEu rZZLhD/RTYr8j2Dtrenmxh2MDewaUdsaqqsecWPd69AkjSaE692PbpvFo7MIVyE46/ He9ag/wpppS/g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 06C1CCE21CB; Wed, 10 May 2023 11:17:19 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH locking/atomic 17/19] x86/atomic.h: Remove duplicate kernel-doc headers Date: Wed, 10 May 2023 11:17:15 -0700 Message-Id: <20230510181717.2200934-17-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765532288241102941?= X-GMAIL-MSGID: =?utf-8?q?1765532288241102941?= Scripting the kernel-doc headers resulted in a few duplicates. Remove the duplicates from the x86-specific files. Reported-by: Akira Yokosawa Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: --- arch/x86/include/asm/atomic.h | 60 ----------------------------------- 1 file changed, 60 deletions(-) diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index 5e754e895767..5df979d65fb5 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h @@ -69,27 +69,12 @@ static __always_inline void arch_atomic_sub(int i, atomic_t *v) : "ir" (i) : "memory"); } -/** - * arch_atomic_sub_and_test - subtract value from variable and test result - * @i: integer value to subtract - * @v: pointer of type atomic_t - * - * Atomically subtracts @i from @v and returns - * true if the result is zero, or false for all - * other cases. - */ static __always_inline bool arch_atomic_sub_and_test(int i, atomic_t *v) { return GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, e, "er", i); } #define arch_atomic_sub_and_test arch_atomic_sub_and_test -/** - * arch_atomic_inc - increment atomic variable - * @v: pointer of type atomic_t - * - * Atomically increments @v by 1. - */ static __always_inline void arch_atomic_inc(atomic_t *v) { asm volatile(LOCK_PREFIX "incl %0" @@ -97,12 +82,6 @@ static __always_inline void arch_atomic_inc(atomic_t *v) } #define arch_atomic_inc arch_atomic_inc -/** - * arch_atomic_dec - decrement atomic variable - * @v: pointer of type atomic_t - * - * Atomically decrements @v by 1. - */ static __always_inline void arch_atomic_dec(atomic_t *v) { asm volatile(LOCK_PREFIX "decl %0" @@ -110,69 +89,30 @@ static __always_inline void arch_atomic_dec(atomic_t *v) } #define arch_atomic_dec arch_atomic_dec -/** - * arch_atomic_dec_and_test - decrement and test - * @v: pointer of type atomic_t - * - * Atomically decrements @v by 1 and - * returns true if the result is 0, or false for all other - * cases. - */ static __always_inline bool arch_atomic_dec_and_test(atomic_t *v) { return GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, e); } #define arch_atomic_dec_and_test arch_atomic_dec_and_test -/** - * arch_atomic_inc_and_test - increment and test - * @v: pointer of type atomic_t - * - * Atomically increments @v by 1 - * and returns true if the result is zero, or false for all - * other cases. - */ static __always_inline bool arch_atomic_inc_and_test(atomic_t *v) { return GEN_UNARY_RMWcc(LOCK_PREFIX "incl", v->counter, e); } #define arch_atomic_inc_and_test arch_atomic_inc_and_test -/** - * arch_atomic_add_negative - add and test if negative - * @i: integer value to add - * @v: pointer of type atomic_t - * - * Atomically adds @i to @v and returns true - * if the result is negative, or false when - * result is greater than or equal to zero. - */ static __always_inline bool arch_atomic_add_negative(int i, atomic_t *v) { return GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, s, "er", i); } #define arch_atomic_add_negative arch_atomic_add_negative -/** - * arch_atomic_add_return - add integer and return - * @i: integer value to add - * @v: pointer of type atomic_t - * - * Atomically adds @i to @v and returns @i + @v - */ static __always_inline int arch_atomic_add_return(int i, atomic_t *v) { return i + xadd(&v->counter, i); } #define arch_atomic_add_return arch_atomic_add_return -/** - * arch_atomic_sub_return - subtract integer and return - * @v: pointer of type atomic_t - * @i: integer value to subtract - * - * Atomically subtracts @i from @v and returns @v - @i - */ static __always_inline int arch_atomic_sub_return(int i, atomic_t *v) { return arch_atomic_add_return(-i, v); From patchwork Wed May 10 18:17:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 92266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3837499vqo; Wed, 10 May 2023 11:35:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BN1dZq/FGna0flncxImEXE4TpW+OzDQoLL5Pct0URCaOmYUQfIAQE3XF6RpBmnoi9tWtv X-Received: by 2002:a05:6a21:920d:b0:f5:b7c9:57b8 with SMTP id tl13-20020a056a21920d00b000f5b7c957b8mr22491371pzb.42.1683743706113; Wed, 10 May 2023 11:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683743706; cv=none; d=google.com; s=arc-20160816; b=ZQWPfyRwX+yaT9ep12TSGLkvFzY+5gxpkOE3J2arm/x6nU0rIp003s55zOxE/Lh6ej 6rh9R6flb2yvbwRm5tDHh5v9Fm4X4d5gRJpb5XwwOehFFFKIg6khfRPUJdv/ZisHZrwm PtOK2HQUZBZTI/2knM51UdZhWTZpGBaC1qgStg99w/mNwH3gxh3NU7e3ljcpxERRXFYt dA9g2UOwPa3NaMD7IMZkbzbT7GMVH0pL8nQTv0xhAxoyoc5mRdqDxW+EkTTUZ3Gj6mak Zd2eYKE5aH/qbBgC46JW7rJOs4sG0APJOe3m8BgV/yMhaj5OofR0VpHiYTY7AB27ti7u 6EWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PHshiQ7uMs0NhQd/9DEx5xyGBepZ9abIcdZU/Ij/VPs=; b=Fy7CPNDtTiq/dQFxXdv2leLWrnJCc/t6Xu4SerCHkmuLOVknBLJtZw48CCwKthtVuO wK5UFj7sDzZKBKH0gUIAvIWct3pvHOcwh5XdK2pMvM0kNwKEbDjz6okXA8+Bc0xl4F7p THS3nPGGoI6XUGC/pHXuErt9xVmA4gVdLsetYz5jfy7d0S6qIVNpkUk4sqXo8agw3ODk AtVtsPRxGYgeKmePVnxrAj5ZTqpQ1i+hsZ95u/uJKL9SbjZ0JDy7yn1tv0QuMe9qTQFS jhGAlqh2xzNsiq3xVMTK1GWtnIT75xFulYfoBGzWfNE78Yt7r+/YnxUVL3eEoSw16+ji 3zTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SpL4jW3l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a63770a000000b0050f55427e3dsi5149349pgc.701.2023.05.10.11.34.48; Wed, 10 May 2023 11:35:06 -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=@kernel.org header.s=k20201202 header.b=SpL4jW3l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236637AbjEJSTg (ORCPT + 99 others); Wed, 10 May 2023 14:19:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236267AbjEJSS3 (ORCPT ); Wed, 10 May 2023 14:18:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B52E6EB5; Wed, 10 May 2023 11:18:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DB41663FA0; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DC51C433B0; Wed, 10 May 2023 18:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742645; bh=y/ijSymqpBi0ZgYxVDYAOqEJwBeBohZdg/EiWWO4gQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SpL4jW3lgLQL6fdbONVbO9vIjML/uzlFGHsP8A+ANFzC0DO+iBakWjs1iRMeeKkuC uAdO67olpmJ8qNeOmlSgkTU316iYAQmFy6t8xx0sxKFUGlDM3BZ1oZuCDpRX64bHbc bY92jOyaLQnDqoxFG2z6gC/r3EHhLGcCf9S+Wr/VIieW06uYdeTAAJpV27IboEiM0j uZ7URj6RR2acCpL3FPQm+HTUnTh0K2ZLCmSmsU8cCfJW+rXORx4RWrBropKCd2jw/F eLjQMEmchBZv5bvUNSeotqC+kCWj3LuMy6Sdg7bGUfolbwzzcldmMkaYy8pWT1bylZ 9BVkZQHNkLQ8Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 09D44CE21D3; Wed, 10 May 2023 11:17:19 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 18/19] locking/atomic: Refrain from generating duplicate fallback kernel-doc Date: Wed, 10 May 2023 11:17:16 -0700 Message-Id: <20230510181717.2200934-18-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765533240227809923?= X-GMAIL-MSGID: =?utf-8?q?1765533240227809923?= The gen-atomics.sh script currently generates 42 duplicate definitions: arch_atomic64_add_negative arch_atomic64_add_negative_acquire arch_atomic64_add_negative_release arch_atomic64_dec_return arch_atomic64_dec_return_acquire arch_atomic64_dec_return_release arch_atomic64_fetch_andnot arch_atomic64_fetch_andnot_acquire arch_atomic64_fetch_andnot_release arch_atomic64_fetch_dec arch_atomic64_fetch_dec_acquire arch_atomic64_fetch_dec_release arch_atomic64_fetch_inc arch_atomic64_fetch_inc_acquire arch_atomic64_fetch_inc_release arch_atomic64_inc_return arch_atomic64_inc_return_acquire arch_atomic64_inc_return_release arch_atomic64_try_cmpxchg arch_atomic64_try_cmpxchg_acquire arch_atomic64_try_cmpxchg_release arch_atomic_add_negative arch_atomic_add_negative_acquire arch_atomic_add_negative_release arch_atomic_dec_return arch_atomic_dec_return_acquire arch_atomic_dec_return_release arch_atomic_fetch_andnot arch_atomic_fetch_andnot_acquire arch_atomic_fetch_andnot_release arch_atomic_fetch_dec arch_atomic_fetch_dec_acquire arch_atomic_fetch_dec_release arch_atomic_fetch_inc arch_atomic_fetch_inc_acquire arch_atomic_fetch_inc_release arch_atomic_inc_return arch_atomic_inc_return_acquire arch_atomic_inc_return_release arch_atomic_try_cmpxchg arch_atomic_try_cmpxchg_acquire arch_atomic_try_cmpxchg_release These duplicates are presumably to handle different architectures generating hand-coded definitions for different subsets of the atomic operations. However, generating duplicate kernel-doc headers is undesirable. Therefore, generate only the first kernel-doc definition in a group of duplicates. A comment indicates the name of the function and the fallback script that generated it. Reported-by: Akira Yokosawa Signed-off-by: Paul E. McKenney Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland --- include/linux/atomic/atomic-arch-fallback.h | 386 +++---------------- scripts/atomic/chkdup.sh | 27 ++ scripts/atomic/fallbacks/acquire | 3 + scripts/atomic/fallbacks/add_negative | 5 + scripts/atomic/fallbacks/add_unless | 5 + scripts/atomic/fallbacks/andnot | 5 + scripts/atomic/fallbacks/dec | 5 + scripts/atomic/fallbacks/dec_and_test | 5 + scripts/atomic/fallbacks/dec_if_positive | 5 + scripts/atomic/fallbacks/dec_unless_positive | 5 + scripts/atomic/fallbacks/fence | 3 + scripts/atomic/fallbacks/fetch_add_unless | 5 + scripts/atomic/fallbacks/inc | 5 + scripts/atomic/fallbacks/inc_and_test | 5 + scripts/atomic/fallbacks/inc_not_zero | 5 + scripts/atomic/fallbacks/inc_unless_negative | 5 + scripts/atomic/fallbacks/read_acquire | 5 + scripts/atomic/fallbacks/release | 3 + scripts/atomic/fallbacks/set_release | 5 + scripts/atomic/fallbacks/sub_and_test | 5 + scripts/atomic/fallbacks/try_cmpxchg | 5 + scripts/atomic/gen-atomics.sh | 4 + 22 files changed, 163 insertions(+), 343 deletions(-) create mode 100644 scripts/atomic/chkdup.sh diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index 41aa94f0aacd..2d56726f8662 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -639,13 +639,7 @@ arch_atomic_inc_return_relaxed(atomic_t *v) #else /* arch_atomic_inc_return_relaxed */ #ifndef arch_atomic_inc_return_acquire -/** - * arch_atomic_inc_return_acquire - Atomic inc with acquire ordering - * @v: pointer of type atomic_t - * - * Atomically increment @v using acquire ordering. - * Return new value. - */ +// Fallback acquire omitting duplicate arch_atomic_inc_return_acquire() kernel-doc header. static __always_inline int arch_atomic_inc_return_acquire(atomic_t *v) { @@ -657,13 +651,7 @@ arch_atomic_inc_return_acquire(atomic_t *v) #endif #ifndef arch_atomic_inc_return_release -/** - * arch_atomic_inc_return_release - Atomic inc with release ordering - * @v: pointer of type atomic_t - * - * Atomically increment @v using release ordering. - * Return new value. - */ +// Fallback release omitting duplicate arch_atomic_inc_return_release() kernel-doc header. static __always_inline int arch_atomic_inc_return_release(atomic_t *v) { @@ -674,13 +662,7 @@ arch_atomic_inc_return_release(atomic_t *v) #endif #ifndef arch_atomic_inc_return -/** - * arch_atomic_inc_return - Atomic inc with full ordering - * @v: pointer of type atomic_t - * - * Atomically increment @v using full ordering. - * Return new value. - */ +// Fallback fence omitting duplicate arch_atomic_inc_return() kernel-doc header. static __always_inline int arch_atomic_inc_return(atomic_t *v) { @@ -769,13 +751,7 @@ arch_atomic_fetch_inc_relaxed(atomic_t *v) #else /* arch_atomic_fetch_inc_relaxed */ #ifndef arch_atomic_fetch_inc_acquire -/** - * arch_atomic_fetch_inc_acquire - Atomic inc with acquire ordering - * @v: pointer of type atomic_t - * - * Atomically increment @v using acquire ordering. - * Return old value. - */ +// Fallback acquire omitting duplicate arch_atomic_fetch_inc_acquire() kernel-doc header. static __always_inline int arch_atomic_fetch_inc_acquire(atomic_t *v) { @@ -787,13 +763,7 @@ arch_atomic_fetch_inc_acquire(atomic_t *v) #endif #ifndef arch_atomic_fetch_inc_release -/** - * arch_atomic_fetch_inc_release - Atomic inc with release ordering - * @v: pointer of type atomic_t - * - * Atomically increment @v using release ordering. - * Return old value. - */ +// Fallback release omitting duplicate arch_atomic_fetch_inc_release() kernel-doc header. static __always_inline int arch_atomic_fetch_inc_release(atomic_t *v) { @@ -804,13 +774,7 @@ arch_atomic_fetch_inc_release(atomic_t *v) #endif #ifndef arch_atomic_fetch_inc -/** - * arch_atomic_fetch_inc - Atomic inc with full ordering - * @v: pointer of type atomic_t - * - * Atomically increment @v using full ordering. - * Return old value. - */ +// Fallback fence omitting duplicate arch_atomic_fetch_inc() kernel-doc header. static __always_inline int arch_atomic_fetch_inc(atomic_t *v) { @@ -915,13 +879,7 @@ arch_atomic_dec_return_relaxed(atomic_t *v) #else /* arch_atomic_dec_return_relaxed */ #ifndef arch_atomic_dec_return_acquire -/** - * arch_atomic_dec_return_acquire - Atomic dec with acquire ordering - * @v: pointer of type atomic_t - * - * Atomically decrement @v using acquire ordering. - * Return new value. - */ +// Fallback acquire omitting duplicate arch_atomic_dec_return_acquire() kernel-doc header. static __always_inline int arch_atomic_dec_return_acquire(atomic_t *v) { @@ -933,13 +891,7 @@ arch_atomic_dec_return_acquire(atomic_t *v) #endif #ifndef arch_atomic_dec_return_release -/** - * arch_atomic_dec_return_release - Atomic dec with release ordering - * @v: pointer of type atomic_t - * - * Atomically decrement @v using release ordering. - * Return new value. - */ +// Fallback release omitting duplicate arch_atomic_dec_return_release() kernel-doc header. static __always_inline int arch_atomic_dec_return_release(atomic_t *v) { @@ -950,13 +902,7 @@ arch_atomic_dec_return_release(atomic_t *v) #endif #ifndef arch_atomic_dec_return -/** - * arch_atomic_dec_return - Atomic dec with full ordering - * @v: pointer of type atomic_t - * - * Atomically decrement @v using full ordering. - * Return new value. - */ +// Fallback fence omitting duplicate arch_atomic_dec_return() kernel-doc header. static __always_inline int arch_atomic_dec_return(atomic_t *v) { @@ -1045,13 +991,7 @@ arch_atomic_fetch_dec_relaxed(atomic_t *v) #else /* arch_atomic_fetch_dec_relaxed */ #ifndef arch_atomic_fetch_dec_acquire -/** - * arch_atomic_fetch_dec_acquire - Atomic dec with acquire ordering - * @v: pointer of type atomic_t - * - * Atomically decrement @v using acquire ordering. - * Return old value. - */ +// Fallback acquire omitting duplicate arch_atomic_fetch_dec_acquire() kernel-doc header. static __always_inline int arch_atomic_fetch_dec_acquire(atomic_t *v) { @@ -1063,13 +1003,7 @@ arch_atomic_fetch_dec_acquire(atomic_t *v) #endif #ifndef arch_atomic_fetch_dec_release -/** - * arch_atomic_fetch_dec_release - Atomic dec with release ordering - * @v: pointer of type atomic_t - * - * Atomically decrement @v using release ordering. - * Return old value. - */ +// Fallback release omitting duplicate arch_atomic_fetch_dec_release() kernel-doc header. static __always_inline int arch_atomic_fetch_dec_release(atomic_t *v) { @@ -1080,13 +1014,7 @@ arch_atomic_fetch_dec_release(atomic_t *v) #endif #ifndef arch_atomic_fetch_dec -/** - * arch_atomic_fetch_dec - Atomic dec with full ordering - * @v: pointer of type atomic_t - * - * Atomically decrement @v using full ordering. - * Return old value. - */ +// Fallback fence omitting duplicate arch_atomic_fetch_dec() kernel-doc header. static __always_inline int arch_atomic_fetch_dec(atomic_t *v) { @@ -1262,14 +1190,7 @@ arch_atomic_fetch_andnot_relaxed(int i, atomic_t *v) #else /* arch_atomic_fetch_andnot_relaxed */ #ifndef arch_atomic_fetch_andnot_acquire -/** - * arch_atomic_fetch_andnot_acquire - Atomic andnot with acquire ordering - * @i: value to complement then AND - * @v: pointer of type atomic_t - * - * Atomically complement then AND @i with @v using acquire ordering. - * Return old value. - */ +// Fallback acquire omitting duplicate arch_atomic_fetch_andnot_acquire() kernel-doc header. static __always_inline int arch_atomic_fetch_andnot_acquire(int i, atomic_t *v) { @@ -1281,14 +1202,7 @@ arch_atomic_fetch_andnot_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_andnot_release -/** - * arch_atomic_fetch_andnot_release - Atomic andnot with release ordering - * @i: value to complement then AND - * @v: pointer of type atomic_t - * - * Atomically complement then AND @i with @v using release ordering. - * Return old value. - */ +// Fallback release omitting duplicate arch_atomic_fetch_andnot_release() kernel-doc header. static __always_inline int arch_atomic_fetch_andnot_release(int i, atomic_t *v) { @@ -1299,14 +1213,7 @@ arch_atomic_fetch_andnot_release(int i, atomic_t *v) #endif #ifndef arch_atomic_fetch_andnot -/** - * arch_atomic_fetch_andnot - Atomic andnot with full ordering - * @i: value to complement then AND - * @v: pointer of type atomic_t - * - * Atomically complement then AND @i with @v using full ordering. - * Return old value. - */ +// Fallback fence omitting duplicate arch_atomic_fetch_andnot() kernel-doc header. static __always_inline int arch_atomic_fetch_andnot(int i, atomic_t *v) { @@ -1699,18 +1606,7 @@ arch_atomic_try_cmpxchg_relaxed(atomic_t *v, int *old, int new) #else /* arch_atomic_try_cmpxchg_relaxed */ #ifndef arch_atomic_try_cmpxchg_acquire -/** - * arch_atomic_try_cmpxchg_acquire - Atomic try_cmpxchg with acquire ordering - * @v: pointer of type atomic_t - * @old: desired old value to match - * @new: new value to put in - * - * Atomically compares @new to *@v, and if equal, - * stores @new to *@v, providing acquire ordering. - * Returns @true if the cmpxchg operation succeeded, - * and false otherwise. Either way, stores the old - * value of *@v to *@old. - */ +// Fallback acquire omitting duplicate arch_atomic_try_cmpxchg_acquire() kernel-doc header. static __always_inline bool arch_atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new) { @@ -1722,18 +1618,7 @@ arch_atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new) #endif #ifndef arch_atomic_try_cmpxchg_release -/** - * arch_atomic_try_cmpxchg_release - Atomic try_cmpxchg with release ordering - * @v: pointer of type atomic_t - * @old: desired old value to match - * @new: new value to put in - * - * Atomically compares @new to *@v, and if equal, - * stores @new to *@v, providing release ordering. - * Returns @true if the cmpxchg operation succeeded, - * and false otherwise. Either way, stores the old - * value of *@v to *@old. - */ +// Fallback release omitting duplicate arch_atomic_try_cmpxchg_release() kernel-doc header. static __always_inline bool arch_atomic_try_cmpxchg_release(atomic_t *v, int *old, int new) { @@ -1744,18 +1629,7 @@ arch_atomic_try_cmpxchg_release(atomic_t *v, int *old, int new) #endif #ifndef arch_atomic_try_cmpxchg -/** - * arch_atomic_try_cmpxchg - Atomic try_cmpxchg with full ordering - * @v: pointer of type atomic_t - * @old: desired old value to match - * @new: new value to put in - * - * Atomically compares @new to *@v, and if equal, - * stores @new to *@v, providing full ordering. - * Returns @true if the cmpxchg operation succeeded, - * and false otherwise. Either way, stores the old - * value of *@v to *@old. - */ +// Fallback fence omitting duplicate arch_atomic_try_cmpxchg() kernel-doc header. static __always_inline bool arch_atomic_try_cmpxchg(atomic_t *v, int *old, int new) { @@ -1900,15 +1774,7 @@ arch_atomic_add_negative_relaxed(int i, atomic_t *v) #else /* arch_atomic_add_negative_relaxed */ #ifndef arch_atomic_add_negative_acquire -/** - * arch_atomic_add_negative_acquire - Atomic add_negative with acquire ordering - * @i: value to add - * @v: pointer of type atomic_t - * - * Atomically add @i with @v using acquire ordering. - * Return @true if the result is negative, or @false when - * the result is greater than or equal to zero. - */ +// Fallback acquire omitting duplicate arch_atomic_add_negative_acquire() kernel-doc header. static __always_inline bool arch_atomic_add_negative_acquire(int i, atomic_t *v) { @@ -1920,15 +1786,7 @@ arch_atomic_add_negative_acquire(int i, atomic_t *v) #endif #ifndef arch_atomic_add_negative_release -/** - * arch_atomic_add_negative_release - Atomic add_negative with release ordering - * @i: value to add - * @v: pointer of type atomic_t - * - * Atomically add @i with @v using release ordering. - * Return @true if the result is negative, or @false when - * the result is greater than or equal to zero. - */ +// Fallback release omitting duplicate arch_atomic_add_negative_release() kernel-doc header. static __always_inline bool arch_atomic_add_negative_release(int i, atomic_t *v) { @@ -1939,15 +1797,7 @@ arch_atomic_add_negative_release(int i, atomic_t *v) #endif #ifndef arch_atomic_add_negative -/** - * arch_atomic_add_negative - Atomic add_negative with full ordering - * @i: value to add - * @v: pointer of type atomic_t - * - * Atomically add @i with @v using full ordering. - * Return @true if the result is negative, or @false when - * the result is greater than or equal to zero. - */ +// Fallback fence omitting duplicate arch_atomic_add_negative() kernel-doc header. static __always_inline bool arch_atomic_add_negative(int i, atomic_t *v) { @@ -2500,13 +2350,7 @@ arch_atomic64_inc_return_relaxed(atomic64_t *v) #else /* arch_atomic64_inc_return_relaxed */ #ifndef arch_atomic64_inc_return_acquire -/** - * arch_atomic64_inc_return_acquire - Atomic inc with acquire ordering - * @v: pointer of type atomic64_t - * - * Atomically increment @v using acquire ordering. - * Return new value. - */ +// Fallback acquire omitting duplicate arch_atomic64_inc_return_acquire() kernel-doc header. static __always_inline s64 arch_atomic64_inc_return_acquire(atomic64_t *v) { @@ -2518,13 +2362,7 @@ arch_atomic64_inc_return_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_inc_return_release -/** - * arch_atomic64_inc_return_release - Atomic inc with release ordering - * @v: pointer of type atomic64_t - * - * Atomically increment @v using release ordering. - * Return new value. - */ +// Fallback release omitting duplicate arch_atomic64_inc_return_release() kernel-doc header. static __always_inline s64 arch_atomic64_inc_return_release(atomic64_t *v) { @@ -2535,13 +2373,7 @@ arch_atomic64_inc_return_release(atomic64_t *v) #endif #ifndef arch_atomic64_inc_return -/** - * arch_atomic64_inc_return - Atomic inc with full ordering - * @v: pointer of type atomic64_t - * - * Atomically increment @v using full ordering. - * Return new value. - */ +// Fallback fence omitting duplicate arch_atomic64_inc_return() kernel-doc header. static __always_inline s64 arch_atomic64_inc_return(atomic64_t *v) { @@ -2630,13 +2462,7 @@ arch_atomic64_fetch_inc_relaxed(atomic64_t *v) #else /* arch_atomic64_fetch_inc_relaxed */ #ifndef arch_atomic64_fetch_inc_acquire -/** - * arch_atomic64_fetch_inc_acquire - Atomic inc with acquire ordering - * @v: pointer of type atomic64_t - * - * Atomically increment @v using acquire ordering. - * Return old value. - */ +// Fallback acquire omitting duplicate arch_atomic64_fetch_inc_acquire() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_inc_acquire(atomic64_t *v) { @@ -2648,13 +2474,7 @@ arch_atomic64_fetch_inc_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_inc_release -/** - * arch_atomic64_fetch_inc_release - Atomic inc with release ordering - * @v: pointer of type atomic64_t - * - * Atomically increment @v using release ordering. - * Return old value. - */ +// Fallback release omitting duplicate arch_atomic64_fetch_inc_release() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_inc_release(atomic64_t *v) { @@ -2665,13 +2485,7 @@ arch_atomic64_fetch_inc_release(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_inc -/** - * arch_atomic64_fetch_inc - Atomic inc with full ordering - * @v: pointer of type atomic64_t - * - * Atomically increment @v using full ordering. - * Return old value. - */ +// Fallback fence omitting duplicate arch_atomic64_fetch_inc() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_inc(atomic64_t *v) { @@ -2776,13 +2590,7 @@ arch_atomic64_dec_return_relaxed(atomic64_t *v) #else /* arch_atomic64_dec_return_relaxed */ #ifndef arch_atomic64_dec_return_acquire -/** - * arch_atomic64_dec_return_acquire - Atomic dec with acquire ordering - * @v: pointer of type atomic64_t - * - * Atomically decrement @v using acquire ordering. - * Return new value. - */ +// Fallback acquire omitting duplicate arch_atomic64_dec_return_acquire() kernel-doc header. static __always_inline s64 arch_atomic64_dec_return_acquire(atomic64_t *v) { @@ -2794,13 +2602,7 @@ arch_atomic64_dec_return_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_dec_return_release -/** - * arch_atomic64_dec_return_release - Atomic dec with release ordering - * @v: pointer of type atomic64_t - * - * Atomically decrement @v using release ordering. - * Return new value. - */ +// Fallback release omitting duplicate arch_atomic64_dec_return_release() kernel-doc header. static __always_inline s64 arch_atomic64_dec_return_release(atomic64_t *v) { @@ -2811,13 +2613,7 @@ arch_atomic64_dec_return_release(atomic64_t *v) #endif #ifndef arch_atomic64_dec_return -/** - * arch_atomic64_dec_return - Atomic dec with full ordering - * @v: pointer of type atomic64_t - * - * Atomically decrement @v using full ordering. - * Return new value. - */ +// Fallback fence omitting duplicate arch_atomic64_dec_return() kernel-doc header. static __always_inline s64 arch_atomic64_dec_return(atomic64_t *v) { @@ -2906,13 +2702,7 @@ arch_atomic64_fetch_dec_relaxed(atomic64_t *v) #else /* arch_atomic64_fetch_dec_relaxed */ #ifndef arch_atomic64_fetch_dec_acquire -/** - * arch_atomic64_fetch_dec_acquire - Atomic dec with acquire ordering - * @v: pointer of type atomic64_t - * - * Atomically decrement @v using acquire ordering. - * Return old value. - */ +// Fallback acquire omitting duplicate arch_atomic64_fetch_dec_acquire() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_dec_acquire(atomic64_t *v) { @@ -2924,13 +2714,7 @@ arch_atomic64_fetch_dec_acquire(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_dec_release -/** - * arch_atomic64_fetch_dec_release - Atomic dec with release ordering - * @v: pointer of type atomic64_t - * - * Atomically decrement @v using release ordering. - * Return old value. - */ +// Fallback release omitting duplicate arch_atomic64_fetch_dec_release() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_dec_release(atomic64_t *v) { @@ -2941,13 +2725,7 @@ arch_atomic64_fetch_dec_release(atomic64_t *v) #endif #ifndef arch_atomic64_fetch_dec -/** - * arch_atomic64_fetch_dec - Atomic dec with full ordering - * @v: pointer of type atomic64_t - * - * Atomically decrement @v using full ordering. - * Return old value. - */ +// Fallback fence omitting duplicate arch_atomic64_fetch_dec() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_dec(atomic64_t *v) { @@ -3123,14 +2901,7 @@ arch_atomic64_fetch_andnot_relaxed(s64 i, atomic64_t *v) #else /* arch_atomic64_fetch_andnot_relaxed */ #ifndef arch_atomic64_fetch_andnot_acquire -/** - * arch_atomic64_fetch_andnot_acquire - Atomic andnot with acquire ordering - * @i: value to complement then AND - * @v: pointer of type atomic64_t - * - * Atomically complement then AND @i with @v using acquire ordering. - * Return old value. - */ +// Fallback acquire omitting duplicate arch_atomic64_fetch_andnot_acquire() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v) { @@ -3142,14 +2913,7 @@ arch_atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_andnot_release -/** - * arch_atomic64_fetch_andnot_release - Atomic andnot with release ordering - * @i: value to complement then AND - * @v: pointer of type atomic64_t - * - * Atomically complement then AND @i with @v using release ordering. - * Return old value. - */ +// Fallback release omitting duplicate arch_atomic64_fetch_andnot_release() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_andnot_release(s64 i, atomic64_t *v) { @@ -3160,14 +2924,7 @@ arch_atomic64_fetch_andnot_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_fetch_andnot -/** - * arch_atomic64_fetch_andnot - Atomic andnot with full ordering - * @i: value to complement then AND - * @v: pointer of type atomic64_t - * - * Atomically complement then AND @i with @v using full ordering. - * Return old value. - */ +// Fallback fence omitting duplicate arch_atomic64_fetch_andnot() kernel-doc header. static __always_inline s64 arch_atomic64_fetch_andnot(s64 i, atomic64_t *v) { @@ -3560,18 +3317,7 @@ arch_atomic64_try_cmpxchg_relaxed(atomic64_t *v, s64 *old, s64 new) #else /* arch_atomic64_try_cmpxchg_relaxed */ #ifndef arch_atomic64_try_cmpxchg_acquire -/** - * arch_atomic64_try_cmpxchg_acquire - Atomic try_cmpxchg with acquire ordering - * @v: pointer of type atomic64_t - * @old: desired old value to match - * @new: new value to put in - * - * Atomically compares @new to *@v, and if equal, - * stores @new to *@v, providing acquire ordering. - * Returns @true if the cmpxchg operation succeeded, - * and false otherwise. Either way, stores the old - * value of *@v to *@old. - */ +// Fallback acquire omitting duplicate arch_atomic64_try_cmpxchg_acquire() kernel-doc header. static __always_inline bool arch_atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new) { @@ -3583,18 +3329,7 @@ arch_atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new) #endif #ifndef arch_atomic64_try_cmpxchg_release -/** - * arch_atomic64_try_cmpxchg_release - Atomic try_cmpxchg with release ordering - * @v: pointer of type atomic64_t - * @old: desired old value to match - * @new: new value to put in - * - * Atomically compares @new to *@v, and if equal, - * stores @new to *@v, providing release ordering. - * Returns @true if the cmpxchg operation succeeded, - * and false otherwise. Either way, stores the old - * value of *@v to *@old. - */ +// Fallback release omitting duplicate arch_atomic64_try_cmpxchg_release() kernel-doc header. static __always_inline bool arch_atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new) { @@ -3605,18 +3340,7 @@ arch_atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new) #endif #ifndef arch_atomic64_try_cmpxchg -/** - * arch_atomic64_try_cmpxchg - Atomic try_cmpxchg with full ordering - * @v: pointer of type atomic64_t - * @old: desired old value to match - * @new: new value to put in - * - * Atomically compares @new to *@v, and if equal, - * stores @new to *@v, providing full ordering. - * Returns @true if the cmpxchg operation succeeded, - * and false otherwise. Either way, stores the old - * value of *@v to *@old. - */ +// Fallback fence omitting duplicate arch_atomic64_try_cmpxchg() kernel-doc header. static __always_inline bool arch_atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new) { @@ -3761,15 +3485,7 @@ arch_atomic64_add_negative_relaxed(s64 i, atomic64_t *v) #else /* arch_atomic64_add_negative_relaxed */ #ifndef arch_atomic64_add_negative_acquire -/** - * arch_atomic64_add_negative_acquire - Atomic add_negative with acquire ordering - * @i: value to add - * @v: pointer of type atomic64_t - * - * Atomically add @i with @v using acquire ordering. - * Return @true if the result is negative, or @false when - * the result is greater than or equal to zero. - */ +// Fallback acquire omitting duplicate arch_atomic64_add_negative_acquire() kernel-doc header. static __always_inline bool arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) { @@ -3781,15 +3497,7 @@ arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_add_negative_release -/** - * arch_atomic64_add_negative_release - Atomic add_negative with release ordering - * @i: value to add - * @v: pointer of type atomic64_t - * - * Atomically add @i with @v using release ordering. - * Return @true if the result is negative, or @false when - * the result is greater than or equal to zero. - */ +// Fallback release omitting duplicate arch_atomic64_add_negative_release() kernel-doc header. static __always_inline bool arch_atomic64_add_negative_release(s64 i, atomic64_t *v) { @@ -3800,15 +3508,7 @@ arch_atomic64_add_negative_release(s64 i, atomic64_t *v) #endif #ifndef arch_atomic64_add_negative -/** - * arch_atomic64_add_negative - Atomic add_negative with full ordering - * @i: value to add - * @v: pointer of type atomic64_t - * - * Atomically add @i with @v using full ordering. - * Return @true if the result is negative, or @false when - * the result is greater than or equal to zero. - */ +// Fallback fence omitting duplicate arch_atomic64_add_negative() kernel-doc header. static __always_inline bool arch_atomic64_add_negative(s64 i, atomic64_t *v) { @@ -3958,4 +3658,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 7c2c97cd48cf9c672efc44b9fed5a37b8970dde4 +// 9bf9febc5288ed9539d1b3cfbbc6e36743b74c3b diff --git a/scripts/atomic/chkdup.sh b/scripts/atomic/chkdup.sh new file mode 100644 index 000000000000..04bb4f5c5c34 --- /dev/null +++ b/scripts/atomic/chkdup.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Check to see if the specified atomic is already in use. This is +# done by keeping filenames in the temporary directory specified by the +# environment variable T. +# +# Usage: +# chkdup.sh name fallback +# +# The "name" argument is the name of the function to be generated, and +# the "fallback" argument is the name of the fallback script that is +# doing the generation. +# +# If the function is a duplicate, output a comment saying so and +# exit with non-zero (error) status. Otherwise exit successfully +# +# If the function is a duplicate, output a comment saying so and +# exit with non-zero (error) status. Otherwise exit successfully. + +if test -f ${T}/${1} +then + echo // Fallback ${2} omitting duplicate "${1}()" kernel-doc header. + exit 1 +fi +touch ${T}/${1} +exit 0 diff --git a/scripts/atomic/fallbacks/acquire b/scripts/atomic/fallbacks/acquire index 08fc6c30a9ef..a349935ac7fe 100755 --- a/scripts/atomic/fallbacks/acquire +++ b/scripts/atomic/fallbacks/acquire @@ -1,5 +1,8 @@ +if /bin/sh ${ATOMICDIR}/chkdup.sh arch_${atomic}_${pfx}${name}${sfx}_acquire acquire +then acqrel=acquire . ${ATOMICDIR}/acqrel.sh +fi cat << EOF static __always_inline ${ret} arch_${atomic}_${pfx}${name}${sfx}_acquire(${params}) diff --git a/scripts/atomic/fallbacks/add_negative b/scripts/atomic/fallbacks/add_negative index c032e8bec6e2..b105fdfe8fd1 100755 --- a/scripts/atomic/fallbacks/add_negative +++ b/scripts/atomic/fallbacks/add_negative @@ -1,3 +1,5 @@ +if /bin/sh ${ATOMICDIR}/chkdup.sh arch_${atomic}_add_negative${order} add_negative +then cat < X-Patchwork-Id: 92272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3843534vqo; Wed, 10 May 2023 11:46:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4R7cYeLYl56a5PZCZb/pvQVAbgw+bfZFw7W86QjfE/i4oCF2k8EM899jI1XoMQqA0zOQxK X-Received: by 2002:a17:902:c402:b0:1ac:b259:87ea with SMTP id k2-20020a170902c40200b001acb25987eamr4053113plk.0.1683744387643; Wed, 10 May 2023 11:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683744387; cv=none; d=google.com; s=arc-20160816; b=UCfxyL3YmKPUxjXbxp4KcuKoGhRAYVesRMAVhj9Y6qMENb4a3p9uY2RtwNOaJ0HE4B VFmjUzsFa5L4LRmiRDuHDSIFh8AdA+kUd0xZO7DgB3nbX6gkII9kvtEjHR0v+Z11YP/o wrQrBo8r/r3C0gyntNHvy1KUfpm5AFadf1LkgwKcxceiUcLNQa0OubEQDsYitjbrojLF 9UKt5utgvy9Pl+f++bnGa3JlbcSiF5QPPIfgMA9StntevLjDC/3C6QDZ2xcaM0oATKrT zXd1riUDSYN3NE+hETwpI/w07MMQLFzhyDItJa9Jxw+TLp5c9dDyv0LZc3duRJN5pCkO 9RNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qntpf8KKGvIOl64063SWa9bRsPTn5u3/bLvG+PFzuoI=; b=jllsr4XCXBftoWqw6EN1DDINTUThjZdsZ1eA8SCdVe+Q32uywAH9h6IcxRl/BMojX4 zHdDdJrhgZPlu33KLzyTYu1UUFgY1hTaUx13OW+fiJyGbUPZFWu0i1Ov5zH/dzVjkDee UB2tDBLIyCzNv4aVDFjlmhFQ07mClsAXGyVIJYo1fjaESBJgL4SmAtO5iTvqz/Np5G4k 4n5dXr+zhMGVK/7MFrVq18u301hM9dzdFE3Yb9NMdtqOHyllEL6uhdRJXB+eScItoJsN o0eZFnex71l/hAeKGK9QdOot5N37GtgWR9Qh9NHInBd7AbizFRngEA3NEiMwIHCcpbJ4 aPyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E6FdKMPC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a170902d90500b001a656596b9esi4178295plz.608.2023.05.10.11.46.14; Wed, 10 May 2023 11:46:27 -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=@kernel.org header.s=k20201202 header.b=E6FdKMPC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236462AbjEJSTG (ORCPT + 99 others); Wed, 10 May 2023 14:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236159AbjEJSSV (ORCPT ); Wed, 10 May 2023 14:18:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85A528694; Wed, 10 May 2023 11:18:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA02063F96; Wed, 10 May 2023 18:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEE4BC433AF; Wed, 10 May 2023 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683742645; bh=5niEoOKO1ZkgLqnjpypuOkCum/ZBxI/z2WOC9+AEEJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E6FdKMPCzjlU2H9fbkTFQeqdk0HNDS1E6dlpIRaNOGqMSKBtqk5OEVR2vxdhPqcQq UmL7syR5Zydq67rTe89amu9DmA4kLQgd6fTWw8bdF9HSzXheGkJVj+83Bppuh8OqrV 8i8eX/Az14mdD/zd9P6cW47Rdw2zbrG41/siw7z82uINTpKp6TO56B7+59EhlyF6Jk xw6EEDZrM8IUBgtBgPlj1JZa/cakOVO2ZefOEY2pZ6sSy4zwo1jOnLWOwFjqyekILm n4ew9qJfLwqncnzQMbb+wxvxTr9RT5MWmPQlqU921KblIxe0gmwP/fxSFK6L6zZ/aE iwkUwlpWAPSdw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 0C48BCE21E1; Wed, 10 May 2023 11:17:19 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, "Paul E. McKenney" , Jonathan Corbet , Kees Cook , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland Subject: [PATCH locking/atomic 19/19] docs: Add atomic operations to the driver basic API documentation Date: Wed, 10 May 2023 11:17:17 -0700 Message-Id: <20230510181717.2200934-19-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765533955147283087?= X-GMAIL-MSGID: =?utf-8?q?1765533955147283087?= Add the include/linux/atomic/atomic-arch-fallback.h file to the driver-api/basics.rst in order to provide documentation for the Linux kernel's atomic operations. Signed-off-by: Paul E. McKenney Cc: Jonathan Corbet Cc: Kees Cook Cc: Akira Yokosawa Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Cc: Reviewed-by: Kees Cook --- Documentation/driver-api/basics.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/driver-api/basics.rst b/Documentation/driver-api/basics.rst index 4b4d8e28d3be..0ae07f0d8601 100644 --- a/Documentation/driver-api/basics.rst +++ b/Documentation/driver-api/basics.rst @@ -87,6 +87,9 @@ Atomics .. kernel-doc:: arch/x86/include/asm/atomic.h :internal: +.. kernel-doc:: include/linux/atomic/atomic-arch-fallback.h + :internal: + Kernel objects manipulation ---------------------------