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 35872C4167B for ; Mon, 27 Nov 2023 14:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233704AbjK0OD0 (ORCPT ); Mon, 27 Nov 2023 09:03:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233564AbjK0OBV (ORCPT ); Mon, 27 Nov 2023 09:01:21 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE5F92D4E for ; Mon, 27 Nov 2023 05:57:58 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 647A567373; Mon, 27 Nov 2023 14:57:55 +0100 (CET) Date: Mon, 27 Nov 2023 14:57:55 +0100 From: Christoph Hellwig To: Daniel Wagner Cc: Keith Busch , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Hannes Reinecke Subject: Re: [RFC v1] nvme: add cse, ds, ms, nsze and nuse to sysfs Message-ID: <20231127135755.GB23928@lst.de> References: <20231127103208.25748-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 27, 2023 at 01:07:32PM +0100, Daniel Wagner wrote: > libnvme itself is also cashing this value and exposes it via the > nvme_ns_get_lba_util() getter. I'd say libnvme shouldn't cache it > either. Instead the function should just issue the ns command to report > the current nuse value. > > I'll drop the nuse sysfs entry. > > Unfortunately, 'nvme list' is using the 'nuse' field for showing the > currently used space. I was hoping to get 'nvme list' working without > issuing any commands. I'd be ok with implementing nuse in a way where we issue an identify command to read it, but rate limit the calls to something reasonable. I think the kernel can do that much better than userspace because it can keep that state a lot better.