public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: + make-get_user_pages-interruptible.patch added to -mm tree
@ 2008-11-27 20:04 Oleg Nesterov
  2008-12-01 23:00 ` Ying Han
  0 siblings, 1 reply; 5+ messages in thread
From: Oleg Nesterov @ 2008-11-27 20:04 UTC (permalink / raw)
  To: Ying Han
  Cc: Paul Menage, Ying Han, Pekka Enberg, Nick Piggin, Hugh Dickins,
	Matthew Wilcox, David Rientjes, Andrew Morton, linux-kernel

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-02 13:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-27 20:04 + make-get_user_pages-interruptible.patch added to -mm tree Oleg Nesterov
2008-12-01 23:00 ` Ying Han
2008-12-01 23:09   ` Andrew Morton
2008-12-01 23:17     ` Ying Han
2008-12-02 13:26       ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox