Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1495235

Re: [PATCH] coredump: fix unfreezable coredumping task

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] coredump: fix unfreezable coredumping task
Date 2016-10-04 09:20 +0200
Message-ID <sosb8-7QV-3@gated-at.bofh.it> (permalink)
References <sn5qh-1QC-5@gated-at.bofh.it> <sn5qh-1QC-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 30-09-16 14:47:41, Oleg Nesterov wrote:
> On 09/30, Andrey Ryabinin wrote:
> >
> > @@ -423,7 +424,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
> >  	if (core_waiters > 0) {
> >  		struct core_thread *ptr;
> >  
> > +		freezer_do_not_count();
> >  		wait_for_completion(&core_state->startup);
> > +		freezer_count();
> 
> Agreed... we could probably even do
> 
> 	--- x/fs/coredump.c
> 	+++ x/fs/coredump.c
> 	@@ -423,7 +423,13 @@ static int coredump_wait(int exit_code, 
> 		if (core_waiters > 0) {
> 			struct core_thread *ptr;
> 	 
> 	-		wait_for_completion(&core_state->startup);
> 	+		if (wait_for_completion_interruptible(&core_state->startup)) {
> 	+			/* see the comment in dump_interrupted() */
> 	+			down_write(&mm->mmap_sem);
> 	+			coredump_finish(mm, false);
> 	+			up_write(&mm->mmap_sem);
> 	+			return -EINTR;
> 	+		}
> 			/*
> 			 * Wait for all the threads to become inactive, so that
> 			 * all the thread context (extended register state, like

This looks like a very good idea to me. We really want to make the whole
coredump_wait killable. I guess this should help us to remove the
hackish sig->flags & SIGNAL_GROUP_COREDUMP check from
__task_will_free_mem. Or are there any other problems that would make
oom victims in the middle of coredump problematic?
-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] coredump: fix unfreezable coredumping task Oleg Nesterov <oleg@redhat.com> - 2016-09-30 14:50 +0200
  Re: [PATCH] coredump: fix unfreezable coredumping task Michal Hocko <mhocko@kernel.org> - 2016-10-04 09:20 +0200
    Re: [PATCH] coredump: fix unfreezable coredumping task Oleg Nesterov <oleg@redhat.com> - 2016-10-04 18:20 +0200
      Re: [PATCH] coredump: fix unfreezable coredumping task Michal Hocko <mhocko@kernel.org> - 2016-10-05 11:20 +0200

csiph-web