All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <ntl@pobox.com>
To: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Cc: Greg KH <gregkh@suse.de>, linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [RFC/PATCH] unregister_node() for hotplug use
Date: Sat, 7 May 2005 19:26:48 -0500	[thread overview]
Message-ID: <20050508002648.GD3614@otto> (raw)
In-Reply-To: <20050507211141.4829d4c0.tokunaga.keiich@jp.fujitsu.com>

> This adds a generic function 'unregister_node()'.
> It is used to remove objects of a node going away
> for hotplug.
> 
> Signed-off-by: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com>
> ---
> 
>  linux-2.6.12-rc3-mm3-kei/drivers/base/node.c  |   15 +++++++++++++--
>  linux-2.6.12-rc3-mm3-kei/include/linux/node.h |    1 +
>  2 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff -puN drivers/base/node.c~numa_hp_base drivers/base/node.c
> --- linux-2.6.12-rc3-mm3/drivers/base/node.c~numa_hp_base	2005-05-07 19:58:15.000000000 +0900
> +++ linux-2.6.12-rc3-mm3-kei/drivers/base/node.c	2005-05-07 19:58:15.000000000 +0900
> @@ -136,7 +136,7 @@ static SYSDEV_ATTR(distance, S_IRUGO, no
>   *
>   * Initialize and register the node device.
>   */
> -int __init register_node(struct node *node, int num, struct node *parent)
> +int register_node(struct node *node, int num, struct node *parent)
>  {
>  	int error;
>  
> @@ -153,8 +153,19 @@ int __init register_node(struct node *no
>  	return error;
>  }
>  
> +void unregister_node(struct node *node)
> +{
> +	sysdev_remove_file(&node->sysdev, &attr_cpumap);
> +	sysdev_remove_file(&node->sysdev, &attr_meminfo);
> +	sysdev_remove_file(&node->sysdev, &attr_numastat);
> +	sysdev_remove_file(&node->sysdev, &attr_distance);
> +
> +	sysdev_unregister(&node->sysdev);
> +}

Is it a bug to call unregister_node() if there are still cpus or
memory present in the node?  Note that register_cpu() creates a
symlink under the node directory to the cpu -- are you assuming that
all the node's cpu sysdevs will have been unregistered by the time
unregister_node is called?  If so, is it possible to enforce that, or
at least document it?

> +EXPORT_SYMBOL_GPL(register_node);
> +EXPORT_SYMBOL_GPL(unregister_node);

What module code needs to call these?  ACPI?


Nathan

  reply	other threads:[~2005-05-08  0:26 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 [this message]
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
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=20050508002648.GD3614@otto \
    --to=ntl@pobox.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.