On 6/17/09, GoatZilla <goatzilla@xxxxxxxxx> wrote: > Can someone explain what the normal path for freeing a task's task_struct > resources after it's finished? I'm working on a 2.6.26.6 kernel which > doesn't seem to free these resources after a task is finished. > > Apparently, release_task() is called which at least sets up most of the > work. The actual freeing of the task is left to delayed_put_task_struct, > which is registerd as an RCU callback. > > I set a breakpoint at delayed_put_task_struct, and it never gets hit. > > Where exactly is the callback is actually supposed to be invoked in the > kernel. Is it somewhere in or near the scheduler or switch code? IMHO, after not being used, task_struct is just marked as "free" and put it back to slab, as you can by typing: $ cat /proc/slabinfo | grep task_struct so, in other word, it's really only free-ed if there is high memory pressure and forcing the kernel VM to release some of slab cache. CMIIW people... regards, Mulyadi. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