login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
March
»
21
Re: [PATCH 1/5] generic __remove_pages() support
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Badari Pulavarty
Subject:
Re: [PATCH 1/5] generic __remove_pages() support
Date: Friday, March 21, 2008 - 9:55 am
On Sat, 2008-03-22 at 00:25 +0900, Yasunori Goto wrote:
quoted text
> Badari-san. > > > Index: linux-2.6.25-rc2/mm/memory_hotplug.c > > =================================================================== > > --- linux-2.6.25-rc2.orig/mm/memory_hotplug.c 2008-02-27 12:58:17.000000000 -0800 > > +++ linux-2.6.25-rc2/mm/memory_hotplug.c 2008-02-27 16:06:50.000000000 -0800 > > @@ -102,6 +102,21 @@ static int __add_section(struct zone *zo > > return register_new_memory(__pfn_to_section(phys_start_pfn)); > > } > > > > +static int __remove_section(struct zone *zone, struct mem_section *ms) > > +{ > > + int ret = -EINVAL; > > + > > + if (!valid_section(ms)) > > + return ret; > > + > > + ret = unregister_memory_section(ms); > > + if (ret) > > + return ret; > > + > > + sparse_remove_one_section(zone, ms); > > + return 0; > > +} > > + > > /* > > * Reasonably generic function for adding memory. It is > > * expected that archs that support memory hotplug will > > @@ -135,6 +150,35 @@ int __add_pages(struct zone *zone, unsig > > } > > EXPORT_SYMBOL_GPL(__add_pages); > > > > +int __remove_pages(struct zone *zone, unsigned long phys_start_pfn, > > + unsigned long nr_pages) > > +{ > > + unsigned long i, ret = 0; > > + int sections_to_remove; > > + unsigned long flags; > > + struct pglist_data *pgdat = zone->zone_pgdat; > > + > > + /* > > + * We can only remove entire sections > > + */ > > + BUG_ON(phys_start_pfn & ~PAGE_SECTION_MASK); > > + BUG_ON(nr_pages % PAGES_PER_SECTION); > > + > > + release_mem_region(phys_start_pfn << PAGE_SHIFT, nr_pages * PAGE_SIZE); > > + > > + sections_to_remove = nr_pages / PAGES_PER_SECTION; > > + for (i = 0; i < sections_to_remove; i++) { > > + unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION; > > + pgdat_resize_lock(pgdat, &flags); > > + ret = __remove_section(zone, __pfn_to_section(pfn)); > > + pgdat_resize_unlock(pgdat, &flags); > > + if (ret) > > + break; > > + } > > + return ret; > > +} > > +EXPORT_SYMBOL_GPL(__remove_pages); > > Here may be a bug. > __remove_section() is called with pgdat_resize_lock() which is > spin_lock_irqsave(). > > __remove_section() > | > +--> unregister_memory_section() > | > +--> remove_memory_block() > | > +--> unregister_memory() > | > +--> sysdev_unregister() > > sysdev_unregister() calls mutex_lock(). > It might sleep with irq disable, right? > I found BUG()'s messages by this.
Hmm. I think you are right. Let me take a look and see if we can move sysdev_unregister() outside the lock. Thanks for finding it. Thanks, Badari --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH 0/5] 2.6.25-rc3-mm1 hotplug memory remove updates
, Badari Pulavarty
, (Thu Mar 6, 11:54 am)
[PATCH 1/5] generic __remove_pages() support
, Badari Pulavarty
, (Thu Mar 6, 11:55 am)
[PATCH 2/5] [PPC] htab_remove_mapping() error handling
, Badari Pulavarty
, (Thu Mar 6, 11:56 am)
[PATCH 3/5] [PPC] hotplug memory notifications for ppc
, Badari Pulavarty
, (Thu Mar 6, 11:57 am)
[PATCH 4/5] [PPC] update lmb for hotplug memory add/remove
, Badari Pulavarty
, (Thu Mar 6, 11:58 am)
[PATCH 5/5] [PPC] provide walk_memory_resource() for ppc
, Badari Pulavarty
, (Thu Mar 6, 11:59 am)
Re: [PATCH 1/5] generic __remove_pages() support
, Randy Dunlap
, (Thu Mar 6, 12:08 pm)
Re: [PATCH 1/5] generic __remove_pages() support
, Badari Pulavarty
, (Thu Mar 6, 12:29 pm)
Re: [PATCH 1/5] generic __remove_pages() support
, Dave Hansen
, (Thu Mar 6, 1:54 pm)
Re: [PATCH 1/5] generic __remove_pages() support
, Badari Pulavarty
, (Thu Mar 6, 2:42 pm)
Re: [PATCH 1/5] generic __remove_pages() support
, Badari Pulavarty
, (Thu Mar 6, 4:37 pm)
Re: [PATCH 1/5] generic __remove_pages() support
, Yasunori Goto
, (Thu Mar 6, 6:35 pm)
Re: [PATCH 1/5] generic __remove_pages() support
, Badari Pulavarty
, (Fri Mar 7, 9:36 am)
Re: [PATCH 1/5] generic __remove_pages() support
, Badari Pulavarty
, (Fri Mar 7, 9:44 am)
Re: [PATCH 1/5] generic __remove_pages() support
, Yasunori Goto
, (Fri Mar 21, 8:25 am)
Re: [PATCH 1/5] generic __remove_pages() support
, Badari Pulavarty
, (Fri Mar 21, 9:55 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Andrew Morton
Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2
Stephen Rothwell
linux-next: manual merge of the block tree with the ext4 tree
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Greg KH
Re: [ANNOUNCE] OSS Proxy using CUSE
Linus Torvalds
Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures
git
:
Felipe Contreras
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Johannes Schindelin
[PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
Johannes Schindelin
Re: [PATCH] Fix install-doc-quick target
Nicolas Pitre
Re: About git and the use of SHA-1
Alex Riesen
Re: git exclude patterns for directory
git-commits-head
:
Linux Kernel Mailing List
sh: Fix compile error by operands(mov.l) in sh3/entry.S
Linux Kernel Mailing List
New device ID for sc92031 [1088:2031]
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
tmpfs: depend on shmem
Linux Kernel Mailing List
drivers/acpi: use kasprintf
linux-netdev
:
Andi Kleen
Re: RFC: Nagle latency tuning
Paul Gortmaker
[PATCH net-next 09/16] tipc: Relocate trivial link status functions to header file
Russell King
Re: [BUG] New Kernel Bugs
Herbert Xu
Re: Oops in tun: bisected to Limit amount of queued packets per device
gregkh
Patch "IPv6: keep route for tentative address" has been added to the 2.6.34-stable...
openbsd-misc
:
Andres Salazar
About priorities in /etc/resolv.conf
Rob Shepherd
x86 hardware for router system
Damien Miller
Re: Patching a SSH 'Weakness'
P. Souza
Re: RouterBOARD RB600A support
Tonnerre LOMBARD
Re: bge0: watchdog timeout
Colocation donated by:
Syndicate