mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: fche@redhat.com (Frank Ch. Eigler)
To: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>
Cc: "Stone, Joshua I" <joshua.i.stone@intel.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Prasanna S Panchamukhi <prasanna@in.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	SystemTAP <systemtap@sources.redhat.com>,
	Satoshi Oshima <soshima@redhat.com>,
	Hideo Aoki <haoki@redhat.com>,
	Yumiko Sugita <yumiko.sugita.yf@hitachi.com>,
	hch@infradead.org
Subject: Re: [RFC][Patch 1/4] kprobe fast unregistration
Date: 25 Mar 2007 22:29:51 -0400	[thread overview]
Message-ID: <y0mmz20n3ds.fsf@ton.toronto.redhat.com> (raw)
In-Reply-To: <20070323190127.GA13974@bambi.jf.intel.com>


Hi -

"Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com> writes:

> [...]
> > Really?  What possible problems can occur?  The worst that occurs
> > to me is that if someone forgets to call the commit function, the
> > kprobes will still be disabled, but memory won't be recycled for a
> > while.  [...]
>
> Yes, Have you looked at the code? 

A little, but we were talking more about the interface than the
implementation.

> If someone forgets to call the commit function, the kprobe will be
> disabled and yes the memory won't be recycled but the worst problem
> is that if the probe is on a module function then that module can't
> be unloaded at all [...]

I believe there is already a kprobes patch in the queue for
enumerating active probes in some /proc file.  Should a module be
locked into memory for such a reason, finding the culprit should not
be difficult.

> Hence, my suggestion would be to call them as disable_kprobe()
> (instead of unregister_kprobes_fast() which is confusing and error
> prone) and also to provide an opposite function to reenable_kprobe()
> and finally provide unregister_disabled_kprobes() which is
> essentially the same as commit_kprobes().

One problem with this idea is that if the unregister_fast()=disable()
is to become reversible, then the renamed commit_kprobes() will no
longer be indempotent.  There can no longer be a single system-wide
deferred-kprobe-cleanup list, since individual kprobes clients might
want to reinstate their probes in the future.

> > Would it be possible to allay even that concern with an automated
> > deferred/periodic commit?
> > 
> I would recomand that users call unregister_disabled_kprobes() explictly.

But this would solve both problems (memory leaks and outstanding
reference counts on modules).  In this variant,
unregister_kprobes_fast could replace unregister_kprobes outright, and
the (builtin deferred) commit function would need not be exported.

- FChE

  parent reply	other threads:[~2007-03-26  2:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23 14:43 Masami Hiramatsu
2007-03-23 14:45 ` [RFC][Patch 2/4] kretprobe fast unregisteration Masami Hiramatsu
2007-03-23 14:46 ` [RFC][Patch 3/4] jprobe " Masami Hiramatsu
2007-03-23 14:47 ` [RFC][Patch 4/4] kprobes fast unregisteration documentation Masami Hiramatsu
2007-03-23 17:23 ` [RFC][Patch 1/4] kprobe fast unregistration Christoph Hellwig
     [not found] ` <20070323180527.GA13728@bambi.jf.intel.com>
2007-03-23 18:12   ` Stone, Joshua I
2007-03-23 18:22     ` Frank Ch. Eigler
     [not found]       ` <20070323190127.GA13974@bambi.jf.intel.com>
2007-03-26  2:29         ` Frank Ch. Eigler [this message]
2007-03-31 13:01       ` Christoph Hellwig
2007-03-31 13:06     ` Christoph Hellwig
2007-03-26  3:17   ` Masami Hiramatsu
     [not found]     ` <20070326181518.GA28384@bambi.jf.intel.com>
2007-03-27  3:24       ` 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=y0mmz20n3ds.fsf@ton.toronto.redhat.com \
    --to=fche@redhat.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=haoki@redhat.com \
    --cc=hch@infradead.org \
    --cc=joshua.i.stone@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=prasanna@in.ibm.com \
    --cc=soshima@redhat.com \
    --cc=systemtap@sources.redhat.com \
    --cc=yumiko.sugita.yf@hitachi.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

Powered by JetHome