lkml.org 
[lkml]   [2004]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/4] copyfile: generic_sendpage
From
Date

> On Sat, 4 September 2004 15:39:02 -0700, Andrew Morton wrote:
> >
> > I discussed file->file sendfile with Linus a while back and he said
> >
> > > We should probably make read/write be interruptible by _fatal_ signals.
> > > It would require a new task state, though (TASK_KILLABLE or something, and
> > > it would show up as a normal 'D' state).

But a function can be called from many places... how will it know which
of TASK_{INTERRUPTIBLE,UNINTERRUPTIBLE,KILLABLE} to use? It's bad enough
already, with functions which are _sometimes_ called from an
uninterruptible call path using TASK_UNINTERRUPTIBLE even when they are
called from a different call path which _could_ handle being
interrupted.

I wonder if we should handle interruptibility (and killability) in the
same was as we handle preemptability -- that is, keep a count in the
task structure. Increase it by one when you can't be
{interrupted,killed,preempted} and it gets observed by all the functions
you call until the count is decremented all the way to zero.

So upon signal delivery you look at task->uninterruptible_count and
queue the signal if it's non-zero. Or if it's a fatal signal you look at
task->unkillable_count.

--
dwmw2

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.059 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site