Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10522023rwr; Fri, 12 May 2023 09:10:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zAFjI5TSa3g/lD4/9hf7z1rQ7w0jXeHSNrO555v+CH1V1gHp+xWwZPFCXo0f3BRfZmv0R X-Received: by 2002:a05:6a20:394c:b0:ff:b564:c532 with SMTP id r12-20020a056a20394c00b000ffb564c532mr27063537pzg.43.1683907809366; Fri, 12 May 2023 09:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683907809; cv=none; d=google.com; s=arc-20160816; b=aP8FbtJjbOF346FH9Ksb01hWXxi28vxU8h8eZ5N40zBatxDkzOWw8YiztCXcf08C9T Bipfz86ndsKjxKN9NlU/LOLKbl5POizQgkC2RSPEPT8WYzjhJwKQfPoDfqDJBdkIMrAK pW+XVCLdhRTT3BMlb/L5ZGyXgFpsFWOqPK68zw92oGlm2lE171mgPcu9AxX+obf2zFFe LgkqtGfkKGFLwiSwgfFGkDLTqYqgV3+cy6vl5B7B3KTCYGuQ3hUh4TdTtpHpJ0PN7rZ0 zCgPi6c2gvbrZtBhhpstbVHQVJIpkGpIdZfcWezGB49FkkC17aBvEMqz5xMN/Q3LqREj 6T3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6JFm1ItNiiZG+PIPJxo0m6W5trui6OQwV95XIxl6kvU=; b=Y3bwzR3RP75MGq8sTNaYZqdIEAL4hFbVYLH1UI8cN3xrjKk50n2c+ghlE/4DRKCDnI mqNBrugh/K6N38tj2YAkNayJsvMiQUgVYio2tiZTYv+MCwRiZSUlvRKoD44ZBR/u1W8I AinToFRGTzeqp1bwbZDqABm8Bo9gh6fhrgM2ndSFuNxDCLYNNKPusSf5w8Yz1IV/s6P2 MC35ppCD0SEBqoWdqlkRKHthmQi+/PenNqOk7Wz/vS54Y4MAZ1ztB+bySA9Yn8YWsx+w z73uqTXzbMiKPkfdLfeXmm8JRRSiocfpmhVOOAIBv1hfQsoBUrQWm6y9pDtN++F1HxjR PA1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wy1zbOpw; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 204-20020a6301d5000000b005181ce2302csi9429133pgb.749.2023.05.12.09.09.54; Fri, 12 May 2023 09:10:09 -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=Wy1zbOpw; 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 S241877AbjELQBa (ORCPT + 99 others); Fri, 12 May 2023 12:01:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241611AbjELQB3 (ORCPT ); Fri, 12 May 2023 12:01:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3491FCE; Fri, 12 May 2023 09:01:28 -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 4645960B0D; Fri, 12 May 2023 16:01:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D5C5C433EF; Fri, 12 May 2023 16:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683907287; bh=02EyhP5Y+6dTroXKtUW0MdsW8YYXdZlYTb86lb8b01k=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Wy1zbOpwBZchuVap8RH9iPG2yBfSfoCT4UPMGDwqovuE2jWnVfy4OXu2zjsvtM63R TVRBjH+FgggCzvF0HQHrxKt9OK5j7+RaXHe9IdS3gCwIVXZTwLw7Yp9e9h6lhHLmay rwotBGpW1JKnQ2BtNbFZ/wSvVrRg+39LtSRFn3+he8Ljy5LaSfPyylBrjJX4xEIaIj 2SaKhMXdL9zl3XK+STAc3zKih+clXr27LJOi41PZ8tairUPGs6/z+956sdmkYFUaZq mEnsMsGktXZw5Xi5s3g2EP6CdYRQ3ZzqtJe9gcYUHGzFH85J3QW4tjul4Yc8IlqL5o g56TqtduUXV1A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 30423CE0CCF; Fri, 12 May 2023 09:01:27 -0700 (PDT) Date: Fri, 12 May 2023 09:01:27 -0700 From: "Paul E. McKenney" To: Mark Rutland Cc: linux-kernel@vger.kernel.org, x86@kernel.org, akiyks@gmail.com, linux-doc@vger.kernel.org, kernel-team@meta.com, Will Deacon , Peter Zijlstra , Boqun Feng Subject: Re: [PATCH locking/atomic 18/19] locking/atomic: Refrain from generating duplicate fallback kernel-doc Message-ID: Reply-To: paulmck@kernel.org References: <19135936-06d7-4705-8bc8-bb31c2a478ca@paulmck-laptop> <20230510181717.2200934-18-paulmck@kernel.org> <2a8b310c-3145-462b-a4c4-a130939da862@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Fri, May 12, 2023 at 02:18:48PM +0100, Mark Rutland wrote: > On Thu, May 11, 2023 at 12:12:16PM -0700, Paul E. McKenney wrote: > > On Thu, May 11, 2023 at 06:10:00PM +0100, Mark Rutland wrote: > > > I think that we can restructure the ifdeffery so that each ordering variant > > > gets its own ifdeffery, and then we could place the kerneldoc immediately above > > > that, e.g. > > > > > > /** > > > * arch_atomic_inc_return_release() > > > * > > > * [ full kerneldoc block here ] > > > */ > > > #if defined(arch_atomic_inc_return_release) > > > /* defined in arch code */ > > > #elif defined(arch_atomic_inc_return_relaxed) > > > [ define in terms of arch_atomic_inc_return_relaxed ] > > > #elif defined(arch_atomic_inc_return) > > > [ define in terms of arch_atomic_inc_return ] > > > #else > > > [ define in terms of arch_atomic_fetch_inc_release ] > > > #endif > > > > > > ... with similar for the mandatory ops that each arch must provide, e.g. > > > > > > /** > > > * arch_atomic_or() > > > * > > > * [ full kerneldoc block here ] > > > */ > > > /* arch_atomic_or() is mandatory -- architectures must define it! */ > > > > > > I had a go at that restructuring today, and while local build testing indicates > > > I haven't got it quite right, I think it's possible: > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=atomics/fallback-rework > > > > > > Does that sound ok to you? > > > > At first glance, it appears that your "TODO" locations have the same > > information that I was using, so it should not be hard for me to adapt the > > current kernel-doc generation to your new scheme. (Famous last words!) > > Great! > > > Plus having the kernel-doc generation all in one place does have some > > serious attractions. > > :) > > > I will continue maintaining my current stack, but would of course be > > happy to port it on top of your refactoring. If it turns out that > > the refactoring will take a long time, we can discuss what to do in > > the meantime. But here is hoping that the refactoring goes smoothly! > > That would be easier all around. ;-) > > FWIW, I think that's working now; every cross-build I've tried works. > > I've updated the branch at: > > https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=atomics/fallback-rework > > Tagged as: > > atomics-fallback-rework-20230512 Thank you very much! I expect to send v2 of my original late today on the perhaps unlikely off-chance that someone might be interested in reviewing the verbiage. More to the point, I have started porting my changes on top of your stack. My thought is to have a separate "."-included script that does the kernel-doc work. I am also thinking in terms of putting the kernel-doc generation into an "else" clause to the "is mandatory" check, and leaving the kernel-doc for the mandatory functions in arch/x86/include/asm/atomic.h. But in both cases, please let me know if something else would work better. Thanx, Paul