mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "huang ying" <huang.ying.caritas@gmail.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Huang, Ying" <ying.huang@intel.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Pavel Machek" <pavel@ucw.cz>,
	nigel@nigel.suspend2.net,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Jeremy Maitin-Shepard" <jbms@cmu.edu>,
	linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org,
	"Kexec Mailing List" <kexec@lists.infradead.org>
Subject: Re: [PATCH 3/4 -mm] kexec based hibernation -v7 : kexec hibernate/resume
Date: Fri, 7 Dec 2007 21:28:55 +0800	[thread overview]
Message-ID: <851fc09e0712070528w6701505cr999371ca5ac77307@mail.gmail.com> (raw)
In-Reply-To: <200712071352.34475.rjw@sisk.pl>

On Dec 7, 2007 8:52 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Friday, 7 of December 2007, Huang, Ying wrote:
> > This patch implements kexec based hibernate/resume. This is based on
> > the facility provided by kexec_jump. The states save/restore code of
> > ordinary kexec_jump is overridden by hibernate/resume specific
> > code.
>
> Can you explain in more details how this works?

Two blocking notifier chain named kjump_chain_pre and kjump_chain_post
are defined, the basic procedure of kexec jump is as follow:

call functions in kjump_chain_pre
jump to peer kernel
call functions in kjump_chain_post

A command is the first parameter of functions in chain. If A command
is processed in a function, the function will execute and stop the
chain (return NOTIFY_STOP), otherwise it will do nothing (return
NOTIFY_DONE). If no function has interest in the command, the default
behavior will be executed (kexec_vcall_pre, kexec_vcall_post).

So for each command the procedure is as follow:

KJUMP_CMD_HIBERNATE_WRITE_IMAGE:
[chain] kexec_snapshot
jump to kexeced kernel
[chain] kexec_prepare_write_image /* in kexeced kernel */

KJUMP_HIBERNATE_RESUME:
[chain] kexec_prepare_resume /* in kexeced kernel */
jump to kexec kernel
[chain] kexec_resume

> > The ACPI methods are called at specified environment to conform
> > the ACPI specification. A new reboot command is added to go to ACPI S4
> > state from user space.
>
> Well, I still don't like the amount of duplicated code introduced by this patch.

Yes, there are too many duplicated code. They should be merged. But I
want to delay the merging until the kexec based hibernation code goes
more stable.

> Also, IMO it should be using the mutual exclusion mechanisms used by the
> existing hibernation code, ie. pm_mutex and the snapshot_device_available
> atomic variable.

Now the kexec_lock is used as a mutex between kexec related
operations. It seems reasonable to use pm_mutex and maybe
snapshot_device_available to eliminate potential conflict between
kexec based hibernation and u/swsusp.

Best Regards,
Huang Ying

      reply	other threads:[~2007-12-07 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-07 15:53 Huang, Ying
2007-12-07 12:52 ` Rafael J. Wysocki
2007-12-07 13:28   ` huang ying [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=851fc09e0712070528w6701505cr999371ca5ac77307@mail.gmail.com \
    --to=huang.ying.caritas@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=jbms@cmu.edu \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=ying.huang@intel.com \
    /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®