From: BVK Chaitanya <bayapuneni_chaitanya@symantec.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: Xen-devel@lists.xensource.com
Subject: Re: [PATCH] serialize suspend-resume process
Date: Thu, 31 Jul 2008 19:04:12 +0530 [thread overview]
Message-ID: <4891BF54.9090701@symantec.com> (raw)
In-Reply-To: <C4B77786.24EA3%keir.fraser@eu.citrix.com>
Keir Fraser wrote:
>
> On 31/7/08 14:04, "BVK Chaitanya" <bayapuneni_chaitanya@symantec.com> wrote:
>
>> With suspend event channel in place, i see that suspend request doesn't
>> go through the shutdown_handler function when suspend is triggered over
>> event channel.
>
> Oh, I agree that the shutdown_handler() can be re-entered! But it will *not*
> trigger multiple invocations of xen_suspend() -- note it stores away the
> suspend request by performing xchg(&shutting_down, ...) but it does *not*
> immediately trigger a suspend unless old_state==SHUTDOWN_INVALID (in which
> case there is no active current invocation of xen_suspend()).
>
In my tree there are two shutdown_handler functions.
shutdown_handler
__shutdown_handler
First one is called through xenbus interface and ensures that
xen_suspend is serialized. I agree about this.
Second one is called through suspend_int (handler for suspend event
channel) as below:
static irqreturn_t suspend_int(int irq, void* dev_id,
struct pt_regs *ptregs)
{
shutting_down = SHUTDOWN_SUSPEND;
schedule_work(&shutdown_work);
return IRQ_HANDLED;
}
where shutdown_work & its callback are:
static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
static void __shutdown_handler(void *unused)
{
int err;
err = kernel_thread((shutting_down == SHUTDOWN_SUSPEND) ?
xen_suspend : shutdown_process,
NULL, CLONE_FS | CLONE_FILES);
if (err < 0) {
printk(KERN_WARNING "Error creating shutdown"
" process (%d): "
"retrying...\n", -err);
schedule_delayed_work(&shutdown_work, HZ/2);
}
}
This second function creates a thread and calls xen_suspend without
looking for shutting_down variable's value.
I will check my tree again and will get back to you.
--
bvk-chaitanya
next prev parent reply other threads:[~2008-07-31 13:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-31 11:09 [PATCH] serialize suspend-resume process BVK Chaitanya
2008-07-31 11:17 ` Keir Fraser
2008-07-31 11:57 ` BVK Chaitanya
2008-07-31 12:23 ` Keir Fraser
2008-07-31 13:04 ` BVK Chaitanya
2008-07-31 13:07 ` Keir Fraser
2008-07-31 13:34 ` BVK Chaitanya [this message]
2008-07-31 13:46 ` Keir Fraser
2008-07-31 14:10 ` BVK Chaitanya
2008-07-31 14:12 ` Neil Turton
2008-07-31 14:36 ` Keir Fraser
2008-07-31 15:27 ` BVK Chaitanya
2008-07-31 15:24 ` Keir Fraser
2008-08-01 5:31 ` BVK Chaitanya
2008-08-01 5:58 ` BVK Chaitanya
2008-08-01 8:01 ` Keir Fraser
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=4891BF54.9090701@symantec.com \
--to=bayapuneni_chaitanya@symantec.com \
--cc=Xen-devel@lists.xensource.com \
--cc=keir.fraser@eu.citrix.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 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.