public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ying Han <yinghan@google.com>
Cc: oleg@redhat.com, menage@google.com, penberg@cs.helsinki.fi,
	nickpiggin@yahoo.com.au, hugh@veritas.com, matthew@wil.cx,
	rientjes@google.com, linux-kernel@vger.kernel.org
Subject: Re: + make-get_user_pages-interruptible.patch added to -mm tree
Date: Mon, 1 Dec 2008 15:09:47 -0800	[thread overview]
Message-ID: <20081201150947.85e25789.akpm@linux-foundation.org> (raw)
In-Reply-To: <604427e00812011500j48ae17d8w4f6f47eba7493af8@mail.gmail.com>

On Mon, 1 Dec 2008 15:00:14 -0800
Ying Han <yinghan@google.com> wrote:

> On Thu, Nov 27, 2008 at 12:04 PM, Oleg Nesterov <oleg@redhat.com> wrote:
> > 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.
> >

(top-posting repaired..)

> Thanks Oleg, i looked at the code again and this is a reasonable
> change. I will make the change on the patch.
> Andrew,
>     should i make a patch based on current change or make the same
> patch as [V6]?

I don't mind either way.  I guess a fresh new patch would simplify
review for everyone.

Note that fatal_signal_pending() is not an exact replacement for
sigkill_pending() - fatal_signal_pending() doesn't test the shared
pending signals.



  reply	other threads:[~2008-12-01 23:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2008-12-01 23:17     ` Ying Han
2008-12-02 13:26       ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081201150947.85e25789.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=menage@google.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=oleg@redhat.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=rientjes@google.com \
    --cc=yinghan@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox