On Sun, Apr 22, 2007 at 09:40:59PM +0200, Rafael J. Wysocki wrote:I'm trying hard to convince myself that this will work. May be I am missing something here, but I find a potential race window (very small though) when k is entering the refrigerator. Here's how. kthread_stop(k) k->refrigerator() --------------------------------------------------------------------- task_lock(k); 1) check_if_exempted(); /* not exempted. So * we will freeze * ourself. */ 2) freezer_exempt(k); 3) if(frozen(k)) /* No, we're not yet frozen. So we * don't clear_frozen_flag(k) here */ 4) frozen_process(k); task_unlock(k); 5) for(;;) { set_current_state(UNINTERRUPTIBLE); if(!frozen_process(k)) /* k is frozen. We * don't break :( */ schedule(); } Thus the freezer can still fail, no? IMO, we need the to take the task_lock for k here. Something like task_lock(k); task_unlock(k); Thanks and Regards gautham. -- Gautham R Shenoy Linux Technology Center IBM India. "Freedom comes with a price tag of responsibility, which is still a bargain, because Freedom is priceless!" -
| H. Peter Anvin | Re: [rft] s2ram wakeup moves to .c, could fix few machines |
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Ingo Molnar | [patch] PID namespace design bug, workaround |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Eric Dumazet | Re: Multicast packet loss |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
