From: Oleg Nesterov <oleg@redhat.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>,
Jiri Olsa <jolsa@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/4] tracing: fix open/delete fixes
Date: Thu, 18 Jul 2013 17:27:01 +0200 [thread overview]
Message-ID: <20130718152701.GB6588@redhat.com> (raw)
In-Reply-To: <51E7A4CF.2050404@hitachi.com>
On 07/18, Masami Hiramatsu wrote:
>
> (2013/07/17 23:43), Oleg Nesterov wrote:
> > Once again, I am still not sure and I am asking for your review.
>
> OK,
Good ;)
> > - If we kill .open/release, we do not need the nontrivial
> > refcounting. Everything becomes simple, no need to keep
> > the state "in between".
>
> That also means to refrain checking existence under locking mutex
> in all operations.
Speaking of event_enable_write() it needs the same mutex anyway.
> And we have to check it, which I actually concern.
> refcounting is not so small and itself is complex, but it just
> needs to inc/dec on open/close.
And this inc/dec needs event_mutex too, and the code is not trivial.
But yes, sure, I am not saying that it is always a win performance-wise.
In particular, with the patches I sent event/format holds event_mutex
between .start and .stop. But again, this is only to make the patch
simple. We can narrow the scope of this lock, we can switch to i_mutex
(needs the trivial change in invalidate_event_files) which should not
be contended.
And of course, sometimes it is better to do the "hard work" in .open()
and make .read/write as fast/simple as possible. But not in event/*
case, I think.
> > - This also simplifies trace_remove_event_call() paths, we
> > know that once it takes event_mutex nobody can play with
> > ftrace_event_file/ftrace_event_call we are going to free.
>
> Hmm, it seems that we can remove only refcount check, or more?
But this check is not necessarily trivial too.
And to remind, personally I do not really like the fact that the
opened file blocks rmdir or unregister_probe_event().
To summarise. I believe that this approach is better (and simpler)
in general. But I understand that "better" is subjective, so I won't
argue. Not to mention, it can be simply wrong so I will heavily rely
on your/Steven's review anyway.
Oleg.
next prev parent reply other threads:[~2013-07-18 15:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 18:56 [RFC PATCH 0/4] tracing: fix open/delete fixes Oleg Nesterov
2013-07-16 18:57 ` [RFC PATCH 1/4] tracing: Change remove_event_from_tracers() to clear d_subdirs->i_private Oleg Nesterov
2013-07-16 18:57 ` [RFC PATCH 2/4] tracing: Turn "id"->i_private into call->event.type Oleg Nesterov
2013-07-16 19:49 ` Steven Rostedt
2013-07-17 19:39 ` Oleg Nesterov
2013-07-16 18:57 ` [RFC PATCH 3/4] tracing: Kill tracing_open/release_generic_file Oleg Nesterov
2013-07-16 19:51 ` Steven Rostedt
2013-07-17 19:19 ` Oleg Nesterov
2013-07-18 10:56 ` Masami Hiramatsu
2013-07-18 14:55 ` Oleg Nesterov
2013-07-16 18:57 ` [RFC PATCH 4/4] tracing: Change ftrace_event_filter_fops to rely on event_mutex/i_private Oleg Nesterov
2013-07-17 2:36 ` [RFC PATCH 0/4] tracing: fix open/delete fixes Masami Hiramatsu
2013-07-17 14:43 ` Oleg Nesterov
2013-07-18 8:18 ` Masami Hiramatsu
2013-07-18 15:27 ` Oleg Nesterov [this message]
2013-07-17 19:30 ` [RFC PATCH 5/4] tracing: Simplify the ftrace_event_field iteration in f_next/f_show Oleg Nesterov
2013-07-17 19:37 ` Oleg Nesterov
2013-07-17 19:30 ` [RFC PATCH 6/4] tracing: Change f_start() to verify i_private under event_mutex Oleg Nesterov
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=20130718152701.GB6588@redhat.com \
--to=oleg@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.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).