Merge tag 'v3.10.65' into update
This is the 3.10.65 stable release
This commit is contained in:
+2
-2
@@ -3235,7 +3235,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo
|
||||
if (prev && prev->vm_end == address)
|
||||
return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;
|
||||
|
||||
expand_downwards(vma, address - PAGE_SIZE);
|
||||
return expand_downwards(vma, address - PAGE_SIZE);
|
||||
}
|
||||
if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {
|
||||
struct vm_area_struct *next = vma->vm_next;
|
||||
@@ -3244,7 +3244,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo
|
||||
if (next && next->vm_start == address + PAGE_SIZE)
|
||||
return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;
|
||||
|
||||
expand_upwards(vma, address + PAGE_SIZE);
|
||||
return expand_upwards(vma, address + PAGE_SIZE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2063,14 +2063,17 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
|
||||
{
|
||||
struct mm_struct *mm = vma->vm_mm;
|
||||
struct rlimit *rlim = current->signal->rlim;
|
||||
unsigned long new_start;
|
||||
unsigned long new_start, actual_size;
|
||||
|
||||
/* address space limit tests */
|
||||
if (!may_expand_vm(mm, grow))
|
||||
return -ENOMEM;
|
||||
|
||||
/* Stack limit test */
|
||||
if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
|
||||
actual_size = size;
|
||||
if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN)))
|
||||
actual_size -= PAGE_SIZE;
|
||||
if (actual_size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
|
||||
return -ENOMEM;
|
||||
|
||||
/* mlock limit tests */
|
||||
|
||||
+13
-11
@@ -2784,18 +2784,20 @@ static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, long remaining,
|
||||
return false;
|
||||
|
||||
/*
|
||||
* There is a potential race between when kswapd checks its watermarks
|
||||
* and a process gets throttled. There is also a potential race if
|
||||
* processes get throttled, kswapd wakes, a large process exits therby
|
||||
* balancing the zones that causes kswapd to miss a wakeup. If kswapd
|
||||
* is going to sleep, no process should be sleeping on pfmemalloc_wait
|
||||
* so wake them now if necessary. If necessary, processes will wake
|
||||
* kswapd and get throttled again
|
||||
* The throttled processes are normally woken up in balance_pgdat() as
|
||||
* soon as pfmemalloc_watermark_ok() is true. But there is a potential
|
||||
* race between when kswapd checks the watermarks and a process gets
|
||||
* throttled. There is also a potential race if processes get
|
||||
* throttled, kswapd wakes, a large process exits thereby balancing the
|
||||
* zones, which causes kswapd to exit balance_pgdat() before reaching
|
||||
* the wake up checks. If kswapd is going to sleep, no process should
|
||||
* be sleeping on pfmemalloc_wait, so wake them now if necessary. If
|
||||
* the wake up is premature, processes will wake kswapd and get
|
||||
* throttled again. The difference from wake ups in balance_pgdat() is
|
||||
* that here we are under prepare_to_wait().
|
||||
*/
|
||||
if (waitqueue_active(&pgdat->pfmemalloc_wait)) {
|
||||
wake_up(&pgdat->pfmemalloc_wait);
|
||||
return false;
|
||||
}
|
||||
if (waitqueue_active(&pgdat->pfmemalloc_wait))
|
||||
wake_up_all(&pgdat->pfmemalloc_wait);
|
||||
|
||||
return pgdat_balanced(pgdat, order, classzone_idx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user