All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: android: ashmem: add size field in procfs fdinfo
@ 2021-06-18  9:50 liuhailong
  2021-06-18 10:23 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: liuhailong @ 2021-06-18  9:50 UTC (permalink / raw)
  To: gregkh, arve, tkjos, maco, joel, christian, hridya, surenb
  Cc: linux-kernel, linux-staging, 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 leak

Signed-off-by: liuhailong <liuhailong@oppo.com>
---
 drivers/staging/android/ashmem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index d66a64e42273..ee2fd75111d8 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -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
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: android: ashmem: add size field in procfs fdinfo
  2021-06-18  9:50 [PATCH] staging: android: ashmem: add size field in procfs fdinfo liuhailong
@ 2021-06-18 10:23 ` Greg KH
  2021-06-18 10:40   ` 回复: " 刘海龙(DuckBuBee)
  2021-06-18 11:04   ` 刘海龙(DuckBuBee)
  0 siblings, 2 replies; 5+ messages in thread
From: Greg KH @ 2021-06-18 10:23 UTC (permalink / raw)
  To: liuhailong
  Cc: arve, tkjos, maco, joel, christian, hridya, surenb, linux-kernel,
	linux-staging

On Fri, Jun 18, 2021 at 05:50:35PM +0800, liuhailong wrote:
> 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
> 
> Signed-off-by: liuhailong <liuhailong@oppo.com>
> ---
>  drivers/staging/android/ashmem.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
> index d66a64e42273..ee2fd75111d8 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -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
> -- 
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* 回复: [PATCH] staging: android: ashmem: add size field in procfs fdinfo
  2021-06-18 10:23 ` Greg KH
@ 2021-06-18 10:40   ` 刘海龙(DuckBuBee)
  2021-06-18 11:04     ` Greg KH
  2021-06-18 11:04   ` 刘海龙(DuckBuBee)
  1 sibling, 1 reply; 5+ messages in thread
From: 刘海龙(DuckBuBee) @ 2021-06-18 10:40 UTC (permalink / raw)
  To: Greg KH
  Cc: arve@android.com, tkjos@android.com, maco@android.com,
	joel@joelfernandes.org, christian@brauner.io, hridya@google.com,
	surenb@google.com, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev

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 <gregkh@linuxfoundation.org> 
发送时间: 2021年6月18日 18:23
收件人: 刘海龙(DuckBuBee) <liuhailong@oppo.com>
抄送: arve@android.com; tkjos@android.com; maco@android.com; joel@joelfernandes.org; christian@brauner.io; hridya@google.com; surenb@google.com; linux-kernel@vger.kernel.org; linux-staging@lists.linux.dev
主题: Re: [PATCH] staging: android: ashmem: add size field in procfs fdinfo

On Fri, Jun 18, 2021 at 05:50:35PM +0800, liuhailong wrote:
> 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
> 
> Signed-off-by: liuhailong <liuhailong@oppo.com>
> ---
>  drivers/staging/android/ashmem.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/android/ashmem.c 
> b/drivers/staging/android/ashmem.c
> index d66a64e42273..ee2fd75111d8 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -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
> --
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* 回复: [PATCH] staging: android: ashmem: add size field in procfs fdinfo
  2021-06-18 10:23 ` Greg KH
  2021-06-18 10:40   ` 回复: " 刘海龙(DuckBuBee)
@ 2021-06-18 11:04   ` 刘海龙(DuckBuBee)
  1 sibling, 0 replies; 5+ messages in thread
From: 刘海龙(DuckBuBee) @ 2021-06-18 11:04 UTC (permalink / raw)
  To: Greg KH
  Cc: arve@android.com, tkjos@android.com, maco@android.com,
	joel@joelfernandes.org, christian@brauner.io, hridya@google.com,
	surenb@google.com, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev

I think this line also break other tool, because dma-buf fdinfo also add size field in procfs fdinfo.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 回复: [PATCH] staging: android: ashmem: add size field in procfs fdinfo
  2021-06-18 10:40   ` 回复: " 刘海龙(DuckBuBee)
@ 2021-06-18 11:04     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-06-18 11:04 UTC (permalink / raw)
  To: 刘海龙(DuckBuBee)
  Cc: arve@android.com, tkjos@android.com, maco@android.com,
	joel@joelfernandes.org, christian@brauner.io, hridya@google.com,
	surenb@google.com, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev

On Fri, Jun 18, 2021 at 10:40:28AM +0000, 刘海龙(DuckBuBee) wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-18 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  9:50 [PATCH] staging: android: ashmem: add size field in procfs fdinfo liuhailong
2021-06-18 10:23 ` Greg KH
2021-06-18 10:40   ` 回复: " 刘海龙(DuckBuBee)
2021-06-18 11:04     ` Greg KH
2021-06-18 11:04   ` 刘海龙(DuckBuBee)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.