staging: android: ashmem: add size field in procfs fdinfo
PATCH 1/1 staging: android: ashmem: add size field in procfs fdinfo
add this information to help user to find ashmem problem.
ashmem leak scenario:
-000|fd = ashmem_create_region -001|mmap and pagefault -002|munmap -003|forget close(fd) <---- which lead to ashmem leak
--- drivers/staging/android/ashmem.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/android/ashmem.c +2 -0
@@ -894,6 +894,8 @@ static void ashmem_show_fdinfo(struct seq_file *m, struct file *file)seq_printf (m,"name:\t%s\n" , asma->name +ASHMEM_NAME_PREFIX_LEN ); +seq_printf (m,"size:\t%zu\n" , asma->size); + mutex_unlock(&ashmem_mutex); }#endif
Signature · 1 line
2.30.2
Greg KH
maintainerQuoted 30 lines · liuhailong
add this information to help user to find ashmem problem.
ashmem leak scenario:
-000|fd = ashmem_create_region -001|mmap and pagefault -002|munmap -003|forget close(fd) <---- which lead to ashmem leakSigned-off-by liuhailong <[email protected]>--- drivers/staging/android/ashmem.c | 2 ++ 1 file changed, 2 insertions(+)drivers/staging/android/ashmem.c +2
-0@@ -894,6 +894,8 @@ static void ashmem_show_fdinfo(struct seq_file *m, struct file *file)seq_printf (m,"name:\t%s\n" , asma->name +ASHMEM_NAME_PREFIX_LEN ); +seq_printf (m,"size:\t%zu\n" , asma->size); + mutex_unlock(&ashmem_mutex); }#endif Signature · 1 line
2.30.2
As you are changing a user-facing proc file, what tools will break now that you have added a new line?
What tools do you use to look at this file and what has been modified to handle the change?
thanks,
greg k-h
Hi
No user tools use this proc file as I know, I added this line can help user locate shmem leak issue.
tks
-----邮件原件-----
发件人: Greg KH <[email protected]>
发送时间: 2021年6月18日 18:23
收件人: 刘海龙(DuckBuBee) <[email protected]>
抄送: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected] 主题: Re: [PATCH] staging: android: ashmem: add size field in procfs fdinfo
Quoted 28 lines · liuhailong
add this information to help user to find ashmem problem.
ashmem leak scenario:
-000|fd = ashmem_create_region -001|mmap and pagefault -002|munmap -003|forget close(fd) <---- which lead to ashmem leakSigned-off-by liuhailong <[email protected]>--- drivers/staging/android/ashmem.c | 2 ++ 1 file changed, 2 insertions(+)drivers/staging/android/ashmem.c +2
-1@@ -894,6 +894,8 @@ static void ashmem_show_fdinfo(struct seq_file *m, struct file *file)seq_printf (m,"name:\t%s\n" , asma->name +ASHMEM_NAME_PREFIX_LEN ); +seq_printf (m,"size:\t%zu\n" , asma->size); + mutex_unlock(&ashmem_mutex); }#endif --
Quoted 3 lines
2.30.2
As you are changing a user-facing proc file, what tools will break now that you have added a new line?
What tools do you use to look at this file and what has been modified to handle the change?
thanks,
greg k-h
Greg KH
maintainerQuoted 2 lines · 刘海龙(DuckBuBee)
Hi
No user tools use this proc file as I know, I added this line can help user locate shmem leak issue.
Ok, thanks, I'll go queue it up.
greg k-h
I think this line also break other tool, because dma-buf fdinfo also add size field in procfs fdinfo.