In an interrupt context we cannot wait for the vmlist_lock in
__get_vm_area_node(). So use a trylock instead. If the trylock fails
then the atomic allocation will fail and subsequently be retried.
This only works because the flush_cache_vunmap in use for
allocation is never performing any IPIs in contrast to flush_tlb_...
in use for freeing. flush_cache_vunmap is only used on architectures
with a virtually mapped cache (xtensa, pa-risc).
[Note: Nick Piggin is working on a scheme to make this simpler by
no longer requiring flushes]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
mm/vmalloc.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Index: linux-2.6/mm/vmalloc.c
===================================================================
--- linux-2.6.orig/mm/vmalloc.c 2007-09-24 16:03:49.000000000 -0700
+++ linux-2.6/mm/vmalloc.c 2007-09-24 16:04:32.000000000 -0700
@@ -289,7 +289,6 @@ static struct vm_struct *__get_vm_area_n
unsigned long align = 1;
unsigned long addr;
- BUG_ON(in_interrupt());
if (flags & VM_IOREMAP) {
int bit = fls(size);
@@ -314,7 +313,14 @@ static struct vm_struct *__get_vm_area_n
*/
size += PAGE_SIZE;
- write_lock(&vmlist_lock);
+ if (gfp_mask & __GFP_WAIT)
+ write_lock(&vmlist_lock);
+ else {
+ if (!write_trylock(&vmlist_lock)) {
+ kfree(area);
+ return NULL;
+ }
+ }
for (p = &vmlist; (tmp = *p) != NULL ;p = &tmp->next) {
if ((unsigned long)tmp->addr < addr) {
if((unsigned long)tmp->addr + tmp->size >= addr)
--
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Linus Torvalds | Linux 2.6.21-rc1 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| pageexec | Re: [stable] Linux 2.6.25.10 |
| Linus Torvalds | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
git: | |
