Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2073189imn; Mon, 1 Aug 2022 10:07:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tO/7qM7X8GIV1OQTSGWqO6aWdT8CttbCDuRk1m4m0zgdBVPpwnH4oA/igGnnfv/0Xu2oDD X-Received: by 2002:a05:6a00:14c4:b0:52a:c36c:1854 with SMTP id w4-20020a056a0014c400b0052ac36c1854mr16794868pfu.27.1659373641787; Mon, 01 Aug 2022 10:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659373641; cv=none; d=google.com; s=arc-20160816; b=WSnNn7GRkHgOLfq9cP5zcdmP1dNKM4uR++Y0Nucej5Z4h8htoSS0429RjPk4ANMIhk 1yWS2J7yadwROsK9lETE/1zjbRJ0w83cz54eWPMxnv3vNVE7Rz16rerMPdtZkQ8LC9eo 6CzdRFJDc8XnOVJWPi7XGd3xBxumwuZHE90iTrdwj79n62BruAA/D9xb8LHNWccG8INy EVBkrLLKVHaLfE0aYdCARiSPzAiw4qTpHuSXYAIlH15py9aXtf99ZhDRF5+Akx+9nUDc cevBAKEthLOcxBqVpanj8kju6ao+e6Z1gQWifGSZECdt3zVElZ2tkbjRUZUxiSUQdxKl TVhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YHhQfQ2y3pzCzClMp7IQZ6hqAFOjOcUPKho5tklltvM=; b=Ds0E71vzQqobCsd9V1LoeFnPDrfP1eqZrduYzIQMxjYxYww6jL3IFKbjgftdzuoo2J s/mUTQ2hb9LW8SslDrjvVHxjVE8gKvjIysTLsAQ8DEp6rKSJgv2qeTmrmUCqmcd9TKA6 SMPR3Fon8/as3QHfILxfKf9kJbWxEgbOxV976CVxU6Ds4vfXP+TkHY03u10nrPtYpyQO qg4sKI7GEUT7S/OJWhU1SDn6AgnXPpVeLv9D4nmACr631PBtUelpiCmp9lmNEaSvi5Lb DFGpfCqW9qBo59hrQKk7YDhK/5NskQ/9/9PwKvZ+2vKURBlVVvc4GUpJD7hvuzfDh1bz wxwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kVjDu68O; 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 j17-20020a170903029100b0016c8bc0b0b1si12860328plr.74.2022.08.01.10.07.06; Mon, 01 Aug 2022 10:07:21 -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=kVjDu68O; 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 S233658AbiHAQtz (ORCPT + 99 others); Mon, 1 Aug 2022 12:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbiHAQtx (ORCPT ); Mon, 1 Aug 2022 12:49:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE7C33FA00; Mon, 1 Aug 2022 09:49:52 -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 ams.source.kernel.org (Postfix) with ESMTPS id 67AABB815FB; Mon, 1 Aug 2022 16:49:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26D34C433C1; Mon, 1 Aug 2022 16:49:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659372590; bh=P883It5YVowJfcyCU/QWFfyJXtJA1AFMHQowLt1JIl4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kVjDu68O+0I2NQkzu+hMiZwq/Rq/roLiZBWQP+DrhuQCCVMZz7m295yrpmnCqPdDD HKoqoDHDi9icC1K2rM18BOMyyAOWRmKv0JEkvjWgn2nHmDuF/qJWW4dZYXjwGLoKvW KWi+/RQczHAxQ5qBVN5ZdP8s6bD9tuaigCtMkwn7U7zWayfG4NaeVilVtGgYWQ9FO9 gkuK8BFwWuusyMEhunjO6PuP5N+ymbUkqZXlNcysI1kecFT6UlVRjqA3fEkv02AEiX 54HGVIbGE1WEomtwn0UVaAGTAr6F6o4rwUejc97muQeBlYpXr+JnKw33tqze8UzmAY gbDhtr3Q4CLBg== Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-2ef5380669cso115110187b3.9; Mon, 01 Aug 2022 09:49:50 -0700 (PDT) X-Gm-Message-State: ACgBeo1YicYIGMh4KumL7jrENsf+k3Yp3ojSQsELPZj6WetDMbcK8Aa2 +n91R+Z/oNafjnFXRzFxWATvC+Es64KDJ638USE= X-Received: by 2002:a0d:d890:0:b0:31f:3957:2f49 with SMTP id a138-20020a0dd890000000b0031f39572f49mr14643173ywe.130.1659372589204; Mon, 01 Aug 2022 09:49:49 -0700 (PDT) MIME-Version: 1.0 References: <20220727210600.120221-1-logang@deltatee.com> <20220727210600.120221-2-logang@deltatee.com> <215E9FEF-69F9-44AB-A5B0-FD3C8335E985@deltatee.com> In-Reply-To: <215E9FEF-69F9-44AB-A5B0-FD3C8335E985@deltatee.com> From: Song Liu Date: Mon, 1 Aug 2022 09:49:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] md/raid5: Refactor raid5_get_active_stripe() To: Logan Gunthorpe Cc: Christoph Hellwig , open list , linux-raid , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 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 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 Mon, Aug 1, 2022 at 4:48 AM Logan Gunthorpe wrote: > > > > On July 29, 2022 7:48:48 PM ADT, Song Liu wrote: > >On Thu, Jul 28, 2022 at 7:13 AM Christoph Hellwig wrote: > >> > >> On Wed, Jul 27, 2022 at 03:05:56PM -0600, Logan Gunthorpe wrote: > >> > Refactor the raid5_get_active_stripe() to read more linearly in > >> > the order it's typically executed. > >> > > >> > The init_stripe() call is called if a free stripe is found and the > >> > function is exited early which removes a lot of if (sh) checks and > >> > unindents the following code. > >> > > >> > Remove the while loop in favour of the 'goto retry' pattern, which > >> > reduces indentation further. And use a 'goto wait_for_stripe' instead > >> > of an additional indent seeing it is the unusual path and this makes > >> > the code easier to read. > >> > > >> > No functional changes intended. Will make subsequent changes > >> > in patches easier to understand. > >> > >> I find the new loop even more confusing than the old one. I'd go > >> with something like the version below (on top of the whol md-next tree > >> that pulled this in way too fast..) > > > >This looks good to me. Christoph, would you mind send official patch > >for this? > > > >Thanks, > >Song > > I'm on vacation this week, but I'd be happy to send patches addressing Christoph's feedback when I'm back next week. We are in the merge window right now. So the timing is a little tricky. I will try to send pull requests with this set as-is. Then we can do follow-ups. Thanks, Song