Re: [PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-12 Thread chrubis
Hi! > > +static unsigned long count_vma_pages_range(struct mm_struct *mm, > > + unsigned long addr, unsigned long end) > > +{ > > + unsigned long nr_pages = 0; > > + struct vm_area_struct *vma; > > + > > + /* Find first overlaping mapping */ > > + vma = find_vma_intersection(mm,

Re: [PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-12 Thread chrubis
Hi! +static unsigned long count_vma_pages_range(struct mm_struct *mm, + unsigned long addr, unsigned long end) +{ + unsigned long nr_pages = 0; + struct vm_area_struct *vma; + + /* Find first overlaping mapping */ + vma = find_vma_intersection(mm, addr, end); +

Re: [PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-11 Thread Andrew Morton
On Tue, 2 Apr 2013 11:54:03 +0200 Cyril Hrubis wrote: > This patch fixes corner case for MAP_FIXED when requested mapping length > is larger than rlimit for virtual memory. In such case any overlapping > mappings are unmapped before we check for the limit and return ENOMEM. > > The check is

Re: [PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-11 Thread Andrew Morton
On Tue, 2 Apr 2013 11:54:03 +0200 Cyril Hrubis chru...@suse.cz wrote: This patch fixes corner case for MAP_FIXED when requested mapping length is larger than rlimit for virtual memory. In such case any overlapping mappings are unmapped before we check for the limit and return ENOMEM. The

Re: [PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-02 Thread Mel Gorman
On Tue, Apr 02, 2013 at 11:54:03AM +0200, Cyril Hrubis wrote: > This patch fixes corner case for MAP_FIXED when requested mapping length > is larger than rlimit for virtual memory. In such case any overlapping > mappings are unmapped before we check for the limit and return ENOMEM. > > The check

[PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-02 Thread Cyril Hrubis
This patch fixes corner case for MAP_FIXED when requested mapping length is larger than rlimit for virtual memory. In such case any overlapping mappings are unmapped before we check for the limit and return ENOMEM. The check is moved before the loop that unmaps overlapping parts of existing

[PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-02 Thread Cyril Hrubis
This patch fixes corner case for MAP_FIXED when requested mapping length is larger than rlimit for virtual memory. In such case any overlapping mappings are unmapped before we check for the limit and return ENOMEM. The check is moved before the loop that unmaps overlapping parts of existing

Re: [PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-04-02 Thread Mel Gorman
On Tue, Apr 02, 2013 at 11:54:03AM +0200, Cyril Hrubis wrote: This patch fixes corner case for MAP_FIXED when requested mapping length is larger than rlimit for virtual memory. In such case any overlapping mappings are unmapped before we check for the limit and return ENOMEM. The check is

[PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-03-25 Thread Cyril Hrubis
This patch fixes corner case for MAP_FIXED when requested mapping length is larger than rlimit for virtual memory. In such case any overlapping mappings are unmapped before we check for the limit and return ENOMEM. The check is moved before the loop that unmaps overlapping parts of existing

[PATCH] mm/mmap: Check for RLIMIT_AS before unmapping

2013-03-25 Thread Cyril Hrubis
This patch fixes corner case for MAP_FIXED when requested mapping length is larger than rlimit for virtual memory. In such case any overlapping mappings are unmapped before we check for the limit and return ENOMEM. The check is moved before the loop that unmaps overlapping parts of existing