On Wed, 2008-04-02 at 14:42 -0700, Frank Mayhar wrote:Okay, having run face-first into this race and having every combination of spinlock serialization fail for me, I've done a variation of the above scheme. For the local environment, I solved the problem by moving the percpu structure out of the signal structure entirely and by making it refcounted. It is allocated as before, but now in two parts, a normal structure with an atomic refcount that has a pointer to the percpu structure. The signal structure doesn't point to it any longer, but each task_struct in the thread group does, and each of these references is counted. New threads will also get a reference (at the top of copy_signal()) and be counted. All access goes through the task structure. References are removed in __put_task_struct() when the task itself is destroyed; when the last reference goes away, the structures are freed. This eliminates the races with signal_struct being freed and has the nice effect that there is a bit less overhead in places like account_group_user_time() and friends. In run_posix_cpu_timers(), though, I have to pick up the tasklist_lock early (and therefore in every case) because it's still dereferencing tsk->signal in the early comparison. I'm thinking about moving all of the itimer stuff (i.e. the cputime_expires structures) into the refcounted structure as well, thus avoiding the signal_struct entirely so we don't need the tasklist_lock in the fast path. I don't know how any of this will affect the UP case, though. I'll have to continue to think about it and I'm sure you have something to say as well. (And if anyone else wants to chime in, they're welcome.) -- Frank Mayhar <fmayhar@google.com> Google, Inc. --
| Joe Perches | [PATCH 011/148] include/asm-x86/bug.h: checkpatch cleanups - formatting only |
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 006/196] Chinese: add translation of oops-tracing.txt |
git: | |
| Aaron Bentley | Re: VCS comparison table |
| Kevin Ballard | Re: git on MacOSX and files with decomposed utf-8 file names |
| Dmitry Potapov | Re: I'm a total push-over.. |
| Junio C Hamano | Re: Implementing branch attributes in git config |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| rancor | How to copy/pipe console buffert to file? |
| Richard Stallman | Re: Real men don't attack straw men |
| Felix Radensky | RE: e1000e "Detected Tx Unit Hang" |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
| Jay Vosburgh | [PATCH 0/9]: bonding support for IPoIB |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
