All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: Steve French <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
	Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Linux-pm mailing list
	<linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	keyrings-6DNke4IJHB0gsBAKwltoeQ@public.gmane.org,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
Subject: Re: system_nrt_wq, system suspend, and the freezer
Date: Thu, 16 Feb 2012 08:45:16 -0800	[thread overview]
Message-ID: <20120216164516.GJ24986@google.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1202161131420.1268-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>

Hello,

On Thu, Feb 16, 2012 at 11:37:33AM -0500, Alan Stern wrote:
> Um.  I don't think I can audit all the calls in the kernel that submit
> block requests and determine which ones need to be allowed while a
> system sleep is in progress.

??? we need to do that anyway and the ones which should go through are
much smaller than the ones which shouldn't go through.

> > Also, in general, I don't think using freezing widely for kernel
> > threads / wqs is a good idea.  Plugging device access at subsystem
> > layer should cover most cases and we have notifiers to implement such
> > support and to handle special cases.  There are even code paths which
> > try to determine whether system went through PM operation by looking
> > at whether %current went through the freezer.  IMHO, we'll be better
> > off with removing freezer support for kthreads.  :(
> 
> Well, there are some dedicated threads that exist for no other purpose
> than to do I/O to devices and to handle hotplug/unplug events.  I don't
> see any reason not allow such threads to be freezable.  It's a quick, 
> convenient method for getting them out of the way.

Well, it's convenient to use incorrectly.  If you look at most of
freezable kthreads, they're sadly broken.  I mean, a lot of kthread
users don't even get kthread_should_stop() right.  With freezable()
thrown into the mix, it seems hopeless.  With wq, it's better as
freezing is handled by wq proper.  Even then, I don't know.  It just
seems to lead people to think "ooh, I marked it freezable so I don't
have to think about synchronization across PM events.  Freezer will
magically solve this for me!".  :(

Thanks.

-- 
tejun

  parent reply	other threads:[~2012-02-16 16:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 14:41 system_nrt_wq, system suspend, and the freezer Alan Stern
2012-02-16 14:41 ` Alan Stern
     [not found] ` <Pine.LNX.4.44L0.1202160930010.1268-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-02-16 15:22   ` David Howells
     [not found]     ` <32626.1329405744-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-02-16 16:26       ` Tejun Heo
     [not found]     ` <20120216162634.GE24986-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-02-16 16:35       ` David Howells
2012-02-16 16:37         ` Tejun Heo
2012-02-16 15:27 ` Jeff Layton
2012-02-16 15:27   ` Jeff Layton
     [not found]   ` <20120216102728.230b99ba-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>
2012-02-16 16:29     ` Tejun Heo
     [not found]       ` <20120216162951.GF24986-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-02-16 16:42         ` Alan Stern
2012-02-16 16:42           ` Alan Stern
2012-02-16 18:59       ` Jeff Layton
     [not found]         ` <20120216135945.3dd3893a-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-02-16 19:01           ` Tejun Heo
2012-02-17 21:22   ` [PATCH] Block: use a freezable workqueue for disk-event polling Alan Stern
2012-02-17 21:22     ` Alan Stern
2012-02-17 21:52     ` Tejun Heo
2012-02-17 22:11     ` Rafael J. Wysocki
2012-03-02  9:51     ` Jens Axboe
2012-02-16 16:25 ` system_nrt_wq, system suspend, and the freezer Tejun Heo
     [not found]   ` <20120216162529.GD24986-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-02-16 16:37     ` Alan Stern
2012-02-16 16:37       ` Alan Stern
     [not found]       ` <Pine.LNX.4.44L0.1202161131420.1268-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-02-16 16:45         ` Tejun Heo [this message]
2012-02-16 16:58           ` Alan Stern
2012-02-16 16:58             ` Alan Stern

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=20120216164516.GJ24986@google.com \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=keyrings-6DNke4IJHB0gsBAKwltoeQ@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    --cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.