From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8C23C433EF for ; Wed, 27 Apr 2022 23:27:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233996AbiD0XbC (ORCPT ); Wed, 27 Apr 2022 19:31:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbiD0XbB (ORCPT ); Wed, 27 Apr 2022 19:31:01 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB5331902; Wed, 27 Apr 2022 16:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=qYpF45g7IqwmF2QX2YAhs+Nml0O9Dsi63w2rdyKZioc=; b=aosjYX/2C0rIYc1fnJA+YIlFho EVLuyRTIeWj8NlZcff7jik81iFW0Nsf8bSd+oAtQbHMEFZ7s72OAuPjGJAv+51U3RYhHFFTLP1bJ/ U6XDDCKRhcXBpWqopPZx0njJ7vhXYTgBhem0yZRFus2U+Gu56mMZkcwJ5dChu/Vr+Thevmw6BO3mP bpw19zXhGQBBQqp0jhECaqejjcj5Hv55ZZd7e5/LUp3XH4HhfBsTRfyIGaYCv7P4dOsExAT4pwL/w JFlX36oGRTJyFw2RoyHjz+F80A7tTO3WIyVnVwcEtdtUhdAvVNa/M6YspiMeA/uiBum0dMlAjaM4s 1aw37QPw==; Received: from s0106ac1f6bb1ecac.cg.shawcable.net ([70.73.163.230] helo=[192.168.11.155]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1njr4T-000PMf-SE; Wed, 27 Apr 2022 17:27:46 -0600 Message-ID: <2dd3e7b3-ac85-6de2-3130-4fdd7b366739@deltatee.com> Date: Wed, 27 Apr 2022 17:27:43 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: Guoqing Jiang , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Stephen Bates , Martin Oliveira , David Sloan References: <20220420195425.34911-1-logang@deltatee.com> <20220420195425.34911-10-logang@deltatee.com> <56208e2a-5035-eb8e-c468-70b4dae66d5c@linux.dev> From: Logan Gunthorpe In-Reply-To: <56208e2a-5035-eb8e-c468-70b4dae66d5c@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.73.163.230 X-SA-Exim-Rcpt-To: guoqing.jiang@linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, hch@infradead.org, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH v2 09/12] md/raid5: Keep a reference to last stripe_head for batch X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org On 2022-04-26 19:36, Guoqing Jiang wrote: > On 4/21/22 3:54 AM, Logan Gunthorpe wrote: >>     /* we only do back search */ >> -static void stripe_add_to_batch_list(struct r5conf *conf, struct >> stripe_head *sh) >> +static void stripe_add_to_batch_list(struct r5conf *conf, >> +        struct stripe_head *sh, struct stripe_head *last_sh) > > Nit, from stripe_add_to_batch_list's view, I think "head_sh" makes more > sense than > "last_sh". That made sense to me, but upon a closer look while making the change, I think it's not a good idea: stripe_add_to_batch_list() already has a stripe_head variable called "head". If it now has an argument called "head_sh", it becomes very confusing. This statement wouldn't make any sense: +    if (last_sh && head_sector == last_sh->sector) { +        head = last_sh; +        atomic_inc(&head->count); +    } else { If it was changed to "head = head_sh" what would that even mean? >From stripe_add_to_batch_list's perspective, it is the "last" stripe head. And it then decides whether the it is the correct stripe to use as the head of the list to add to. So I decline to make this change. Thanks, Logan