Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	linux-ide@vger.kernel.org,
	Linux-pm mailing list <linux-pm@vger.kernel.org>
Subject: Re: No freezing of kernel threads (was: Re: [GIT PULL] libata fixes for v3.13-rc5)
Date: Thu, 26 Dec 2013 21:21:42 -0500	[thread overview]
Message-ID: <20131227022142.GD16483@htj.dyndns.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1312262048540.29101-100000@netrider.rowland.org>

Hello,

On Thu, Dec 26, 2013 at 09:14:49PM -0500, Alan Stern wrote:
> I can't disagree with this.  But the design may well be perfectly
> adequate for some use cases.  Given a workqueue or kthread which should
> not operate during system sleep, we have to:
> 
> 	Tell the wq/thread to stop running because a sleep is about
> 	to start, and
> 
> 	Provide a function the wq/thread can call to put itself on 
> 	hold for the duration of the sleep.
> 
> The freezer does both these things pretty efficiently.  Problems may

I don't even like the interface itself.  It's too implicit and spread
all over the place - we basically had to spread it all over the wait
interfaces, and the implementation is far more involved than called
for.  I don't know how you're defining "efficiently" but that isn't a
word I'd use to describe the freezer.

> So you're suggesting changing the kthread to a workqueue thread, but
> keeping the existing list of scheduled events instead of relying on the
> workqueue's own queue of work items?  What's the advantage?  Making
> such a change wouldn't simplify anything.

Well, that'd be an easy first step which does away with the dedicated
kthread, likely reduces cache footprint and allows use of wq
synchronization / freezing constructs which are easier to deal with.
More involved conversion would of course be doable but even simple
conversion seems like a win.

Thanks.

-- 
tejun

  reply	other threads:[~2013-12-27  2:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24 14:21 [GIT PULL] libata fixes for v3.13-rc5 Tejun Heo
2013-12-24 21:55 ` Alan Stern
2013-12-25 14:45   ` Rafael J. Wysocki
2013-12-25 14:57     ` Alan Stern
2013-12-25 22:12       ` Rafael J. Wysocki
2013-12-26  3:29         ` No freezing of kernel threads (was: Re: [GIT PULL] libata fixes for v3.13-rc5) Alan Stern
2013-12-26  4:18           ` Tejun Heo
2013-12-26 15:05             ` Rafael J. Wysocki
2013-12-26 16:05               ` Tejun Heo
2013-12-26 18:42                 ` Alan Stern
2013-12-26 19:01                   ` Tejun Heo
2013-12-26 23:23                     ` Rafael J. Wysocki
2013-12-27  2:14                     ` Alan Stern
2013-12-27  2:21                       ` Tejun Heo [this message]
2013-12-26 23:49                 ` Rafael J. Wysocki
2014-01-11 21:15                 ` Pavel Machek

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=20131227022142.GD16483@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.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