All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [RFC/PATCH] unregister_node() for hotplug use
Date: Tue, 10 May 2005 11:15:29 -0700	[thread overview]
Message-ID: <4280FA41.3050403@us.ibm.com> (raw)
In-Reply-To: <20050510202053.3ddd9e7b.tokunaga.keiich@jp.fujitsu.com>

Keiichiro Tokunaga wrote:
> On Mon, 09 May 2005 15:44:03 -0700 Matthew Dobson wrote:
>>Is there a reason to not make both register_node() and unregister_node()
>>__devinit?  If a user has CONFIG_HOTPLUG=y then they want these functions,
>>otherwise there is no point, as they promised they won't be hotplugging
>>anything, right?
> 
>   The main reason is Greg advised me that we had the function
> no matter if CONFIG_HOTPLUG is true or not.  An addtional
> advantage of this is that the source becomes cleaner because
> I included unregister_node() with '#ifdef CONFIG_HOTPLUG' and
> '#endif' in my previous version of patch.
> 
> Thanks,
> Keiichiro Tokunaga
> 

You're referring to this comment:

On Thu, 21 Apr 2005 17:39:20 -0700 Greg KH wrote:
>> And hey, what's the real big deal here, why not always have this
>> function no matter if CONFIG_HOTPLUG is enabled or not?  I really want
>> to just make that an option that is always enabled anyway, but changable
>> if you are using CONFIG_TINY or something...

correct?  I think GregKH was referring to you #ifdef'ing the function away
so that it isn't even there if CONFIG_HOTPLUG=n, which is completely
different from marking the function as __devinit.

If you mark the function as __devinit, it will still be there for the
kernel initialization phase whether CONFIG_HOTPLUG is on or off.  What it
does mean, however, is that the function will get freed, along with the
rest of the functions/data marked __init or __initdata, if CONFIG_HOTPLUG
is off.  If CONFIG_HOTPLUG is on, __devinit is defined to be nothing and
the function will remain because there is a possibility that someone will
call the function after the initialization phase.  If CONFIG_HOTPLUG is
off, the user is assuring us that no devices will be hot-added or
hot-removed, so there is no point in bloating the kernel text (albeit very
slightly) with functions that we *know* won't be called.

So I think it's probably a good idea to stick the __devinit on
register_node() and unregister_node(), otherwise we have no marker to know
which functions to remove for CONFIG_TINY.  Greg?

-Matt

  reply	other threads:[~2005-05-10 18:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-20 12:07 [RFC/PATCH] unregister_node() for hotplug use Keiichiro Tokunaga
2005-04-20 12:35 ` Arjan van de Ven
2005-04-21  9:25   ` Keiichiro Tokunaga
2005-04-20 17:32 ` Greg KH
2005-04-21 15:30   ` Keiichiro Tokunaga
2005-04-22  0:39     ` Greg KH
2005-04-22  2:32       ` Keiichiro Tokunaga
2005-04-25 14:03         ` Keiichiro Tokunaga
2005-04-26  6:54           ` Greg KH
2005-04-28  0:17             ` Keiichiro Tokunaga
2005-05-07 12:11             ` Keiichiro Tokunaga
2005-05-08  0:26               ` Nathan Lynch
2005-05-08 12:28                 ` Keiichiro Tokunaga
2005-05-09 22:44               ` Matthew Dobson
2005-05-10 11:20                 ` Keiichiro Tokunaga
2005-05-10 18:15                   ` Matthew Dobson [this message]
2005-05-10 18:45                     ` Greg KH
2005-05-10 18:58                       ` Matthew Dobson
2005-05-10 20:11                         ` Greg KH
2005-05-10 20:13                           ` Matthew Dobson

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=4280FA41.3050403@us.ibm.com \
    --to=colpatch@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tokunaga.keiich@jp.fujitsu.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.