From: Steven Rostedt <rostedt@goodmis.org>
To: Ajay Kaher <akaher@vmware.com>
Cc: "mhiramat@kernel.org" <mhiramat@kernel.org>,
"shuah@kernel.org" <shuah@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-trace-kernel@vger.kernel.org"
<linux-trace-kernel@vger.kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
Ching-lin Yu <chinglinyu@google.com>,
Nadav Amit <namit@vmware.com>,
"srivatsa@csail.mit.edu" <srivatsa@csail.mit.edu>,
Alexey Makhalov <amakhalov@vmware.com>,
Vasavi Sirnapalli <vsirnapalli@vmware.com>,
Tapas Kundu <tkundu@vmware.com>,
"er.ajay.kaher@gmail.com" <er.ajay.kaher@gmail.com>
Subject: Re: [PATCH v3 03/10] eventfs: adding eventfs dir add functions
Date: Mon, 10 Jul 2023 15:06:06 -0400 [thread overview]
Message-ID: <20230710150606.2c8d2236@gandalf.local.home> (raw)
In-Reply-To: <285B9992-4DFB-4343-BD64-DAE9CCEFEE6B@vmware.com>
On Mon, 10 Jul 2023 18:53:53 +0000
Ajay Kaher <akaher@vmware.com> wrote:
> > On 10-Jul-2023, at 7:24 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > !! External Email
> >
> > On Mon, 3 Jul 2023 15:52:26 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> >> On Mon, 3 Jul 2023 18:51:22 +0000
> >> Ajay Kaher <akaher@vmware.com> wrote:
> >>
> >>>>
> >>>> We can also look to see if we can implement this with RCU. What exactly
> >>>> is this rwsem protecting?
> >>>>
> >>>
> >>> - struct eventfs_file holds the meta-data for file or dir.
> >>> https://github.com/intel-lab-lkp/linux/blob/dfe0dc15a73261ed83cdc728e43f4b3d4e315aae/include/linux/tracefs.h#L28
> >>> - eventfs_rwsem is supposed to protect the 'link-list which is made of struct eventfs_file
> >>> ' and elements of struct eventfs_file.
> >>
> >> RCU is usually the perfect solution for protecting link lists though. I'll
> >> take a look at this when I get back to work.
> >>
> >
> > So I did the below patch on top of this series. If you could fold this
> > into the appropriate patches, it should get us closer to an acceptable
> > solution.
> >
> > What I did was:
> >
> > 1. Moved the struct eventfs_file and eventfs_inode into event_inode.c as it
> > really should not be exposed to all users.
> >
> > 2. Added a recursion check to eventfs_remove_rec() as it is really
> > dangerous to have unchecked recursion in the kernel (we do have a fixed
> > size stack).
> >
> > 3. Removed all the eventfs_rwsem code and replaced it with an srcu lock for
> > the readers, and a mutex to synchronize the writers of the list.
> >
> > 4. Added a eventfs_mutex that is used for the modifications of the
> > dentry itself (as well as modifying the list from 3 above).
> >
> > 5. Have the free use srcu callbacks. After the srcu grace periods are done,
> > it adds the eventfs_file onto a llist (lockless link list) and wakes up a
> > work queue. Then the work queue does the freeing (this needs to be done in
> > task/workqueue context, as srcu callbacks are done in softirq context).
> >
> > This appears to pass through some of my instance stress tests as well as
> > the in tree ftrace selftests.
> >
>
> Awesome :)
>
> I have manually applied the patches and ftracetest results are same as v3.
> No more complains from lockdep.
>
> I will merge this into appropriate patches of v3 and soon send v4.
>
> You have renamed eventfs_create_dir() to create_dir(), and kept eventfs_create_dir()
> just a wrapper with lock, same for eventfs_create_file(). However these wrapper no where
> used, I will drop these wrappers.
Ah, I thought that because they started with "eventfs_" that they were used
for some fops pointer. Note, I try to avoid using the "eventfs_" naming for
static functions that are not exported elsewhere.
>
> I was trying to have independent lock for each instance of events. As common lock
> for every instance of events is not must.
We can find a way to make the lock for the root later. Let's get it working
first before we optimize it. I do not want to expose any locking to the
users of this interface.
>
> Something was broken in your mail (I guess cc list) and couldn’t reach to lkml or
> ignored by lkml. I just wanted to track the auto test results from linux-kselftest.
Yeah, claws-mail has an issue with some emails with quotes in it (sometimes
drops the second quote). Sad part is, it happens after I hit send, and it
is not part of the email. I'll send this reply now, but I bet it's going to happen again.
Let's see :-/ I checked the To and Cc's and they all have the proper
quotes. Let's see what ends up in my "Sent" folder.
-- Steve
next prev parent reply other threads:[~2023-07-10 19:06 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-01 9:00 [PATCH v3 00/10] tracing: introducing eventfs Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 01/10] tracing: Require all trace events to have a TRACE_SYSTEM Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 02/10] eventfs: introducing struct tracefs_inode Ajay Kaher
2023-07-01 13:25 ` Steven Rostedt
2023-07-02 14:55 ` Masami Hiramatsu
2023-06-01 9:00 ` [PATCH v3 03/10] eventfs: adding eventfs dir add functions Ajay Kaher
2023-07-01 13:54 ` Steven Rostedt
2023-07-03 10:13 ` Ajay Kaher
2023-07-03 15:08 ` Steven Rostedt
2023-07-03 18:51 ` Ajay Kaher
2023-07-03 19:52 ` Steven Rostedt
[not found] ` <20230709215447.536defa6@rorschach.local.home>
2023-07-10 2:17 ` Nadav Amit
2023-07-10 2:53 ` Steven Rostedt
2023-07-10 18:53 ` Ajay Kaher
2023-07-10 19:06 ` Steven Rostedt [this message]
[not found] ` <20230710150731.4ec2b9f8@gandalf.local.home>
2023-07-10 19:10 ` Steven Rostedt
2023-07-10 20:15 ` Steven Rostedt
2023-07-10 21:09 ` Steven Rostedt
2023-07-11 14:24 ` Steven Rostedt
2023-06-01 9:00 ` [PATCH v3 04/10] eventfs: adding eventfs file " Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 05/10] eventfs: adding eventfs file, directory remove function Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 06/10] eventfs: adding functions to create eventfs files and directories Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 07/10] eventfs: adding eventfs lookup, read, open functions Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 08/10] eventfs: creating tracefs_inode_cache Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 09/10] eventfs: moving tracing/events to eventfs Ajay Kaher
2023-06-10 15:25 ` kernel test robot
2023-06-13 7:06 ` Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 10/10] test: ftrace: fix kprobe test for eventfs Ajay Kaher
2023-06-13 8:21 ` Masami Hiramatsu
2023-06-01 9:07 ` [PATCH v3 00/10] tracing: introducing eventfs Ajay Kaher
2023-06-19 5:38 ` Ajay Kaher
2023-06-20 15:02 ` Steven Rostedt
2023-06-21 11:42 ` Ajay Kaher
2023-06-22 3:31 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230710150606.2c8d2236@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=akaher@vmware.com \
--cc=amakhalov@vmware.com \
--cc=chinglinyu@google.com \
--cc=er.ajay.kaher@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=namit@vmware.com \
--cc=shuah@kernel.org \
--cc=srivatsa@csail.mit.edu \
--cc=tkundu@vmware.com \
--cc=vsirnapalli@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).