From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752966AbcCKMq0 (ORCPT ); Fri, 11 Mar 2016 07:46:26 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36067 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752744AbcCKMqQ (ORCPT ); Fri, 11 Mar 2016 07:46:16 -0500 Date: Fri, 11 Mar 2016 13:46:13 +0100 From: Michal Hocko To: Vlastimil Babka 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 , Oleg Nesterov , Peter Zijlstra , Petr Cermak , Thomas Gleixner Subject: Re: [PATCH 11/18] coredump: make coredump_wait wait for mma_sem for write killable Message-ID: <20160311124613.GL27701@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-12-git-send-email-mhocko@kernel.org> <56E2ACE7.50008@suse.cz> <56E2B1E9.90201@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E2B1E9.90201@suse.cz> 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 Fri 11-03-16 12:54:17, Vlastimil Babka wrote: > On 03/11/2016 12:32 PM, Vlastimil Babka wrote: > >On 02/29/2016 02:26 PM, Michal Hocko wrote: > >>From: Michal Hocko > >> > >>coredump_wait waits for mmap_sem for write currently which can > >>prevent oom_reaper to reclaim the oom victims address space > >>asynchronously because that requires mmap_sem for read. This might > >>happen if the oom victim is multi threaded and some thread(s) is > >>holding mmap_sem for read (e.g. page fault) and it is stuck in > >>the page allocator while other thread(s) reached coredump_wait > >>already. > >> > >>This patch simply uses down_write_killable and bails out with EINTR > >>if the lock got interrupted by the fatal signal. do_coredump will > >>return right away and do_group_exit will take care to zap the whole > >>thread group. > >> > >>Cc: Oleg Nesterov > >>Signed-off-by: Michal Hocko > > > >Acked-by: Vlastimil Babka > > Forgot to point out typo in Subject which makes it hard to grep for mmap_sem Fixed and thanks! -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH 11/18] coredump: make coredump_wait wait for mma_sem for write killable Date: Fri, 11 Mar 2016 13:46:13 +0100 Message-ID: <20160311124613.GL27701@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-12-git-send-email-mhocko@kernel.org> <56E2ACE7.50008@suse.cz> <56E2B1E9.90201@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:36067 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752744AbcCKMqQ (ORCPT ); Fri, 11 Mar 2016 07:46:16 -0500 Content-Disposition: inline In-Reply-To: <56E2B1E9.90201@suse.cz> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vlastimil Babka 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 , Oleg Nesterov Pe On Fri 11-03-16 12:54:17, Vlastimil Babka wrote: > On 03/11/2016 12:32 PM, Vlastimil Babka wrote: > >On 02/29/2016 02:26 PM, Michal Hocko wrote: > >>From: Michal Hocko > >> > >>coredump_wait waits for mmap_sem for write currently which can > >>prevent oom_reaper to reclaim the oom victims address space > >>asynchronously because that requires mmap_sem for read. This might > >>happen if the oom victim is multi threaded and some thread(s) is > >>holding mmap_sem for read (e.g. page fault) and it is stuck in > >>the page allocator while other thread(s) reached coredump_wait > >>already. > >> > >>This patch simply uses down_write_killable and bails out with EINTR > >>if the lock got interrupted by the fatal signal. do_coredump will > >>return right away and do_group_exit will take care to zap the whole > >>thread group. > >> > >>Cc: Oleg Nesterov > >>Signed-off-by: Michal Hocko > > > >Acked-by: Vlastimil Babka > > Forgot to point out typo in Subject which makes it hard to grep for mmap_sem Fixed and thanks! -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by kanga.kvack.org (Postfix) with ESMTP id 47F3E6B0005 for ; Fri, 11 Mar 2016 07:46:16 -0500 (EST) Received: by mail-wm0-f48.google.com with SMTP id l68so16166769wml.1 for ; Fri, 11 Mar 2016 04:46:16 -0800 (PST) Date: Fri, 11 Mar 2016 13:46:13 +0100 From: Michal Hocko Subject: Re: [PATCH 11/18] coredump: make coredump_wait wait for mma_sem for write killable Message-ID: <20160311124613.GL27701@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-12-git-send-email-mhocko@kernel.org> <56E2ACE7.50008@suse.cz> <56E2B1E9.90201@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E2B1E9.90201@suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka 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 , Oleg Nesterov , Peter Zijlstra , Petr Cermak , Thomas Gleixner On Fri 11-03-16 12:54:17, Vlastimil Babka wrote: > On 03/11/2016 12:32 PM, Vlastimil Babka wrote: > >On 02/29/2016 02:26 PM, Michal Hocko wrote: > >>From: Michal Hocko > >> > >>coredump_wait waits for mmap_sem for write currently which can > >>prevent oom_reaper to reclaim the oom victims address space > >>asynchronously because that requires mmap_sem for read. This might > >>happen if the oom victim is multi threaded and some thread(s) is > >>holding mmap_sem for read (e.g. page fault) and it is stuck in > >>the page allocator while other thread(s) reached coredump_wait > >>already. > >> > >>This patch simply uses down_write_killable and bails out with EINTR > >>if the lock got interrupted by the fatal signal. do_coredump will > >>return right away and do_group_exit will take care to zap the whole > >>thread group. > >> > >>Cc: Oleg Nesterov > >>Signed-off-by: Michal Hocko > > > >Acked-by: Vlastimil Babka > > Forgot to point out typo in Subject which makes it hard to grep for mmap_sem Fixed and thanks! -- 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