Messages in this thread | | | Date | Tue, 19 Mar 2002 15:29:59 +0000 | From | Pavel Machek <> | Subject | Re: [PATCH] multithreaded coredumps for elf exeecutables |
| |
Hi!
> - Other threads are prevented from executing while core dump is in > progress to improve the accuracy of the dumps. This is done without > changing the state of the task. We set cpus_allowed in task struct > to be 0 to stop a task from being scheduled and reset it to -1 for > resume execution. This has the advantage to not depending on user > space at all for correct functioning. IMO sending SIGSTOP to stop > other threads does not work if the process is being run under a > debugger. The only possible issue with using cpus_allowed is that
In swsusp patch, I had exactly the same problem. I created refrigerator(), and halfway send a signal....
> +/* > + * Suspend execution of other threads belonging to the same multithreaded process > + * of current, ASAP. > + * > + * Sets the current->cpu_mask to the current cpu to avoid cpu migration durring the dump. > + * This cpu will also be the only cpu the other threads will be allowed to run after > + * coredump is completed. This seems to be needed to fix some SMP races. This still > + * needs some more thought though this solution works.
What about
app has 5 threads. 1st dumps core, and starts setting cpus_allowed mask to thread 2. Meanwhile 3nd thread resets the mask back.
Pavel?
-- Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt, details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |