From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5764422AE75 for ; Thu, 29 May 2025 14:31:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748529073; cv=none; b=rsFPNfDsrzV27CtpDg8zMa8VhuqEdf7Ab8z3An+gjMEbY1tXgPsI1qF0MHTsQREMfEW18Biol4cW8DmfCSx7vgROW9n8U8ufQPasjJTKTeqVb3bQPC7heqMceh4C4IWIMvJJTmtZOv7q9p+fwKF5P9xQC8FaK+UGEPhzTUGzGl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748529073; c=relaxed/simple; bh=eMFxBMfyFOxV3BeIGTcDx5sFm09M8My+rTkQmtIPqAk=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZbxjLXeYWs89ZdMtzu1s9UTM2Wi1epc0nFTLuQUQqOv5ASGw10m5Zwxg8HruzGA1nsw79g6ZlkSWrv6ex/8gM9k37DObtJ9w4Exzxc0VnhdNWJTdC0q0Ddp9ru48cEGwg9JMCfk2oYiENKDjMls/Q9EiuqB+11GqC+EjhN+XqW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4b7TKX117hz6K5lR; Thu, 29 May 2025 22:29:52 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id CB1131400CA; Thu, 29 May 2025 22:31:07 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 29 May 2025 16:31:07 +0200 Date: Thu, 29 May 2025 15:31:05 +0100 From: Jonathan Cameron To: CC: , , , , , , , Fan Ni Subject: Re: [PATCH] hw/cxl: fix DC extent capacity tracking Message-ID: <20250529153105.00000bd0@huawei.com> In-Reply-To: <20250520195741.789841-1-nifan.cxl@gmail.com> References: <20250520195741.789841-1-nifan.cxl@gmail.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) To frapeml500008.china.huawei.com (7.182.85.71) On Tue, 20 May 2025 12:56:43 -0700 nifan.cxl@gmail.com wrote: > From: Fan Ni > > Per cxl r3.2 Section 9.13.3.3, extent capacity tracking should include > extents in different states including added, pending, etc. > > Before the change, for the in-device extent number tracking purpose, we only > have "total_extent_count" defined, which only tracks the number of > extents accepted. However, we need to track number of extents in other > states also, for now it is extents pending-to-add. > > To fix that, we introduce a new counter for dynamic capacity > "nr_extents_accepted" which explicitly tracks number of the extents > accepted by the hosts, and fix "total_extent_count" to include > both accepted and pending extents counting. Hi Fan, This is complex code but looks correct to me - I'd managed to forget all the weird ways the extent counts can go up and down - most of which Linux doesn't actually hit. For fixes like this can save a bit of time by +CC mst@redhat.com then it just needs a review tag from me (or you if it is me sending). I only have that other regloc fix and just sent that out for review with mst +CC so maybe just send a v2 of this (rebased on upstream) and add Reviewed-by: Jonathan Cameron 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C12F7C54FB3 for ; Thu, 29 May 2025 14:31:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uKeI1-0001Sm-U5; Thu, 29 May 2025 10:31:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uKeHv-0001Rz-2g for qemu-devel@nongnu.org; Thu, 29 May 2025 10:31:19 -0400 Received: from [185.176.79.56] (helo=frasgout.his.huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uKeHr-0005Xt-Sg for qemu-devel@nongnu.org; Thu, 29 May 2025 10:31:18 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4b7TKX117hz6K5lR; Thu, 29 May 2025 22:29:52 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id CB1131400CA; Thu, 29 May 2025 22:31:07 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 29 May 2025 16:31:07 +0200 Date: Thu, 29 May 2025 15:31:05 +0100 To: CC: , , , , , , , Fan Ni Subject: Re: [PATCH] hw/cxl: fix DC extent capacity tracking Message-ID: <20250529153105.00000bd0@huawei.com> In-Reply-To: <20250520195741.789841-1-nifan.cxl@gmail.com> References: <20250520195741.789841-1-nifan.cxl@gmail.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.177.66] X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) To frapeml500008.china.huawei.com (7.182.85.71) X-Host-Lookup-Failed: Reverse DNS lookup failed for 185.176.79.56 (deferred) Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jonathan Cameron From: Jonathan Cameron via Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Tue, 20 May 2025 12:56:43 -0700 nifan.cxl@gmail.com wrote: > From: Fan Ni > > Per cxl r3.2 Section 9.13.3.3, extent capacity tracking should include > extents in different states including added, pending, etc. > > Before the change, for the in-device extent number tracking purpose, we only > have "total_extent_count" defined, which only tracks the number of > extents accepted. However, we need to track number of extents in other > states also, for now it is extents pending-to-add. > > To fix that, we introduce a new counter for dynamic capacity > "nr_extents_accepted" which explicitly tracks number of the extents > accepted by the hosts, and fix "total_extent_count" to include > both accepted and pending extents counting. Hi Fan, This is complex code but looks correct to me - I'd managed to forget all the weird ways the extent counts can go up and down - most of which Linux doesn't actually hit. For fixes like this can save a bit of time by +CC mst@redhat.com then it just needs a review tag from me (or you if it is me sending). I only have that other regloc fix and just sent that out for review with mst +CC so maybe just send a v2 of this (rebased on upstream) and add Reviewed-by: Jonathan Cameron