lkml.org 
[lkml]   [2008]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + make-get_user_pages-interruptible.patch added to -mm tree
Ying Han wrote:
>
> -static int sigkill_pending(struct task_struct *tsk)
> +int sigkill_pending(struct task_struct *tsk)
> {
> return sigismember(&tsk->pending.signal, SIGKILL) ||
> sigismember(&tsk->signal->shared_pending.signal, SIGKILL);
> diff -puN mm/memory.c~make-get_user_pages-interruptible mm/memory.c
> --- a/mm/memory.c~make-get_user_pages-interruptible
> +++ a/mm/memory.c
> @@ -1219,12 +1219,12 @@ int __get_user_pages(struct task_struct
> struct page *page;
>
> /*
> - * If tsk is ooming, cut off its access to large memory
> - * allocations. It has a pending SIGKILL, but it can't
> - * be processed until returning to user space.
> + * If we have a pending SIGKILL, don't keep
> + * allocating memory.
> */
> - if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE)))
> - return i ? i : -ENOMEM;
> + if (unlikely(sigkill_pending(current) ||
> + sigkill_pending(tsk)))

Please do not export/use sigkill_pending(). It is "private" for ptrace_stop()
(and actually should die imho).

We have fatal_signal_pending() for that.

Oleg.



\
 
 \ /
  Last update: 2008-11-27 21:09    [W:0.064 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site