All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Nigel Cunningham <ncunningham@crca.org.au>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Jens Axboe <jens.axboe@oracle.com>,
	"linux-kernel" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-pm" <linux-pm@lists.linux-foundation.org>,
	Matt Reimer <mattjreimer@gmail.com>
Subject: Re: [linux-pm] Is it supposed to be ok to call del_gendisk while userspace is frozen?
Date: Sun, 16 May 2010 21:38:07 +0200	[thread overview]
Message-ID: <201005162138.07105.rjw@sisk.pl> (raw)
In-Reply-To: <4BEFA375.7030404@crca.org.au>

On Sunday 16 May 2010, Nigel Cunningham wrote:
> Hi.
> 
> On 16/05/10 06:30, Rafael J. Wysocki wrote:
> > On Saturday 15 May 2010, Alan Stern wrote:
> >> On Thu, 13 May 2010, Matt Reimer wrote:
> >>
> >>>> I don't see anything wrong with the patch itself, but I dislike the
> >>>> description.  Devices can come and go from any hotpluggable bus, not
> >>>> just MMC/SD.  That just happens to be the first place the problem was
> >>>> observed.
> >>>
> >>> Good point. How about this?
> >>>
> >>> Matt
> >>>
> >>>  From 813bd223e5a2fa577b9e64ddf12654a93d0aab8b Mon Sep 17 00:00:00 2001
> >>> From: Matt Reimer<mreimer@sdgsystems.com>
> >>> Date: Thu, 13 May 2010 14:36:54 -0700
> >>> Subject: [PATCH] fs: prevent hang on suspend/resume when MMC/SD card present
> >>>
> >>> Devices can come and go bus during suspend or resume, when the
> >>> writeback thread is frozen, resulting in a hang. Prevent the hang
> >>> by thawing the writeback thread in del_gendisk().
> >>
> >> I would have said "the block layer's writeback thread", but this is
> >> okay.
> >
> > OK, so now I have a question who's going to take the patch.
> 
> I object to the patch.
> 
> Tell the patch it ought to exit once thawed, by all means.

I'm not sure what you mean.  Care to explain?

> Make the patch unfreezeable to begin with, by all means.

That wouldn't work.

> But don't go down the path of having $random_code_path unfreeze a 
> thread. That will lead to unpredictability, confusion and bugs.

As a general rule, I agree, but this particular case is somewhat special.

> If you know a disk is going to be unregistered during resume,

How do we check that, exactly?

> use the hooks early in the suspend / hibernate process to block new I/O and 
> flush what's already there so that there's no need to block on the 
> writeback thread, and/or no need to have the writeback thread frozen.

I'm not sure if that's realistic.  Do you have a specific implementation in
mind?

