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 14:01:20 -0500	[thread overview]
Message-ID: <20131226190120.GC16483@htj.dyndns.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1312261326540.24521-100000@netrider.rowland.org>

Hey,

On Thu, Dec 26, 2013 at 01:42:29PM -0500, Alan Stern wrote:
> In the case of hibernation, it's not so simple.  We do need to perform 
> I/O, in order to save the memory image.  But we also need to avoid 
> unnecessary I/O, in order to keep the on-disk data consistent with the 
> data in the memory image.  You probably can't accomplish this at the 
> device driver or subsystem level.

That was what I assumed too but Rafael tells me it has nothing to do
with hibernation.

> > which bothers me about the freezer is that it's essentially a separate
> > entry point for suspend/resume implementation, and not a particularly
> > well designed one at that.  Things which depend on freezer for PM ops
> > would need completely separate paths for runtime PM.  They probably
> > need some deviations anyway but freezer would push it unnecessarily.
> 
> Maybe it's the other way around: The separate paths are necessary, and 
> the freezer _simplifies_ the system sleep ops.

Again, the point is it's too big a tool given the problem with history
of abuse.  It sure is "convenient" to have tools at that level for
that particular user - not because the task at hand fits such solution
but because a lot more is being paid elsewhere.  It just is out of
proportion and isn't a good design in larger sense.

As for autopm vs. system pm, there sure are necessary differences
between the two but they also can share a lot.  At least, it looks
that way from libata side.  I really don't think having two separate
paradigms in implementing PM is a good idea even if the two paths have
to deviate in significant ways.

> Taking khubd as an example, I have to agree that converting it to a
> workqueue would be a big simplification overall.  And yet there are
> some things khubd does which are (as far as I know) rather difficult to
> accomplish with workqueues.  One example in drivers/usb/core/hub.c:  
> kick_khubd() calls usb_autopm_get_interface_no_resume() if and only if
> it added the hub to the event list (and it does so before releasing the
> list's lock).  How can you do that with a workqueue?

Do the same thing and just replace wake_up() with queue_work()?

Thanks.

-- 
tejun

  reply	other threads:[~2013-12-26 19:01 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 [this message]
2013-12-26 23:23                     ` Rafael J. Wysocki
2013-12-27  2:14                     ` Alan Stern
2013-12-27  2:21                       ` Tejun Heo
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=20131226190120.GC16483@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