mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Satyam Sharma" <satyam.sharma@gmail.com>
To: "Jan Beulich" <jbeulich@novell.com>
Cc: "Sam Ravnborg" <sam@ravnborg.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix improper .init-type section references
Date: Tue, 12 Jun 2007 16:51:04 +0530	[thread overview]
Message-ID: <a781481a0706120421l94f8d8dk864f288d63c01b1a@mail.gmail.com> (raw)
In-Reply-To: <466E89EB.76E4.0078.0@novell.com>

On 6/12/07, Jan Beulich <jbeulich@novell.com> wrote:
> >> -static __init void kthreadd_setup(void)
> >> +static noinline __init_refok void kthreadd_setup(void)
> >>  {
> >>         struct task_struct *tsk = current;
> >
> >This isn't ok. There isn't any __init function that is (safely) referenced
> >by kthreadd_setup(), so we shouldn't really be marking it as such.
> >Also, kthreadd_setup() is really only ever called at init time, so we'd
> >want it to remain __init.
>
> Oh, I see, I misunderstood the purpose of the tag - I assumed it would
> mark an __init function that is known to only be referenced from init-only
> code paths inside non-init functions (i.e. I didn't pay attention that the
> resulting section's name is .text.init.refok, not .init.text.refok).
>
> I have to admit I have some difficulty understanding when the tags
> are going to be useful the way they are implemented right now.

Yup, I had discussed precisely the same issue (whether to associate
__init_refok with callers or callees) with Sam earlier, but he thought
it'd be more useful to have normal-caller-can-ref-init-callees semantics
for the same.

> >I believe the correct fix to silence modpost here would be to mark its
> >caller kthreadd() also as __init, because it too is used only at init time?
>
> I don't think so - it is my understanding that this is the body of a thread
> that never dies.

Ugh, yes, I'm smoking God-knows-what, and you're absolutely correct!

So we should be marking kthreadd() as __init_refok instead, it seems.

Satyam

  reply	other threads:[~2007-06-12 11:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-12  7:26 Jan Beulich
2007-06-12  9:42 ` Satyam Sharma
2007-06-12  9:56   ` Jan Beulich
2007-06-12 11:21     ` Satyam Sharma [this message]
2007-06-12 11:28       ` Satyam Sharma

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=a781481a0706120421l94f8d8dk864f288d63c01b1a@mail.gmail.com \
    --to=satyam.sharma@gmail.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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

all inboxes | Powered by JetHome®