Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2981858rdh; Mon, 27 Nov 2023 04:05:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFd0oUEO3HpanVWomUKteKNtpvI3LaMKe+ysiXblqihtraA4wyOmIQRTssW1AUrtJnE8vt X-Received: by 2002:a05:6808:bcb:b0:3ad:af40:2831 with SMTP id o11-20020a0568080bcb00b003adaf402831mr7628966oik.21.1701086737602; Mon, 27 Nov 2023 04:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701086737; cv=none; d=google.com; s=arc-20160816; b=V1b8KHzElO2eTZ11s09cwwx+/3Z3zJDF++vzLs8puCAa0I6LjNjgENw7FE+fkeqP3J NnwIG5FQs1oBZigSx/OMkeVxu0Ma/KcwPUiwg18i3+kstffCWrIN4SkEAyr+yy8TCXZ1 KiTIOnpxT9/c7MWzXsldGM1dQuIiXYZ/FsEp0fQRYrqu2YSH4/HlDup2kdZUw3VqZ+rm Gd93SywadIbi0jZvdmD5tRND9XBgR+T3zcscA38q81hxQMjyMnb5uorfV7lqqiiG3ZKI PAGFVI7lezB8AAbhdN2LBNCCjr9CcE9FyO8KxzRx59Z/JGToVdKzN/c6DyJrTl8VjVPg B0MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=kjDfbqtxJd4B7b6GnzfJoMeJiKNkrI+WFMXjJWpclGc=; fh=xPDonUoz+1hwmcIBxwbdbec6tr2n4MgidYYYN9qQl80=; b=fCT7USm7O5AQKUSr/lcmX84M5OEiJEP0QDS3O0xSyBITFLge/conNP789FAhMTb0IK ykGQr49pEWTSTZ2heHTAxidq4DtmmEWRDTCpDUS/qbLfysUrUgCeNOElCTll5RpecMji p4qaHHQMwel9K6s4AOvpRwxfNsJppbW06v6xJb3KNag3555kwgFXm8hB+M0PbGqPd42v BQp0prolOFU6i2xPJN6sHGLoL4cidJRAYj0Mx0YuKNL8S4q8WJ/8MSu2m0yCyyFENE2z pY3OMVpwXEYe6RjKBBn2D1bCMa4IUdUhEMhyXZGuyuwlTEBcjpkZ5vHEMb6Mef3AW2di TUZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=0D1wdA2Y; dkim=neutral (no key) header.i=@suse.de header.b=OJMQoSpI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bj9-20020a056808198900b003a35fb0440dsi3907466oib.251.2023.11.27.04.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:05:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=0D1wdA2Y; dkim=neutral (no key) header.i=@suse.de header.b=OJMQoSpI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1C8918088A5E; Mon, 27 Nov 2023 04:05:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233072AbjK0MFR (ORCPT + 99 others); Mon, 27 Nov 2023 07:05:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233052AbjK0MFP (ORCPT ); Mon, 27 Nov 2023 07:05:15 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76716E6 for ; Mon, 27 Nov 2023 04:05:22 -0800 (PST) Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 12C5021AB8; Mon, 27 Nov 2023 12:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701086721; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kjDfbqtxJd4B7b6GnzfJoMeJiKNkrI+WFMXjJWpclGc=; b=0D1wdA2Yhe8Y6Men9zk8WwEFEUPs9PHa6OJmUgl4g4HV5DcVj7/q0TbnmbP7MryCtROVnT hJYrgsVxAd2mXHRuQz3zr862AhCVv7aBLcqXlXG9o9FXiJcaCatC0w4lm4mkHqXzZJU5CE YHxkTWk4OZW4OP1C9WEGGy4f40J6VlU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701086721; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kjDfbqtxJd4B7b6GnzfJoMeJiKNkrI+WFMXjJWpclGc=; b=OJMQoSpIp/rvkObCjNgBSJE4U7dkGfmC8Ag+kjFUYlCvcnqDEchO1pdUc2fsGqJe8Us1/l CG3CKYRSxoaAHHAQ== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id F2BA313440; Mon, 27 Nov 2023 12:05:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 2kfPOQCGZGW5GQAAn2gu4w (envelope-from ); Mon, 27 Nov 2023 12:05:20 +0000 Date: Mon, 27 Nov 2023 13:07:32 +0100 From: Daniel Wagner To: Keith Busch Cc: 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: References: <20231127103208.25748-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: 3.36 X-Spamd-Result: default: False [3.36 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(2.96)[0.987]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[21.05%] X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 27 Nov 2023 04:05:35 -0800 (PST) On Mon, Nov 27, 2023 at 03:44:11AM -0700, Keith Busch wrote: > On Mon, Nov 27, 2023 at 11:32:08AM +0100, Daniel Wagner wrote: > > libnvme is using the sysfs for enumarating the nvme resources. Though > > there are few missing attritbutes in the sysfs. For these libnvme issues > > commands during discovering. > > > > As the kernel already knows all these attributes and we would like to > > avoid libnvme to issue commands all the time, expose these missing > > attributes. > > The id namespace 'nuse' field can be quite volatile: it can change on > any write or discard command, so caching it may quickly get out of sync > with the actual value. 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.