From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754166AbcB2Q2s (ORCPT ); Mon, 29 Feb 2016 11:28:48 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33851 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753054AbcB2Q2n (ORCPT ); Mon, 29 Feb 2016 11:28:43 -0500 Date: Mon, 29 Feb 2016 17:28:40 +0100 From: Michal Hocko To: Oleg Nesterov Cc: LKML , Andrew Morton , linux-mm@kvack.org, Alex Deucher , Alex Thorlton , Andrea Arcangeli , Andy Lutomirski , Benjamin LaHaise , Christian =?iso-8859-1?Q?K=F6nig?= , Daniel Vetter , Dave Hansen , David Airlie , Davidlohr Bueso , David Rientjes , "H . Peter Anvin" , Hugh Dickins , Ingo Molnar , Johannes Weiner , "Kirill A . Shutemov" , Konstantin Khlebnikov , linux-arch@vger.kernel.org, Mel Gorman , Peter Zijlstra , Petr Cermak , Thomas Gleixner Subject: Re: [PATCH 15/18] uprobes: wait for mmap_sem for write killable Message-ID: <20160229162840.GH16930@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-16-git-send-email-mhocko@kernel.org> <20160229155712.GA1964@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160229155712.GA1964@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 29-02-16 16:57:13, Oleg Nesterov wrote: > On 02/29, Michal Hocko wrote: > > > > --- a/kernel/events/uprobes.c > > +++ b/kernel/events/uprobes.c > > @@ -1130,7 +1130,9 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area) > > struct vm_area_struct *vma; > > int ret; > > > > - down_write(&mm->mmap_sem); > > + if (down_write_killable(&mm->mmap_sem)) > > + return -EINTR; > > + > > Yes, but then dup_xol_work() should probably check fatal_signal_pending() to > suppress uprobe_warn(), the warning looks like a kernel problem. Ahh, I see. I didn't understand what is the purpose of the warning. Does the following work for you? --- diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index a79315d0f711..fb4a6bcc88ce 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1470,7 +1470,8 @@ static void dup_xol_work(struct callback_head *work) if (current->flags & PF_EXITING) return; - if (!__create_xol_area(current->utask->dup_xol_addr)) + if (!__create_xol_area(current->utask->dup_xol_addr) && + !fatal_signal_pending(current) uprobe_warn(current, "dup xol area"); } -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH 15/18] uprobes: wait for mmap_sem for write killable Date: Mon, 29 Feb 2016 17:28:40 +0100 Message-ID: <20160229162840.GH16930@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-16-git-send-email-mhocko@kernel.org> <20160229155712.GA1964@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20160229155712.GA1964@redhat.com> Sender: owner-linux-mm@kvack.org To: Oleg Nesterov Cc: LKML , Andrew Morton , linux-mm@kvack.org, Alex Deucher , Alex Thorlton , Andrea Arcangeli , Andy Lutomirski , Benjamin LaHaise , Christian =?iso-8859-1?Q?K=F6nig?= , Daniel Vetter , Dave Hansen , David Airlie , Davidlohr Bueso , David Rientjes , "H . Peter Anvin" , Hugh Dickins , Ingo Molnar , Johannes Weiner , "Kirill A . Shutemov" , Konstantin Khlebnikov , linux-arch@vger.kernel.org, Mel Gorman , Peter Zijlstra List-Id: linux-arch.vger.kernel.org On Mon 29-02-16 16:57:13, Oleg Nesterov wrote: > On 02/29, Michal Hocko wrote: > > > > --- a/kernel/events/uprobes.c > > +++ b/kernel/events/uprobes.c > > @@ -1130,7 +1130,9 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area) > > struct vm_area_struct *vma; > > int ret; > > > > - down_write(&mm->mmap_sem); > > + if (down_write_killable(&mm->mmap_sem)) > > + return -EINTR; > > + > > Yes, but then dup_xol_work() should probably check fatal_signal_pending() to > suppress uprobe_warn(), the warning looks like a kernel problem. Ahh, I see. I didn't understand what is the purpose of the warning. Does the following work for you? --- diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index a79315d0f711..fb4a6bcc88ce 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1470,7 +1470,8 @@ static void dup_xol_work(struct callback_head *work) if (current->flags & PF_EXITING) return; - if (!__create_xol_area(current->utask->dup_xol_addr)) + if (!__create_xol_area(current->utask->dup_xol_addr) && + !fatal_signal_pending(current) uprobe_warn(current, "dup xol area"); } -- Michal Hocko SUSE Labs -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by kanga.kvack.org (Postfix) with ESMTP id 851FB6B0253 for ; Mon, 29 Feb 2016 11:28:43 -0500 (EST) Received: by mail-wm0-f47.google.com with SMTP id p65so76319713wmp.1 for ; Mon, 29 Feb 2016 08:28:43 -0800 (PST) Date: Mon, 29 Feb 2016 17:28:40 +0100 From: Michal Hocko Subject: Re: [PATCH 15/18] uprobes: wait for mmap_sem for write killable Message-ID: <20160229162840.GH16930@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-16-git-send-email-mhocko@kernel.org> <20160229155712.GA1964@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160229155712.GA1964@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: Oleg Nesterov Cc: LKML , Andrew Morton , linux-mm@kvack.org, Alex Deucher , Alex Thorlton , Andrea Arcangeli , Andy Lutomirski , Benjamin LaHaise , Christian =?iso-8859-1?Q?K=F6nig?= , Daniel Vetter , Dave Hansen , David Airlie , Davidlohr Bueso , David Rientjes , "H . Peter Anvin" , Hugh Dickins , Ingo Molnar , Johannes Weiner , "Kirill A . Shutemov" , Konstantin Khlebnikov , linux-arch@vger.kernel.org, Mel Gorman , Peter Zijlstra , Petr Cermak , Thomas Gleixner On Mon 29-02-16 16:57:13, Oleg Nesterov wrote: > On 02/29, Michal Hocko wrote: > > > > --- a/kernel/events/uprobes.c > > +++ b/kernel/events/uprobes.c > > @@ -1130,7 +1130,9 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area) > > struct vm_area_struct *vma; > > int ret; > > > > - down_write(&mm->mmap_sem); > > + if (down_write_killable(&mm->mmap_sem)) > > + return -EINTR; > > + > > Yes, but then dup_xol_work() should probably check fatal_signal_pending() to > suppress uprobe_warn(), the warning looks like a kernel problem. Ahh, I see. I didn't understand what is the purpose of the warning. Does the following work for you? --- diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index a79315d0f711..fb4a6bcc88ce 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1470,7 +1470,8 @@ static void dup_xol_work(struct callback_head *work) if (current->flags & PF_EXITING) return; - if (!__create_xol_area(current->utask->dup_xol_addr)) + if (!__create_xol_area(current->utask->dup_xol_addr) && + !fatal_signal_pending(current) uprobe_warn(current, "dup xol area"); } -- Michal Hocko SUSE Labs -- 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: email@kvack.org