mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxim Levitsky <maximlevitsky@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Pavel Machek <pavel@ucw.cz>, Jens Axboe <jens.axboe@oracle.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-pm <linux-pm@lists.linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [linux-pm] Is it supposed to be ok to call del_gendisk while userspace is frozen?
Date: Fri, 04 Jun 2010 18:19:38 +0300	[thread overview]
Message-ID: <1275664778.4596.1.camel@maxim-laptop> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1006041052570.1794-100000@iolanthe.rowland.org>

On Fri, 2010-06-04 at 10:59 -0400, Alan Stern wrote: 
> On Fri, 4 Jun 2010, Maxim Levitsky wrote:
> 
> > On Thu, 2010-03-04 at 14:53 +0100, Pavel Machek wrote: 
> > > Hi!
> > > 
> > > > > journalling assumptions broken: commit block is there, but previous
> > > > > blocks are not intact. Data loss.
> > > > > 
> > > > > ...and that was the first I could think about. Lets not do
> > > > >  this. Barriers were invented for a reason.
> > > > 
> > > > Very well.  Then we still need a solution to the original problem:  
> > > > Devices sometimes need to be unregistered during resume, but
> > > > del_gendisk() blocks on the writeback thread, which is frozen until
> > > > after the resume finishes.  How do you suggest this be fixed?
> > > 
> > > Avoid unregistering device during resume. Instead, return errors until
> > > resume is done and you can call del_gendisk? 
> > 
> > This won't help ether. The same driver needs to unregister perfectly
> > working device on suspend, because the user might replace the card
> > during suspend and fool the os.
> > There is a setting, CONFIG_MMC_UNSAFE_RESUME and I use it, but it isn't
> > default.
> 
> People have generally agreed that the best answer is to have 
> del_gendisk always thaw the writeback thread.
Now the question is how to do that? :-)

Best regards,
Maxim Levitsky

> 
> > Anyway to revive that old thread, how about introducing new
> > del_gendisk_no_sync?
> > 
> > A less safe version of del_gendisk, but which won't sync the filesystem.
> > Since driver knows that card is gone, there is no point of syncing it.
> > 
> > (the sync is done by invalidate_partition, so some flag should be
> > propagated to it).
> 
> That might work for mmc, but it wouldn't help other drivers subject to
> the same problem.
> 
> Besides, it's subject to races.  What if the card _isn't_ gone, but for 
> some other reason the driver wants to unregister the device at a time 
> when the writeback thread is frozen?
> 
> Alan Stern
> 



  reply	other threads:[~2010-06-04 15:19 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13 13:29 Maxim Levitsky
2010-02-15 16:00 ` Maxim Levitsky
2010-02-15 21:04   ` Rafael J. Wysocki
2010-02-16 16:27     ` [linux-pm] " Alan Stern
2010-02-20 22:22       ` Maxim Levitsky
2010-02-23 12:33       ` 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 22:16               ` Jens Axboe
2010-02-24 15:59                 ` Alan Stern
2010-02-24 19:12                   ` Jens Axboe
2010-02-24 20:19                     ` Alan Stern
2010-02-23 16:42             ` Testing for dirty buffers on a block device Alan Stern
2010-02-23 22:13               ` Jens Axboe
2010-02-24 15:51                 ` Alan Stern
2010-02-24 19:09                   ` Jens Axboe
2010-02-24 20:09                     ` Alan Stern
2010-02-25  8:20                       ` Jens Axboe
2010-02-25 22:19                         ` Dave Chinner
2010-03-01  6:35           ` [linux-pm] Is it supposed to be ok to call del_gendisk while userspace is frozen? 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 19:26                       ` Rafael J. Wysocki
2010-03-04 19:36                         ` Alan Stern
2010-03-04 20:04                           ` Rafael J. Wysocki
2010-03-04 20:15                         ` 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-12 14:50                                 ` 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:47                                         ` 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-15  2:32                                         ` 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 21:32                                                 ` Nigel Cunningham
2010-05-17  2:22                                                   ` 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-18 19:43                                                           ` Rafael J. Wysocki
2010-05-18 20:06                                                             ` Alan Stern
2010-05-24 19:02                                                           ` Pavel Machek
2010-05-24 21:21                                                             ` Nigel Cunningham
2010-03-04 13:53                   ` Pavel Machek
2010-06-04 11:20                     ` Maxim Levitsky
2010-06-04 14:59                       ` Alan Stern
2010-06-04 15:19                         ` Maxim Levitsky [this message]
2010-06-04 17:52                           ` 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=1275664778.4596.1.camel@maxim-laptop \
    --to=maximlevitsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®