Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-04 Thread Kalesh Singh
On Tue, Aug 04, 2020 at 07:27:24PM +0100, Al Viro wrote: > On Tue, Aug 04, 2020 at 03:44:51PM +, Kalesh Singh wrote: > > > Hi Al. Thank you for the comments. Ultimately what we need is to identify > > processes > > that hold a file reference to the dma-buf. Unfortunately we can't use only >

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-04 Thread Daniel Vetter
On Tue, Aug 4, 2020 at 12:28 AM Al Viro wrote: > > On Mon, Aug 03, 2020 at 09:22:53AM -0700, Suren Baghdasaryan wrote: > > On Mon, Aug 3, 2020 at 9:12 AM Matthew Wilcox wrote: > > > > > > On Mon, Aug 03, 2020 at 09:00:00AM -0700, Suren Baghdasaryan wrote: > > > > On Mon, Aug 3, 2020 at 8:41 AM

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-04 Thread Al Viro
On Tue, Aug 04, 2020 at 03:44:51PM +, Kalesh Singh wrote: > Hi Al. Thank you for the comments. Ultimately what we need is to identify > processes > that hold a file reference to the dma-buf. Unfortunately we can't use only > explicit dma_buf_get/dma_buf_put to track them because when an FD

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-04 Thread Kalesh Singh
On Tue, Aug 04, 2020 at 02:09:13AM +0100, Al Viro wrote: > On Mon, Aug 03, 2020 at 11:28:31PM +0100, Al Viro wrote: > > > IOW, what the hell is that horror for? You do realize, for example, that > > there's > > such thing as dup(), right? And dup2() as well. And while we are at it, > > how >

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Suren Baghdasaryan
On Mon, Aug 3, 2020 at 6:09 PM Al Viro wrote: > > On Mon, Aug 03, 2020 at 11:28:31PM +0100, Al Viro wrote: > > > IOW, what the hell is that horror for? You do realize, for example, that > > there's > > such thing as dup(), right? And dup2() as well. And while we are at it, > > how > > do you

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Al Viro
On Mon, Aug 03, 2020 at 11:28:31PM +0100, Al Viro wrote: > IOW, what the hell is that horror for? You do realize, for example, that > there's > such thing as dup(), right? And dup2() as well. And while we are at it, how > do you keep track of removals, considering the fact that you can stick

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Al Viro
On Mon, Aug 03, 2020 at 09:22:53AM -0700, Suren Baghdasaryan wrote: > On Mon, Aug 3, 2020 at 9:12 AM Matthew Wilcox wrote: > > > > On Mon, Aug 03, 2020 at 09:00:00AM -0700, Suren Baghdasaryan wrote: > > > On Mon, Aug 3, 2020 at 8:41 AM Matthew Wilcox wrote: > > > > > > > > On Mon, Aug 03, 2020

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Kalesh Singh
On Mon, Aug 03, 2020 at 11:32:39AM -0400, Steven Rostedt wrote: > On Mon, 3 Aug 2020 14:47:19 + > Kalesh Singh wrote: > > > +DECLARE_EVENT_CLASS(dma_buf_ref_template, > > + > > + TP_PROTO(struct task_struct *task, struct file *filp), > > + > > + TP_ARGS(task, filp), > > + > > +

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Suren Baghdasaryan
On Mon, Aug 3, 2020 at 9:12 AM Matthew Wilcox wrote: > > On Mon, Aug 03, 2020 at 09:00:00AM -0700, Suren Baghdasaryan wrote: > > On Mon, Aug 3, 2020 at 8:41 AM Matthew Wilcox wrote: > > > > > > On Mon, Aug 03, 2020 at 02:47:19PM +, Kalesh Singh wrote: > > > > +static void

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Matthew Wilcox
On Mon, Aug 03, 2020 at 09:00:00AM -0700, Suren Baghdasaryan wrote: > On Mon, Aug 3, 2020 at 8:41 AM Matthew Wilcox wrote: > > > > On Mon, Aug 03, 2020 at 02:47:19PM +, Kalesh Singh wrote: > > > +static void dma_buf_fd_install(int fd, struct file *filp) > > > +{ > > > +

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Suren Baghdasaryan
On Mon, Aug 3, 2020 at 8:41 AM Matthew Wilcox wrote: > > On Mon, Aug 03, 2020 at 02:47:19PM +, Kalesh Singh wrote: > > +static void dma_buf_fd_install(int fd, struct file *filp) > > +{ > > + trace_dma_buf_fd_ref_inc(current, filp); > > +} > > You're adding a new file_operation in order to

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Matthew Wilcox
On Mon, Aug 03, 2020 at 02:47:19PM +, Kalesh Singh wrote: > +static void dma_buf_fd_install(int fd, struct file *filp) > +{ > + trace_dma_buf_fd_ref_inc(current, filp); > +} You're adding a new file_operation in order to just add a new tracepoint? NACK.

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Steven Rostedt
On Mon, 3 Aug 2020 14:47:19 + Kalesh Singh wrote: > +DECLARE_EVENT_CLASS(dma_buf_ref_template, > + > + TP_PROTO(struct task_struct *task, struct file *filp), > + > + TP_ARGS(task, filp), > + > + TP_STRUCT__entry( > + __field(u32, tgid) > + __field(u32,

[PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Kalesh Singh
Being able to analyze the per process usage of shared dma buffers prodives useful insights in situations where the system is experiencing high memory pressure. This would allow us to see exactly which processes are holding references to the shared buffer. Signed-off-by: Kalesh Singh ---