mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Roland Dreier <rdreier@cisco.com>
Cc: Oleg Nesterov <oleg@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: Is adding requeue_delayed_work() a good idea
Date: Sat, 22 Aug 2009 12:35:47 +0200	[thread overview]
Message-ID: <4A8FCA03.6090107@s5r6.in-berlin.de> (raw)
In-Reply-To: <adaab1sx29p.fsf@cisco.com>

Roland Dreier wrote:
[Oleg Nesterov wrote]
> Perhaps the semantics are sufficiently fuzzy and not general enough, so
> that the best answer is my special-case open coded change for my
> specific case.  I don't know whether other places would even want a
> requeue_delayed_work() ... I simply raise this point because when I find
> myself reimplementing the structure of work_struct + timer because
> delayed_work API is lacking, then it seems prudent to consider extending
> delayed_work API instead.

There are two or three use cases of rescheduling a delayed work in 
drivers/firewire, but in one regard they are simpler than your case:

The work only needs to be pushed back in time, never scheduled earlier 
than it was originally scheduled.  This is easily implemented with the 
existing delayed work API by letting the work check whether it is 
entered too early; if yes, reschedule itself.

Further requirements of this use case:
   - It doesn't matter on which CPU this kind of work runs on.
   - If the event which necessitates rescheduling happens when the
     work is already running, then it might depend on the outcome of
     the work whether it needs to be scheduled again.  I think the
     requeue_delayed_work should do nothing in that case and the
     work needs to test how it went and rearm if necessary.

Well, considering the latter point, there is no harm in keeping all of 
the requeue_delayed_work logic concentrated in the work itself in these 
FireWire use cases.

[These use cases are high-level protocols for resource acquisition over 
the FireWire bus.  Cooperative fairness schemes require them to be timed 
after a grace period for resource re-acquisition by holders of older 
resources, following after bus reset events which may happen any time.]

So, the question is whether there is any user besides IB which needs to 
pull a delayed work forward in time.

Or another thought:  Would it hurt if you ignored any shortening of 
timeouts, i.e. reduce your use case also to only ever _deferring_ work, 
never rescheduling to an earlier point in time?
-- 
Stefan Richter
-=====-==--= =--- =-==-
http://arcgraph.de/sr/

  reply	other threads:[~2009-08-22 10:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20 21:51 Roland Dreier
2009-08-21 11:55 ` Oleg Nesterov
2009-08-21 21:53   ` Roland Dreier
2009-08-22 10:35     ` Stefan Richter [this message]
2009-08-24 18:01     ` Oleg Nesterov
2009-08-24 21:11       ` Roland Dreier
2009-08-25  9:39         ` Oleg Nesterov
2009-08-26 18:42           ` Roland Dreier
2009-08-28 17:59             ` [PATCH 0/1] introduce __cancel_delayed_work() Oleg Nesterov
2009-08-28 18:00               ` [PATCH 1/1] " Oleg Nesterov
2009-09-01 16:09                 ` Roland Dreier
2009-09-01 16:40                   ` Dmitry Torokhov
2009-09-01 22:29                     ` Andrew Morton
2009-09-01  0:44             ` Is adding requeue_delayed_work() a good idea Dmitry Torokhov

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=4A8FCA03.6090107@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=rdreier@cisco.com \
    /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®