Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5A1657470 for ; Wed, 5 Apr 2023 16:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description; bh=ibm+nWW7IW9tcDE0xVaQziVWYwGIW9klab1GLTkBWA8=; b=Vszq9Sjag0KovbFyUMSIcdP524 sx4GTfSXPdQPMNeFs+3wFwwWnKOBYkz+C33wureTGP8x88exBW5FHohne8bJGpScLFtLp+RPI5CaN Kut8dzMCf0y59hZNjJCXQcOfUrizMO5bph1jpdXdhCsYgNeG7L0oozB3WVaomOOpdtose9ebh6BBV fOQmoxAnQliQsozhiVBeZzU6VmXbABZUOT9nbGZ08aCmcCEOJpsAvzfRbwfnnJiQ1ly6XCTacLdSn OWB3x2K7tk6m8/9LJIfUd/ucqlolkGqzUHepQBIe9h5b0nfy3tUUQ6cGA/xrcngBZohsJkwiuFqVa Pg1Ne22w==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pk6Na-005BOz-1J; Wed, 05 Apr 2023 16:53:02 +0000 Date: Wed, 5 Apr 2023 09:53:02 -0700 From: Luis Chamberlain To: Linus Torvalds Cc: david@redhat.com, patches@lists.linux.dev, linux-modules@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pmladek@suse.com, petr.pavlu@suse.com, prarit@redhat.com, gregkh@linuxfoundation.org, rafael@kernel.org, christophe.leroy@csgroup.eu, tglx@linutronix.de, peterz@infradead.org, song@kernel.org, rppt@kernel.org, dave@stgolabs.net, willy@infradead.org, vbabka@suse.cz, mhocko@suse.com, dave.hansen@linux.intel.com, colin.i.king@gmail.com, jim.cromie@gmail.com, catalin.marinas@arm.com, jbaron@akamai.com, rick.p.edgecombe@intel.com Subject: Re: [PATCH v2 5/6] debugfs: add debugfs_create_atomic64_t for atomic64_t Message-ID: References: <20230405022702.753323-1-mcgrof@kernel.org> <20230405022702.753323-6-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Luis Chamberlain On Wed, Apr 05, 2023 at 09:23:09AM -0700, Linus Torvalds wrote: > On Wed, Apr 5, 2023 at 9:11 AM Luis Chamberlain wrote: > > > > Oh but I don't get the atomic incs, so we'd need debugfs_create_atomic_long_t(). > > debugfs_create_ulong("total_mod_size", > 0400, mod_debugfs_root, > &total_mod_size.counter); > > but I didn't actually try to compile that kind of version. > > (I think "counter" is actually a _signed_ long, so maybe the types don't match). I see yes, sadly we'd have to cast to (unsigned long *) to make that work as atomic_long counters are long long int: debugfs_create_ulong("total_mod_size", 0400, mod_debugfs_root, - &total_mod_size.counter); + (unsigned long *)&total_mod_size.counter); That's: unsigned long min bits 32 long long min bits 64 But since we'd be doing our accounting in atomic_long and just use debugfs for prints I think that's fine. Just a bit ugly. Luis