Rafael

  parent reply	other threads:[~2010-05-16 19:36 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13 13:29 Is it supposed to be ok to call del_gendisk while userspace is frozen? Maxim Levitsky
2010-02-13 13:29 ` Maxim Levitsky
2010-02-15 16:00 ` Maxim Levitsky
2010-02-15 16:00 ` Maxim Levitsky
2010-02-15 21:04   ` Rafael J. Wysocki
2010-02-15 21:04   ` Rafael J. Wysocki
2010-02-16 16:27     ` Alan Stern
2010-02-16 16:27     ` [linux-pm] " Alan Stern
2010-02-20 22:22       ` Maxim Levitsky
2010-02-20 22:22         ` [linux-pm] " Maxim Levitsky
2010-02-23 12:33       ` Jens Axboe
2010-02-23 12:33       ` [linux-pm] " Jens Axboe
2010-02-23 15:29         ` Alan Stern
2010-02-23 15:58           ` Jens Axboe
2010-02-23 16:33             ` Alan Stern
2010-02-23 16:33             ` [linux-pm] " Alan Stern
2010-02-23 22:16               ` Jens Axboe
2010-02-24 15:59                 ` Alan Stern
2010-02-24 15:59                 ` [linux-pm] " Alan Stern
2010-02-24 19:12                   ` Jens Axboe
2010-02-24 20:19                     ` Alan Stern
2010-02-24 20:19                     ` [linux-pm] " Alan Stern
2010-02-24 19:12                   ` Jens Axboe
2010-02-23 22:16               ` Jens Axboe
2010-02-23 16:42             ` Testing for dirty buffers on a block device Alan Stern
2010-02-23 16:42             ` Alan Stern
2010-02-23 22:13               ` Jens Axboe
2010-02-24 15:51                 ` Alan Stern
2010-02-24 15:51                 ` Alan Stern
2010-02-24 19:09                   ` Jens Axboe
2010-02-24 19:09                   ` Jens Axboe
2010-02-24 20:09                     ` Alan Stern
2010-02-24 20:09                     ` Alan Stern
2010-02-25  8:20                       ` Jens Axboe
2010-02-25 22:19                         ` Dave Chinner
2010-02-25 22:19                         ` Dave Chinner
2010-02-25  8:20                       ` Jens Axboe
2010-02-23 22:13               ` Jens Axboe
2010-02-23 15:58           ` Is it supposed to be ok to call del_gendisk while userspace is frozen? Jens Axboe
2010-03-01  6:35           ` Pavel Machek
2010-03-01  6:35           ` [linux-pm] " Pavel Machek
2010-03-01 15:23             ` Alan Stern
2010-03-03 21:50               ` Pavel Machek
2010-03-03 22:23                 ` Alan Stern
2010-03-04  0:23                   ` Rafael J. Wysocki
2010-03-04  2:48                     ` Alan Stern
2010-03-04  2:48                     ` [linux-pm] " Alan Stern
2010-03-04 19:26                       ` Rafael J. Wysocki
2010-03-04 19:36                         ` Alan Stern
2010-03-04 19:36                           ` [linux-pm] " Alan Stern
2010-03-04 20:04                           ` Rafael J. Wysocki
2010-03-04 20:04                           ` Rafael J. Wysocki
2010-03-04 20:15                         ` Pavel Machek
2010-03-04 20:15                           ` [linux-pm] " Pavel Machek
2010-04-22 23:40                           ` Matt Reimer
2010-04-23  5:17                             ` Rafael J. Wysocki
2010-05-11 23:55                               ` Matt Reimer
2010-05-11 23:55                               ` [linux-pm] " Matt Reimer
2010-05-12 14:50                                 ` Alan Stern
2010-05-12 14:50                                 ` [linux-pm] " Alan Stern
2010-05-13 21:44                                   ` Matt Reimer
2010-05-13 21:54                                     ` Alan Stern
2010-05-13 22:20                                       ` Matt Reimer
2010-05-13 22:20                                       ` [linux-pm] " Matt Reimer
2010-05-13 22:47                                         ` Nigel Cunningham
2010-05-13 22:47                                         ` [linux-pm] " Nigel Cunningham
2010-05-15  2:37                                           ` Alan Stern
2010-05-15  2:53                                             ` Nigel Cunningham
2010-05-16 19:35                                               ` Rafael J. Wysocki
2010-05-16 19:35                                               ` Rafael J. Wysocki
2010-05-15  2:53                                             ` Nigel Cunningham
2010-05-15  2:37                                           ` Alan Stern
2010-05-15  2:32                                         ` [linux-pm] " Alan Stern
2010-05-15 20:30                                           ` Rafael J. Wysocki
2010-05-16  7:49                                             ` Nigel Cunningham
2010-05-16 19:38                                               ` Rafael J. Wysocki
2010-05-16 19:38                                               ` Rafael J. Wysocki [this message]
2010-05-16 21:32                                                 ` [linux-pm] " Nigel Cunningham
2010-05-17  2:22                                                   ` Alan Stern
2010-05-17  2:22                                                   ` [linux-pm] " Alan Stern
2010-05-17  7:45                                                     ` Nigel Cunningham
2010-05-17 20:35                                                       ` Rafael J. Wysocki
2010-05-17 22:51                                                         ` Nigel Cunningham
2010-05-17 22:51                                                         ` [linux-pm] " Nigel Cunningham
2010-05-18 19:43                                                           ` Rafael J. Wysocki
2010-05-18 20:06                                                             ` Alan Stern
2010-05-18 20:06                                                             ` Alan Stern
2010-05-18 19:43                                                           ` Rafael J. Wysocki
2010-05-24 19:02                                                           ` [linux-pm] " Pavel Machek
2010-05-24 21:21                                                             ` Nigel Cunningham
2010-05-24 21:21                                                             ` [linux-pm] " Nigel Cunningham
2010-05-24 19:02                                                           ` Pavel Machek
2010-05-17 20:35                                                       ` Rafael J. Wysocki
2010-05-17  7:45                                                     ` Nigel Cunningham
2010-05-16 21:32                                                 ` Nigel Cunningham
2010-05-16  7:49                                             ` Nigel Cunningham
2010-05-15 20:30                                           ` Rafael J. Wysocki
2010-05-15  2:32                                         ` Alan Stern
2010-05-13 21:54                                     ` Alan Stern
2010-05-13 21:44                                   ` Matt Reimer
2010-04-23  5:17                             ` Rafael J. Wysocki
2010-04-22 23:40                           ` Matt Reimer
2010-03-04 19:26                       ` Rafael J. Wysocki
2010-03-04  0:23                   ` Rafael J. Wysocki
2010-03-04 13:53                   ` Pavel Machek
2010-03-04 13:53                   ` [linux-pm] " Pavel Machek
2010-06-04 11:20                     ` Maxim Levitsky
2010-06-04 11:20                     ` [linux-pm] " Maxim Levitsky
2010-06-04 14:59                       ` Alan Stern
2010-06-04 15:19                         ` Maxim Levitsky
2010-06-04 15:19                         ` [linux-pm] " Maxim Levitsky
2010-06-04 17:52                           ` Alan Stern
2010-06-04 17:52                           ` Alan Stern
2010-06-04 14:59                       ` Alan Stern
2010-03-03 22:23                 ` Alan Stern
2010-03-03 21:50               ` Pavel Machek
2010-03-01 15:23             ` Alan Stern
2010-02-23 15:29         ` 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=201005162138.07105.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mattjreimer@gmail.com \
    --cc=ncunningham@crca.org.au \
    --cc=stern@rowland.harvard.edu \
    /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.