From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Jiri Slaby <jirislaby@gmail.com>,
"Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>,
Jiri Slaby <jslaby@suse.cz>, LKML <linux-kernel@vger.kernel.org>,
Baohua.Song@csr.com, Tejun Heo <tj@kernel.org>,
"pavel@ucw.cz" <pavel@ucw.cz>
Subject: Re: [linux-pm] PM: cannot hibernate -- BUG at kernel/workqueue.c:3659
Date: Fri, 27 Jan 2012 02:10:37 +0100 [thread overview]
Message-ID: <201201270210.37585.rjw@sisk.pl> (raw)
In-Reply-To: <4F21ABE2.1060302@linux.vnet.ibm.com>
On Thursday, January 26, 2012, Srivatsa S. Bhat wrote:
>
> Hi Rafael,
>
> On 01/25/2012 09:01 PM, Srivatsa S. Bhat wrote:
>
> >
> > Ok, I will need to quote a part of the userspace utility to explain the
> > problem.
> >
> > In suspend.c inside the suspend-utils userspace package, I see a loop such
> > as:
> >
> > error = freeze(snapshot_fd);
> > ...
> > attempts = 2;
> > do {
> > if (set_image_size(snapshot_fd, image_size)) {
> > error = errno;
> > break;
> > }
> > if (atomic_snapshot(snapshot_fd, &in_suspend)) {
> > error = errno;
> > break;
> > }
> > if (!in_suspend) {
> > /* first unblank the console, see console_codes(4) */
> > printf("\e[13]");
> > printf("%s: returned to userspace\n", my_name);
> > free_snapshot(snapshot_fd);
> > break;
> > }
> >
> > error = write_image(snapshot_fd, resume_fd, -1);
> > if (error) {
> > free_swap_pages(snapshot_fd);
> > free_snapshot(snapshot_fd);
> > image_size = 0;
> > error = -error;
> > if (error != ENOSPC)
> > break;
> > } else {
> > splash.progress(100);
> > #ifdef CONFIG_BOTH
> > if (s2ram_kms || s2ram) {
> > /* If we die (and allow system to continue)
> > * between now and reset_signature(), very bad
> > * things will happen. */
> > error = suspend_to_ram(snapshot_fd);
> > if (error)
> > goto Shutdown;
> > reset_signature(resume_fd);
> > free_swap_pages(snapshot_fd);
> > free_snapshot(snapshot_fd);
> > if (!s2ram_kms)
> > s2ram_resume();
>
>
> Your patch alters how SNAPSHOT_FREE (IOW, free_snapshot() in this utility) is
> handled. So, I was trying to see if there are any points of concern...
>
> In the above code, s2ram_resume() gets invoked after free_snapshot(). Will that
> pose any problems because kernel threads would have been thawed at that point,
> after applying your patch?
No, it shouldn't. s2ram_resume() only executes quirks needed to restore the
state of graphics if KMS is not being used. That shouldn't interfere with
any kernel threads.
> And other than that, do you foresee any problems arising from the change caused
> to SNAPSHOT_FREE by your patch? I mean, s2ram/s2disk/suspend-utils package are
> not the only userspace utilities after all... so I just wanted to ensure that
> we don't over-fit our solution to this particular utility and end up breaking
> others...
I'm quite sure they are the only package using the interface in
kernel/power/user.c. At least, I'm not aware of any other users. :-)
Thanks,
Rafael
prev parent reply other threads:[~2012-01-27 1:07 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 15:05 PM: cannot hibernate -- BUG at kernel/workqueue.c:3659 Jiri Slaby
2012-01-24 16:18 ` [linux-pm] " Srivatsa S. Bhat
2012-01-24 16:24 ` Jiri Slaby
2012-01-24 22:36 ` Rafael J. Wysocki
2012-01-24 22:47 ` Jiri Slaby
2012-01-24 23:02 ` Rafael J. Wysocki
2012-01-25 0:04 ` Jiri Slaby
2012-01-25 0:10 ` Rafael J. Wysocki
2012-01-25 14:25 ` Jiri Slaby
2012-01-25 15:31 ` Srivatsa S. Bhat
2012-01-25 16:00 ` Srivatsa S. Bhat
2012-01-25 18:44 ` Srivatsa S. Bhat
2012-01-25 23:51 ` Rafael J. Wysocki
2012-01-26 11:05 ` Jiri Slaby
2012-01-27 1:01 ` Rafael J. Wysocki
2012-01-26 19:22 ` Srivatsa S. Bhat
2012-01-27 1:01 ` Rafael J. Wysocki
2012-01-27 10:04 ` Srivatsa S. Bhat
2012-01-27 22:44 ` Rafael J. Wysocki
2012-01-28 15:41 ` Srivatsa S. Bhat
2012-01-29 0:14 ` Rafael J. Wysocki
2012-01-25 22:00 ` Jiri Slaby
2012-01-26 19:39 ` Srivatsa S. Bhat
2012-01-27 1:10 ` Rafael J. Wysocki [this message]
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=201201270210.37585.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=Baohua.Song@csr.com \
--cc=jirislaby@gmail.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=pavel@ucw.cz \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
--cc=tj@kernel.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;
as well as URLs for NNTP newsgroup(s).