Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4947302rwl; Mon, 10 Apr 2023 20:45:03 -0700 (PDT) X-Google-Smtp-Source: AKy350YAEIRNKb0roUMIFzSwWZPpZMv5ZUUrexWONHyIKK68v3YEipJZeJ9SX/3obQdUgFxJpnnO X-Received: by 2002:a17:907:701:b0:94a:44ef:853d with SMTP id xb1-20020a170907070100b0094a44ef853dmr8252594ejb.68.1681184703189; Mon, 10 Apr 2023 20:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681184703; cv=none; d=google.com; s=arc-20160816; b=pzm1sC2KkfaqNC9Ef4A3U85QaQgc2wN9V3vIkTZPwxrY+xdISocwJGYGNC+mlyxgj9 RZLPVQbsXuGQA+sOOR5MbnZQkPbKmRix0g9mmfZYde0Oh5u99Rr4l0o1bafs/e6ahh/t ERfV07Kk/YcSr7BSTR0XGAP4gSjLeeEK0zDoyYjKeqIEw+msAci2VCU7sBDQjy5wpn5d etOJF1/deowyukHUjHxg1nJUYLZ/egC7068f3Pqu/2BrFHyHZbgojlXApS761nolN2yq gJfZDzr4DXZGhQoORzty62LauaWfGLOUGohxbFgrlTpPfal3AhQX4vv1fz1iHc1+jvWg KG5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fxQqwXn6Itm6suUCIlEezKZggDYK5PoGtXrFgDYE/GM=; b=nAi8C0cGJn4bA0eJwkGwsWQlC87ZSA8lILfCT6C1aD40/kXBxaeJdZx8i1FjikGrp1 9wRrXaUBINftb2H2YsxHw5948rILSaBm9BI3kM/xWcGCcmNtgknyWJOPy0BJ1YqZiX19 7QFhFCeS07yzbPssXKSslk/yY5bnlkS3RdSrA8fNNDU4HIDvD9pLWf1xXUfN65F1Vc4l zCQj/lTEoyqD4KsZGroo+G6qrfOc2NKqeJjf9j5RZawyijiEkmlgEVmFzXtrEvMSrz3H kaDQQo4JpgKPAsPlmer4V+gu6a7HKOrpT3YdgG4MMbfkIm1d2jyBzlUo6hh1Uqb11vwL IvkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rg6-20020a1709076b8600b0094a38996a61si6436861ejc.4.2023.04.10.20.44.37; Mon, 10 Apr 2023 20:45:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbjDKDoH (ORCPT + 99 others); Mon, 10 Apr 2023 23:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbjDKDnj (ORCPT ); Mon, 10 Apr 2023 23:43:39 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CADB213D for ; Mon, 10 Apr 2023 20:42:11 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 47E8868BEB; Tue, 11 Apr 2023 05:41:37 +0200 (CEST) Date: Tue, 11 Apr 2023 05:41:37 +0200 From: "hch@lst.de" To: "Michael Kelley (LINUX)" Cc: Petr =?utf-8?B?VGVzYcWZw61r?= , "hch@lst.de" , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , Dexuan Cui , Tianyu Lan , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/1] swiotlb: Track and report io_tlb_used high water mark in debugfs Message-ID: <20230411034137.GB15679@lst.de> References: <1680324300-124563-1-git-send-email-mikelley@microsoft.com> <20230407125535.476350d4@meshulam.tesarici.cz> 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) X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 07, 2023 at 10:05:26PM +0000, Michael Kelley (LINUX) wrote: > > Yes, this works fine now, but why are total_used and used_hiwater > > global variables? If you make them fields in struct io_tlb_mem > > (possibly guarded with #ifdef CONFIG_DEBUG_FS), you can get rid of the > > check. Of course, in instances other than io_tlb_default_mem these > > fields would not be exported to userspace through debugfs, but if really > > needed, I can at least find them in a crash dump (or read them through > > /proc/kcore). > > > > Got it. > > Your previously comments mentioned making them fields in struct io_tlb_mem, > and I missed your point. :-( I got focused on fixing the accounting for > DEBUG_FS so it didn't include the non-default pools, and didn't pick up on the > idea of doing the accounting for the non-default pools even though the values > aren't exposed in /sys. I'll fix this in the next version. FYI, I agree that per-instance accounting is probably the better way, too.