Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 5 Apr 2001 03:59:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 5 Apr 2001 03:59:09 -0400 Received: from out2.prserv.net ([32.97.166.32]:54495 "EHLO prserv.net") by vger.kernel.org with ESMTP id ; Thu, 5 Apr 2001 03:58:57 -0400 Message-Id: From: Rusty Russell To: nigel@nrg.org Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH for 2.5] preemptible kernel In-Reply-To: Your message of "Sun, 01 Apr 2001 14:07:42 MST." Date: Thu, 05 Apr 2001 03:51:11 +1000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org In message you write : > > Setting a running task's flags brings races, AFAICT, and checking > > p->state is NOT sufficient, consider wait_event(): you need p->has_cpu > > here I think. > > My thought here was that if p->state is anything other than TASK_RUNNING > or TASK_RUNNING|TASK_PREEMPTED, then that task is already at a > synchonize point, Right. Theoretically possible to set p->state and not sleep, but it's not a bad assumption. > > schedule(): > > if (!(prev->state & TASK_PREEMPTED) && prev->syncing) > > if (--sync_count == 0) wake_up(&syncing_task); > > Don't forget to reset prev->syncing. Right. > I agree with you about wait queues, but didn't use them here because > of the problem of avoiding deadlock on the runqueue lock, which the > wait queues also use. And right again. Yeah, it has to be done manually. Ack, can I retract that Email? Rusty. -- Premature optmztion is rt of all evl. --DK - 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/