All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@engr.sgi.com>
To: John Levon <levon@movementarian.org>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	Jack Steiner <steiner@sgi.com>,
	linux-kernel@vger.kernel.org, edwardsg@sgi.com,
	dipankar@in.ibm.com
Subject: Re: contention on profile_lock
Date: Thu, 4 Nov 2004 14:08:28 -0800	[thread overview]
Message-ID: <200411041408.28694.jbarnes@engr.sgi.com> (raw)
In-Reply-To: <20041104215113.GA54024@compsoc.man.ac.uk>

On Thursday, November 4, 2004 1:51 pm, John Levon wrote:
> On Thu, Nov 04, 2004 at 12:49:21PM -0800, Jesse Barnes wrote:
> > John pointed out that this breaks modules.  Would registering and
> > unregistering a function pointer thus be module safe?  Dipankar,
> > hopefully you have something better?
> >
> > static int timer_start(void)
> > {
> >  /* Setup the callback pointer */
> >  oprofile_timer_notify = oprofile_timer;
> >  return 0;
> > }
>
> Surely something like (profile.c):
>
> funcptr_t timer_hook;
>
> static int register_timer_hook(funcptr_t hook)
> {
>  if (timer_hook)
>   return -EBUSY;
>  timer_hook = hook;
> }
>
> static void unregister_timer_hook(funcptr_t hook)
> {
>  WARN_ON(hook != timer_hook);
>  timer_hook = NULL;
>  /* make sure all CPUs see the NULL hook */
>  synchronize_kernel();
> }

Yes, that's much better.  Will post another one shortly.  Thanks.

Jesse

  reply	other threads:[~2004-11-04 22:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-02 19:52 contention on profile_lock Jesse Barnes
2004-11-02 20:02 ` Jack Steiner
2004-11-02 21:42   ` Jesse Barnes
2004-11-04 19:56     ` Jesse Barnes
2004-11-04 20:12       ` William Lee Irwin III
2004-11-04 20:49         ` Jesse Barnes
2004-11-04 21:51           ` John Levon
2004-11-04 22:08             ` Jesse Barnes [this message]
2004-11-04 21:55           ` Jesse Barnes
2004-11-04 22:16             ` Dipankar Sarma
2004-11-04 22:21             ` John Levon
2004-11-04 22:27               ` Jesse Barnes
2004-11-04 22:52                 ` John Levon

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=200411041408.28694.jbarnes@engr.sgi.com \
    --to=jbarnes@engr.sgi.com \
    --cc=dipankar@in.ibm.com \
    --cc=edwardsg@sgi.com \
    --cc=levon@movementarian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steiner@sgi.com \
    --cc=wli@holomorphy.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.