Re: [PATCH] mm: fix oom roll-back of __vmalloc_area_node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 13 Jul 2006 09:38:38 +0200
Jan Kiszka <[email protected]> wrote:

> > I think the change would be a good one even if it didn't fix a bug, thanks.
> >
> >   
> Meanwhile I thought about an even simpler solution:
> 
> 
> __vunmap must not rely on area->nr_pages when picking the
> release methode for area->pages. It may be too small when
> __vmalloc_area_node failed due to lacking memory. Check
> for the vmalloc address range instead.
> 
> Signed-off by: Jan Kiszka <[email protected]>
> 
> Index: linux-2.6/mm/vmalloc.c
> ===================================================================
> --- linux-2.6.orig/mm/vmalloc.c
> +++ linux-2.6/mm/vmalloc.c
> @@ -340,7 +340,7 @@ void __vunmap(void *addr, int deallocate
>  			__free_page(area->pages[i]);
>  		}
>  
> -		if (area->nr_pages > PAGE_SIZE/sizeof(struct page *))
> +		if (area->pages >= VMALLOC_START && area->pages < VMALLOC_END)
>  			vfree(area->pages);
>  		else
>  			kfree(area->pages);

Nah, your first patch was better.  Very clear, direct, explicit.

It even had a comment.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux