Re: [RFC][PATCH] Avoid race w/ posix-cpu-timer and exiting tasks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/13, john stultz wrote:
>
> The tsk->signal check from the patch above looks like it would avoid
> this as well. Is there a specific benefit to checking that over
> exit_state?

->exit_state is protected by tasklist_lock, and it would be nice to
avoid it in run_posix_cpu_timers(). (I guess we could remove it right
now, but I forgot the code). Yes, currently it doesn't matter because
tsk == current.

Personally I dislike the testing of ->exit_state != 0 because unlike
PF_EXITING or ->sighand/->signal it is changed from 0 to 1 in the middle
of do_exit() path. Imho it should be used only by do_exit/do_wait path,
but maybe this is just me.

Btw, I think there is another problem,

	check_process_timers:

			t = tsk;
			do {

				...
				
				do {
					t = next_thread(t);
				} while (unlikely(t->flags & PF_EXITING));
			} while (t != tsk);


This can hang if the local timer interrupt happens right after do_exit()
sets PF_EXITING ?

Oleg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux