From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH v5 1/2] kernel/signal: Signal-based pre-coredump notification Date: Thu, 6 Dec 2018 18:29:32 +0100 Message-ID: <20181206172931.GA12967@redhat.com> References: <7741efa7-a3f8-62a1-ba52-613883164643@cisco.com> <84460a77-a111-404e-4bad-88104a6e246e@cisco.com> <20181026082812.GA10581@redhat.com> <21f678a8-4001-df36-c26e-e96cf203b1b1@cisco.com> <20181029111804.GA24820@redhat.com> <0c197608-3b7e-ffd1-8943-801a60beb917@cisco.com> <80e96710-f424-9b39-72ee-9cc7cbe7a5f7@cisco.com> <20181128151911.GN3505@e103592.cambridge.arm.com> <20181204143759.fe24ee036a33000193339561@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20181204143759.fe24ee036a33000193339561@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org To: Andrew Morton Cc: Enke Chen , Dave Martin , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Peter Zijlstra , Arnd Bergmann , "Eric W. Biederman" , Khalid Aziz , Kate Stewart , Helge Deller , Greg Kroah-Hartman , Al Viro , Christian Brauner , Catalin Marinas , Will Deacon , Mauro Carvalho Chehab , Michal Hocko , Rik van Riel List-Id: linux-arch.vger.kernel.org On 12/04, Andrew Morton wrote: > > I'm not sure what to make of this patchset, really. Oleg sounds > unhappy and that's always a bad sign. And signals are rather ugly > things. Oleg, can you please expand on your concerns? I don't really know what can I say... Yes the signals are ugly things, this is one reason. Worse, you need to use real-time predump_signal if parent has 2 or more children. And when it comes to child-parent notifications we already have do_wait(). So probably it would be better to implement WCOREDUMP so that the parent could rely on SIGCHLD + waitpid(WCOREDUMP). Not that I think this is a good idea and this is much more complex especially if we want to report this event to ptracer too, while this patch is very simple. In fact I think that we need something more generic, but I can't suggest any good idea :/ May be we could simply add a tracepoint or perf_event_coredump, I dunno. Sure, the usage of perf events is not that simple... Oleg. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:37302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbeLFR3l (ORCPT ); Thu, 6 Dec 2018 12:29:41 -0500 Date: Thu, 6 Dec 2018 18:29:32 +0100 From: Oleg Nesterov Subject: Re: [PATCH v5 1/2] kernel/signal: Signal-based pre-coredump notification Message-ID: <20181206172931.GA12967@redhat.com> References: <7741efa7-a3f8-62a1-ba52-613883164643@cisco.com> <84460a77-a111-404e-4bad-88104a6e246e@cisco.com> <20181026082812.GA10581@redhat.com> <21f678a8-4001-df36-c26e-e96cf203b1b1@cisco.com> <20181029111804.GA24820@redhat.com> <0c197608-3b7e-ffd1-8943-801a60beb917@cisco.com> <80e96710-f424-9b39-72ee-9cc7cbe7a5f7@cisco.com> <20181128151911.GN3505@e103592.cambridge.arm.com> <20181204143759.fe24ee036a33000193339561@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204143759.fe24ee036a33000193339561@linux-foundation.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andrew Morton Cc: Enke Chen , Dave Martin , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Peter Zijlstra , Arnd Bergmann , "Eric W. Biederman" , Khalid Aziz , Kate Stewart , Helge Deller , Greg Kroah-Hartman , Al Viro , Christian Brauner , Catalin Marinas , Will Deacon , Mauro Carvalho Chehab , Michal Hocko , Rik van Riel , "Kirill A. Shutemov" , Roman Gushchin , Marcos Paulo de Souza , Dominik Brodowski , Cyrill Gorcunov , Yang Shi , Jann Horn , Kees Cook , "linux-kernel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "Victor Kamensky (kamensky)" , "xe-linux-external@cisco.com" , Stefan Strogin Message-ID: <20181206172932.nZ-5gZ0WZSM6jcD26R4aTfTtJV9nh99m9J3sPs3276k@z> On 12/04, Andrew Morton wrote: > > I'm not sure what to make of this patchset, really. Oleg sounds > unhappy and that's always a bad sign. And signals are rather ugly > things. Oleg, can you please expand on your concerns? I don't really know what can I say... Yes the signals are ugly things, this is one reason. Worse, you need to use real-time predump_signal if parent has 2 or more children. And when it comes to child-parent notifications we already have do_wait(). So probably it would be better to implement WCOREDUMP so that the parent could rely on SIGCHLD + waitpid(WCOREDUMP). Not that I think this is a good idea and this is much more complex especially if we want to report this event to ptracer too, while this patch is very simple. In fact I think that we need something more generic, but I can't suggest any good idea :/ May be we could simply add a tracepoint or perf_event_coredump, I dunno. Sure, the usage of perf events is not that simple... Oleg.