Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1259798

Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread freezer

From Jiri Kosina <jikos@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread freezer
Date 2015-10-30 22:20 +0100
Message-ID <qppfA-2sf-23@gated-at.bofh.it> (permalink)
References <qpoMx-22G-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 30 Oct 2015, Alan Stern wrote:

> > > > I would say instead "no I/O is allowed from now on".  Maybe that's an 
> > > > overstatement, but I think it comes closer to the truth.
> > 
> > But that's what PM callbacks are for.
> 
> Why are PM callbacks any more suitable than the freezer?  

Once the PM callback triggers, you know that you are really actually 
undergoing suspend and have to do whatever is necessary.

OTOH, try_to_freeze() is a kind of "are we there yet?" polling, and the 
whole state needs to be prepared pro-actively for suspend already when you 
call it, each and every time, even if you are not going through suspend at 
all.

That's sub-optimal, and very easy to get wrong over gradual code changes.

> The most natural implementation would be for the callback routine to set 
> a flag; at various strategic points the kthread would check the flag and 
> if it was set, call a routine that sits around and waits for the suspend 
> to be over.  

Could you name at least some existing kthreads that would actually *need* 
such complex handling, instead of just waiting in schedule() until 
suspend-resume cycle is over, given that PM callbacks do all the necessary 
cleanup (putting HW to sleep, cancelling timers, etc) anyway?

PM callback can always explicitly do kthread_stop() on a particular 
kthread if really necessary.

> Also, you never replied to my question about suspend vs. hibernation.

The main point of freezer is to reach quiescent state wrt. filesystems 
(metadata in memory need to be absolutely in sync with what's on disk). 
That's no different between hibernation and s2ram, is it?

BTW, a quite some of this has been already "pre-discussed" in 
Documentation/power/freezing-of-tasks.txt (which has BTW been written 
before we've had the possibility to freeze filesystems, and this fact is 
even point there out).

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Jiri Kosina <jikos@kernel.org> - 2015-10-30 14:50 +0100
  Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Alan Stern <stern@rowland.harvard.edu> - 2015-10-30 16:30 +0100
    Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Pavel Machek <pavel@ucw.cz> - 2015-10-30 18:50 +0100
      Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Jiri Kosina <jikos@kernel.org> - 2015-10-30 20:50 +0100
        Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Alan Stern <stern@rowland.harvard.edu> - 2015-10-30 21:50 +0100
          Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Jiri Kosina <jikos@kernel.org> - 2015-10-30 22:20 +0100
            Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread freezer "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-31 03:50 +0100
              Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Jiri Kosina <jikos@kernel.org> - 2015-10-31 09:20 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread freezer "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-11-02 03:20 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Jiri Kosina <jikos@kernel.org> - 2015-11-02 11:50 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Oliver Neukum <oneukum@suse.com> - 2015-11-02 12:10 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Alan Stern <stern@rowland.harvard.edu> - 2015-11-02 16:20 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Dave Chinner <david@fromorbit.com> - 2015-11-03 01:20 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread freezer "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-11-03 04:40 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Jan Kara <jack@suse.cz> - 2015-11-03 10:50 +0100
                Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread freezer "Rafael J. Wysocki" <rafael@kernel.org> - 2015-11-03 22:40 +0100
              Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Alan Stern <stern@rowland.harvard.edu> - 2015-10-31 17:10 +0100
            Re: [PATCH 0/3] PM, vfs: use filesystem freezing instead of kthread  freezer Alan Stern <stern@rowland.harvard.edu> - 2015-10-31 17:00 +0100

csiph-web