linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ying Han <yinghan@google.com>
To: David Rientjes <rientjes@google.com>
Cc: linux-mm@kvack.org, akpm <akpm@linux-foundation.org>,
	Paul Menage <menage@google.com>,
	Rohit Seth <rohitseth@google.com>
Subject: Re: [PATCH][V2] Make get_user_pages interruptible
Date: Fri, 21 Nov 2008 16:43:00 -0800	[thread overview]
Message-ID: <604427e00811211643w52d77197nc0d4e5e711d68933@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0811211618160.20523@chino.kir.corp.google.com>

On Fri, Nov 21, 2008 at 4:21 PM, David Rientjes <rientjes@google.com> wrote:
> On Fri, 21 Nov 2008, Ying Han wrote:
>
>> Signed-off-by:        Paul Menage <menage@google.com>
>>                     Ying Han <yinghan@google.com>
>>
>
> That should be:
>
> Signed-off-by: Paul Menage <menage@google.com>
> Signed-off-by: Ying Han <yinghan@google.com>
>
> and the first signed-off line is usually indicative of who wrote the
> original change.  If Paul wrote this code, please add:
>
> From: Paul Menage <menage@google.com>
>
> as the first line of the email so that the proper authorship gets
> attributed in the commit.
thanks for your info. fixed.
>
>> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> index b483f39..f9c6a8a 100644
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -1790,6 +1790,7 @@ extern void sched_dead(struct task_struct *p);
>>  extern int in_group_p(gid_t);
>>  extern int in_egroup_p(gid_t);
>>
>> +extern int sigkill_pending(struct task_struct *tsk);
>>  extern void proc_caches_init(void);
>>  extern void flush_signals(struct task_struct *);
>>  extern void ignore_signals(struct task_struct *);
>
> Interesting way around your email client's line truncation.
>
>> diff --git a/mm/memory.c b/mm/memory.c
>> index 164951c..5d3db5e 100644
>> --- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -1218,12 +1218,11 @@ int __get_user_pages(struct task_struct *tsk, struct m
>>                       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 (sigkill_pending(current))
>> +                             return i ? i : -ERESTARTSYS;
>>
>>                       if (write)
>>                               foll_flags |= FOLL_WRITE;
>>
>
> We previously tested tsk for TIF_MEMDIE and not current (in fact, nothing
> in __get_user_pages() operates on current).  So why are we introducing
> this check on current and not tsk?
   Initially, the patch is merely to cause a process stuck in mlock to
honour a pending sigkill. And in mlock case, tsk==current.

>
> Do we want to avoid branch prediction now because there's data suggesting
> tsk will be SIGKILL'd more frequently in this path other than by the oom
> killer?
>
any specific example?

--
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-22  0:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22  0:05 Ying Han
2008-11-22  0:21 ` David Rientjes
2008-11-22  0:43   ` Ying Han [this message]
2008-11-22  0:50     ` David Rientjes
2008-11-22  2:18   ` Paul Menage
2008-11-22 20:07     ` David Rientjes
2008-11-24 17:38       ` Ying Han
2008-11-24 19:15         ` Hugh Dickins
2008-11-24 19:24           ` Andrew Morton
2008-11-24 19:38           ` Hugh Dickins
2008-11-24 20:28             ` Benjamin LaHaise
2008-11-24 20:38               ` Benjamin LaHaise
2008-11-24 20:46               ` Randy Dunlap
2008-11-24 21:04                 ` Benjamin LaHaise
2008-11-24 21:33                   ` Hugh Dickins

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=604427e00811211643w52d77197nc0d4e5e711d68933@mail.gmail.com \
    --to=yinghan@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=menage@google.com \
    --cc=rientjes@google.com \
    --cc=rohitseth@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