Re: [PATCH RFC 1/1] swiotlb: add debugfs to track swiotlb buffer usage

2018-12-08 Thread Dongli Zhang
Hi Robin, On 12/07/2018 09:17 PM, Robin Murphy wrote: > On 07/12/2018 05:49, Dongli Zhang wrote: >> >> >> On 12/07/2018 12:12 AM, Joe Jin wrote: >>> Hi Dongli, >>> >>> Maybe move d_swiotlb_usage declare into swiotlb_create_debugfs(): >> >> I assume the call of swiotlb_tbl_map_single() might be fre

Re: [PATCH RFC 1/1] swiotlb: add debugfs to track swiotlb buffer usage

2018-12-07 Thread Robin Murphy
On 07/12/2018 05:49, Dongli Zhang wrote: On 12/07/2018 12:12 AM, Joe Jin wrote: Hi Dongli, Maybe move d_swiotlb_usage declare into swiotlb_create_debugfs(): I assume the call of swiotlb_tbl_map_single() might be frequent in some situations, e.g., when 'swiotlb=force'. That's why I declare

Re: [PATCH RFC 1/1] swiotlb: add debugfs to track swiotlb buffer usage

2018-12-06 Thread Joe Jin
On 12/6/18 9:49 PM, Dongli Zhang wrote: > > > On 12/07/2018 12:12 AM, Joe Jin wrote: >> Hi Dongli, >> >> Maybe move d_swiotlb_usage declare into swiotlb_create_debugfs(): > > I assume the call of swiotlb_tbl_map_single() might be frequent in some > situations, e.g., when 'swiotlb=force'. > > Th

Re: [PATCH RFC 1/1] swiotlb: add debugfs to track swiotlb buffer usage

2018-12-06 Thread Dongli Zhang
On 12/07/2018 12:12 AM, Joe Jin wrote: > Hi Dongli, > > Maybe move d_swiotlb_usage declare into swiotlb_create_debugfs(): I assume the call of swiotlb_tbl_map_single() might be frequent in some situations, e.g., when 'swiotlb=force'. That's why I declare the d_swiotlb_usage out of any functio

Re: [PATCH RFC 1/1] swiotlb: add debugfs to track swiotlb buffer usage

2018-12-06 Thread Joe Jin
Hi Dongli, Maybe move d_swiotlb_usage declare into swiotlb_create_debugfs(): void swiotlb_create_debugfs(void) { #ifdef CONFIG_DEBUG_FS static struct dentry *d_swiotlb_usage = NULL; if (d_swiotlb_usage) return; d_swiotlb_usage = debugfs_create_dir("swiotl

[PATCH RFC 1/1] swiotlb: add debugfs to track swiotlb buffer usage

2018-12-05 Thread Dongli Zhang
The device driver will not be able to do dma operations once swiotlb buffer is full, either because the driver is using so many IO TLB blocks inflight, or because there is memory leak issue in device driver. To export the swiotlb buffer usage via debugfs would help the user estimate the size of swi