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 44FBCC04A68 for ; Thu, 28 Jul 2022 14:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230493AbiG1OOd (ORCPT ); Thu, 28 Jul 2022 10:14:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbiG1OOa (ORCPT ); Thu, 28 Jul 2022 10:14:30 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D5DB642F; Thu, 28 Jul 2022 07:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nXX/1YHq2TsMnhQqeM+NuFCn+OKgy8tv053unKPt3R0=; b=ta9JJEQZKGgBVxJI6tJt3dr2ds RUia5KN/UmAeshBO1MpbxTl2OlzB5QsePDR+VO08ajYNYaAqtXNSK9dtVNH/1u7FQnueNHt23qhyw fI51m09kIvOptLurZyTNCn+xlhD7PO6PyK3xMmjOo2zImS/UqF67N/3Sn8GZXsVZ9+MMVQ/IUwgl6 JGFwbxKmKSDyrba/Bo+babp+ZqrjusLR9FjyROTgl24Wl1LMcUVJVBigsLEw+BUyjmq6PNxQwr2t5 fwHvesz3WA+zCkZbbz5LUNZ4P7dmEl27V+52reX5HlbYlc3C5epK58ukerVUPYx+y9Zz8sAaviyXl 7IkzOtpg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oH4HU-00A2G2-Vs; Thu, 28 Jul 2022 14:14:28 +0000 Date: Thu, 28 Jul 2022 07:14:28 -0700 From: Christoph Hellwig To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu , Christoph Hellwig , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan Subject: Re: [PATCH 2/5] md/raid5: Make is_inactive_blocked() helper Message-ID: References: <20220727210600.120221-1-logang@deltatee.com> <20220727210600.120221-3-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220727210600.120221-3-logang@deltatee.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 27, 2022 at 03:05:57PM -0600, Logan Gunthorpe wrote: > + int active = atomic_read(&conf->active_stripes); > + > + if (list_empty(conf->inactive_list + hash)) > + return false; > + > + if (!test_bit(R5_INACTIVE_BLOCKED, &conf->cache_state)) > + return true; > + > + return active < (conf->max_nr_stripes * 3 / 4); Wy does this reed ->active_stripes without even knowing if that is needed? In fact I don't see the point of the local active variable at all.