[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <07ed50c1-75a9-494c-8a6a-5edcc2d6f932@linux.microsoft.com>
Date: Fri, 29 Mar 2024 12:46:30 -0700
From: Easwar Hariharan <eahariha@...ux.microsoft.com>
To: Dexuan Cui <decui@...rosoft.com>, hch@....de, m.szyprowski@...sung.com,
robin.murphy@....com, zhangpeng362@...wei.com, iommu@...ts.linux.dev,
mhklinux@...look.com
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] swiotlb: Do not set total_used to 0 in
swiotlb_create_debugfs_files()
On 3/29/2024 12:28 PM, Dexuan Cui wrote:
> Sometimes the readout of /sys/kernel/debug/swiotlb/io_tlb_used and
> io_tlb_used_hiwater can be a huge number (e.g. 18446744073709551615),
> which is actually a negative number if we use "%ld" to print the number.
>
> When swiotlb_create_default_debugfs() is running from late_initcall,
> mem->total_used may already be non-zero, because the storage driver
> may have already started to perform I/O operations: if the storage
> driver is built-in, its probe() callback is called before late_initcall.
>
> swiotlb_create_debugfs_files() should not blindly set mem->total_used
> and mem->used_hiwater to 0; actually it doesn't have to initialize the
> fields at all, because the fields, as part of the global struct
> io_tlb_default_mem, have been implicitly initialized to zero.
>
> Also don't explicitly set mem->transient_nslabs to 0.
>
> Fixes: 8b0977ecc8b3 ("swiotlb: track and report io_tlb_used high water marks in debugfs")
> Fixes: 02e765697038 ("swiotlb: add debugfs to track swiotlb transient pool usage")
> Cc: stable@...r.kernel.org
> Signed-off-by: Dexuan Cui <decui@...rosoft.com>
> ---
> kernel/dma/swiotlb.c | 4 ----
> 1 file changed, 4 deletions(-)
>
Sorry, I'm missing a why in this commit message. Can you say what happens if the
total_used and used_hiwater IS blindly set to 0? Is the only effect the change in
the readout of the swiotlb debugfs files?
Thanks,
Easwar
Powered by blists - more mailing lists