Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-23 Thread Yafang Shao
On Thu, Sep 24, 2020 at 12:09 AM Steven Rostedt wrote: > > On Wed, 23 Sep 2020 18:04:17 +0800 > Yafang Shao wrote: > > > > What you can do, and what we have done is the following: > > > > > > (see include/linux/page_ref.h) > > > > > > > > > #ifdef CONFIG_TRACING > > > extern struct tracepoint __t

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-23 Thread Tom Zanussi
Hi Steve, Axel, On Fri, 2020-09-18 at 16:41 -0400, Steven Rostedt wrote: > On Fri, 18 Sep 2020 13:26:37 -0700 > Axel Rasmussen wrote: > > > On Thu, Sep 17, 2020 at 12:43 PM Steven Rostedt < > > rost...@goodmis.org> wrote: > > > > > > On Thu, 17 Sep 2020 11:13:47 -0700 > > > Axel Rasmussen wrot

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-23 Thread Axel Rasmussen
On Wed, Sep 23, 2020 at 9:09 AM Steven Rostedt wrote: > > On Wed, 23 Sep 2020 18:04:17 +0800 > Yafang Shao wrote: > > > > What you can do, and what we have done is the following: > > > > > > (see include/linux/page_ref.h) > > > > > > > > > #ifdef CONFIG_TRACING > > > extern struct tracepoint __tr

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-23 Thread Steven Rostedt
On Wed, 23 Sep 2020 18:04:17 +0800 Yafang Shao wrote: > > What you can do, and what we have done is the following: > > > > (see include/linux/page_ref.h) > > > > > > #ifdef CONFIG_TRACING > > extern struct tracepoint __tracepoint_mmap_lock_start_locking; > > extern struct tracepoint __tracepoint_

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-23 Thread Yafang Shao
On Wed, Sep 23, 2020 at 12:51 AM Steven Rostedt wrote: > > On Tue, 22 Sep 2020 12:09:19 +0800 > Yafang Shao wrote: > > > > > Are there any methods to avoid un-inlining these wrappers ? > > > > > > > > For example, > > > > // include/linux/mmap_lock.h > > > > > > > > void mmap_lock_start_trace_wra

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-22 Thread Steven Rostedt
On Tue, 22 Sep 2020 12:09:19 +0800 Yafang Shao wrote: > > > Are there any methods to avoid un-inlining these wrappers ? > > > > > > For example, > > > // include/linux/mmap_lock.h > > > > > > void mmap_lock_start_trace_wrapper(); > > > void mmap_lock_acquire_trace_wrapper(); > > > > > > static in

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-22 Thread Axel Rasmussen
On Mon, Sep 21, 2020 at 9:09 PM Yafang Shao wrote: > > On Tue, Sep 22, 2020 at 12:53 AM Axel Rasmussen > wrote: > > > > On Sun, Sep 20, 2020 at 9:58 PM Yafang Shao wrote: > > > > > > On Fri, Sep 18, 2020 at 2:13 AM Axel Rasmussen > > > wrote: > > > > > > > > The goal of these tracepoints is to

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-21 Thread Yafang Shao
On Tue, Sep 22, 2020 at 12:53 AM Axel Rasmussen wrote: > > On Sun, Sep 20, 2020 at 9:58 PM Yafang Shao wrote: > > > > On Fri, Sep 18, 2020 at 2:13 AM Axel Rasmussen > > wrote: > > > > > > The goal of these tracepoints is to be able to debug lock contention > > > issues. This lock is acquired on

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-21 Thread Axel Rasmussen
On Sun, Sep 20, 2020 at 9:58 PM Yafang Shao wrote: > > On Fri, Sep 18, 2020 at 2:13 AM Axel Rasmussen > wrote: > > > > The goal of these tracepoints is to be able to debug lock contention > > issues. This lock is acquired on most (all?) mmap / munmap / page fault > > operations, so a multi-threa

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-20 Thread Yafang Shao
On Fri, Sep 18, 2020 at 2:13 AM Axel Rasmussen wrote: > > The goal of these tracepoints is to be able to debug lock contention > issues. This lock is acquired on most (all?) mmap / munmap / page fault > operations, so a multi-threaded process which does a lot of these can > experience significant

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-18 Thread Steven Rostedt
On Fri, 18 Sep 2020 13:26:37 -0700 Axel Rasmussen wrote: > On Thu, Sep 17, 2020 at 12:43 PM Steven Rostedt wrote: > > > > On Thu, 17 Sep 2020 11:13:47 -0700 > > Axel Rasmussen wrote: > > > > > +/* > > > + * Trace calls must be in a separate file, as otherwise there's a > > > circuclar > > >

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-18 Thread Axel Rasmussen
On Thu, Sep 17, 2020 at 12:43 PM Steven Rostedt wrote: > > On Thu, 17 Sep 2020 11:13:47 -0700 > Axel Rasmussen wrote: > > > +/* > > + * Trace calls must be in a separate file, as otherwise there's a circuclar > > + * dependency between linux/mmap_lock.h and trace/events/mmap_lock.h. > > + */ > >

Re: [PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-17 Thread Steven Rostedt
On Thu, 17 Sep 2020 11:13:47 -0700 Axel Rasmussen wrote: > +/* > + * Trace calls must be in a separate file, as otherwise there's a circuclar > + * dependency between linux/mmap_lock.h and trace/events/mmap_lock.h. > + */ > + > +static void trace_start_locking(struct mm_struct *mm, bool write) P

[PATCH] mmap_lock: add tracepoints around lock acquisition

2020-09-17 Thread Axel Rasmussen
The goal of these tracepoints is to be able to debug lock contention issues. This lock is acquired on most (all?) mmap / munmap / page fault operations, so a multi-threaded process which does a lot of these can experience significant contention. We trace just before we start acquisition, when the