Re: [PATCH 2/4] Task notifier: Implement todo list in task_struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

On Tue, 2005-08-09 at 12:01, Christoph Lameter wrote:
> On Tue, 9 Aug 2005, Nigel Cunningham wrote:
> 
> > Just to let you know that I have it working with Suspend2. One thing I
> > am concerned about is that we still need a way of determining whether a
> > process has been signalled but not yet frozen. At the moment you just
> > check p->todo, but if/when other functionality begins to use the todo
> > list, this will be unreliable.
> > 
> 
> No it wont. A process that has notifications to process should do that 
> before being put into the freezer. Only after the notification list is 
> empty will the process be notified and as long as the notification is 
> pending no second notification should happen.

Sorry I wasn't clear. I was thinking of the case where a broken process
doesn't process its todo list. (May it never be, but still...). How do
we find out which one is broken? We need to traverse the todo list of
every process, checking for outstanding freeze requests.

Your reply leads me to another issue. It seems to me that you shouldn't
wait until the todo list is empty before putting the freeze request on
the todo list. If the todo list is ever used for something where it
becomes hot, you might never see the todo list empty before your
timeout, and freezing will be unreliable. Even if you do see it empty
and insert your freeze request, it might be that more work is added
afterwards, so you may as well just add the request whether or not the
queue is empty.

Of course if you address this, you then have the problem that the
calling routine hammers on routines until they enter the fridge, you can
end up with multiple freeze requests per process. That could be
addressed by splitting it into two loops - the first adds the todo work
for each thread to be frozen, and the second wakes them until they
process the notification. I reckon that we shouldn't need to wake them
repeatedly like this, but I've never taken the time to see why a process
could need multiple wakeups. (I believe it's not bogus).

> > I'm happy to supply the patches I'm using if you want to compare. (I
> > retained the other freezer improvements, so it wouldn't just be bug
> > fixes against your patches).
> 
> I am not sure how to sort that out. I guess post the current patches that 
> you got and then we see how to continue from there.

Will do shortly. Just have to go talk to my boss first :> (Separate
issue).

Nigel
-- 
Evolution.
Enumerate the requirements.
Consider the interdependencies.
Calculate the probabilities.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux