linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: Ying Han <yinghan@google.com>
Cc: Paul Menage <menage@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Rohit Seth <rohitseth@google.com>
Subject: Re: [PATCH][V3]Make get_user_pages interruptible
Date: Mon, 24 Nov 2008 23:13:10 +0200	[thread overview]
Message-ID: <84144f020811241313o7401e3c2gd360c4226f33b28f@mail.gmail.com> (raw)
In-Reply-To: <604427e00811241302t2a52e38etffca2546f319a7af@mail.gmail.com>

On Fri, Nov 21, 2008 at 5:31 PM, Ying Han <yinghan@google.com> wrote:
>>>                         */
>>> -                       if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE)))
>>> -                               return i ? i : -ENOMEM;
>>> +                       if (unlikely(sigkill_pending(tsk)))
>>> +                               return i ? i : -ERESTARTSYS;

On Mon, Nov 24, 2008 at 12:02 PM, Paul Menage <menage@google.com> wrote:
>> You've changed the check from sigkill_pending(current) to sigkill_pending(tsk).
>>
>> I originally made that sigkill_pending(current) since we want to avoid
>> tasks entering an unkillable state just because they're doing
>> get_user_pages() on a system that's short of memory. Admittedly for
>> the main case that we care about, mlock() (or an mmap() with
>> MCL_FUTURE set) then tsk==current, but philosophically it seems to me
>> to be more correct to do the check against current than tsk, since
>> current is the thing that's actually allocating the memory. But maybe
>> it would be better to check both?

On Mon, Nov 24, 2008 at 11:02 PM, Ying Han <yinghan@google.com> wrote:
> In most of cases, tsk==current in get_user_pages(), that is why i
> change current to tsk since
> tsk is a superset of current, no? If that is right, why we need to check both?

I'm not sure if it's strictly necessary but as I pointed out in the
other mail, there can be callers that are doing get_user_pages() on
behalf of other tasks and you probably want to be able to kill the
task that's actually _calling_ get_user_pages() as well.

                        Pekka

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-11-24 21:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22  1:31 Ying Han, Paul Menage
2008-11-24 20:02 ` Paul Menage
2008-11-24 20:55   ` Pekka Enberg
2008-11-24 21:02   ` Ying Han
2008-11-24 21:13     ` Pekka Enberg [this message]
2008-11-24 21:50       ` Ying Han
2008-11-24 22:45         ` Pekka Enberg

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=84144f020811241313o7401e3c2gd360c4226f33b28f@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=menage@google.com \
    --cc=rientjes@google.com \
    --cc=rohitseth@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