Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753296AbYLAXRV (ORCPT ); Mon, 1 Dec 2008 18:17:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751042AbYLAXRM (ORCPT ); Mon, 1 Dec 2008 18:17:12 -0500 Received: from smtp-out.google.com ([216.239.45.13]:17500 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbYLAXRL (ORCPT ); Mon, 1 Dec 2008 18:17:11 -0500 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding; b=JP5CanxC67uGDNjXpFRpmzJLIeb1GRrMhMDPMv7F21eZ9AYZO+s9qJOZoTne342r8 lVZZR7vd+ALgqg/vsFyNw== MIME-Version: 1.0 In-Reply-To: <20081201150947.85e25789.akpm@linux-foundation.org> References: <20081127200459.GA25799@redhat.com> <604427e00812011500j48ae17d8w4f6f47eba7493af8@mail.gmail.com> <20081201150947.85e25789.akpm@linux-foundation.org> Date: Mon, 1 Dec 2008 15:17:07 -0800 Message-ID: <604427e00812011517tbf5685fr7263225aaa3adb3f@mail.gmail.com> Subject: Re: + make-get_user_pages-interruptible.patch added to -mm tree From: Ying Han To: Andrew Morton 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 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2718 Lines: 71 thanks Andrew. On Mon, Dec 1, 2008 at 3:09 PM, Andrew Morton wrote: > On Mon, 1 Dec 2008 15:00:14 -0800 > Ying Han wrote: > >> On Thu, Nov 27, 2008 at 12:04 PM, Oleg Nesterov 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. > yeah, i noticed that and that is why i used the sigkill_pending initially. But after a deeper look at the signal code, i found for SIGKILL ( signal we care about in this patch ), tsk->pending is a superset of tsk->signal->shared_pending. --Ying > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/