mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH 1/4] copyfile: generic_sendpage
Date: Tue, 07 Sep 2004 16:32:46 +0100	[thread overview]
Message-ID: <1094571166.5122.33.camel@localhost.localdomain> (raw)
In-Reply-To: <20040907120908.GB26630@wohnheim.fh-wedel.de>


> 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


      parent reply	other threads:[~2004-09-07 15:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-07 12:09 Jörn Engel
2004-09-07 12:11 ` [PATCH 2/4] copyfile: sendfile Jörn Engel
2004-09-07 12:12   ` [PATCH 3/4] copyfile: sendfile_loop Jörn Engel
2004-09-07 12:15     ` [PATCH 4/4] copyfile: copyfile Jörn Engel
2004-09-07 14:06       ` Linus Torvalds
2004-09-07 14:19         ` Anton Altaparmakov
2004-09-07 14:51         ` Jörn Engel
2004-09-07 14:59           ` Linus Torvalds
2004-09-07 15:21             ` Jörn Engel
2004-09-07 15:28               ` Linus Torvalds
2004-09-09 15:04               ` Herbert Poetzl
2004-09-08 17:09         ` Steve French
2004-09-07 15:32 ` David Woodhouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1094571166.5122.33.camel@localhost.localdomain \
    --to=dwmw2@infradead.org \
    --cc=akpm@osdl.org \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®