All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	markus.t.metzger@gmail.com
Subject: Re: [PATCH -mm] tracing: Fix section mismatch in trace_hw_branches.c
Date: Sun, 22 Feb 2009 17:22:35 +0100	[thread overview]
Message-ID: <20090222162234.GA6003@nowhere> (raw)
In-Reply-To: <b9df5fa10902220533rb625291k135b3218151e12e5@mail.gmail.com>

On Sun, Feb 22, 2009 at 07:33:08PM +0600, Rakib Mullick wrote:
> On 2/21/09, Frederic Weisbecker <fweisbec@gmail.com> wrote:
> 
> > Hi,
> >
> >  When I saw this patch, I searched the real purpose of __cpuinit and its
> >  real impact.
> >  But I didn't find any comments about it inside the kernel.
> >
> >  But today, by looking at the discussion around latest git pull for x86
> >  to mainline, I discover that __cpuinit becomes __init on UP.
> >
> >  So, unless I missed something, this patch seems to me very dangerous.
> >  The init and reset callbacks of a tracer can be called at any time, not only
> >  on initcalls time (__init functions are freed from memory after the middle stage
> >  of the boot).
> >  With this patch, on UP we will dereference freed memory while activating this tracer.
> If the init and reset callbacks of a tracer can be called regardless
> of cpu hotpluging then it is. If the tracer's init or reset doesn't
> rely on cpuhotplug then it shouldn't use it.
> There's a another way to fix the warning is by remove __cpuinitdata
> from bts_hotcpu_notifier.


Yes, they can be called on UP, on SMP with or without cpu hotplug,
and everytime (boot, runtime).

init() is called when you switch to a tracer:

echo tracer_name > /debug/tracing/current_tracer

and reset() is called when you switch to another one.

But removing __cpuinitdata will mean a kind of waste of memory (though it's only
a little struct).

 
> Thanks,


  reply	other threads:[~2009-02-22 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-14  3:36 [PATCH -mm] tracing: Fix section mismatch in trace_hw_branches.c Rakib Mullick
2009-02-15 19:41 ` Ingo Molnar
2009-02-21 15:22 ` Frederic Weisbecker
2009-02-22 13:33   ` Rakib Mullick
2009-02-22 16:22     ` Frederic Weisbecker [this message]
2009-02-23 10:21       ` Markus Metzger
2009-02-22 16:15   ` KOSAKI Motohiro
2009-02-22 16:23     ` Frederic Weisbecker
2009-02-22 19:29     ` Sam Ravnborg

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=20090222162234.GA6003@nowhere \
    --to=fweisbec@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.t.metzger@gmail.com \
    --cc=mingo@elte.hu \
    --cc=rakib.mullick@gmail.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.