From: Ben Guthro <Benjamin.Guthro@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH] x86/S3: Restore broken vcpu affinity on resume (v3)
Date: Wed, 27 Mar 2013 08:56:25 -0400 [thread overview]
Message-ID: <5152EC79.5040802@citrix.com> (raw)
In-Reply-To: <5152F93C02000078000C8DE2@nat28.tlf.novell.com>
On 03/27/2013 08:50 AM, Jan Beulich wrote:
>>>> On 27.03.13 at 13:36, Ben Guthro <benjamin.guthro@citrix.com> wrote:
>> --- a/xen/arch/x86/acpi/power.c
>> +++ b/xen/arch/x86/acpi/power.c
>> @@ -96,7 +96,11 @@ static void thaw_domains(void)
>>
>> rcu_read_lock(&domlist_read_lock);
>> for_each_domain ( d )
>> + {
>> + if (system_state == SYS_STATE_resume)
>
> I don't think there's a way to get here with system_state other
> than SYS_STATE_resume.
>
> Also, should there be a need to re-submit again, there are spaces
> missing inside the parentheses.
OK, I'll remove this if entirely
>
>> + restore_vcpu_affinity(d);
>> domain_unpause(d);
>> + }
>> rcu_read_unlock(&domlist_read_lock);
>> }
>>
>> --- a/xen/common/schedule.c
>> +++ b/xen/common/schedule.c
>> @@ -541,6 +541,38 @@ void vcpu_force_reschedule(struct vcpu *v)
>> }
>> }
>>
>> +void restore_vcpu_affinity(struct domain *d)
>> +{
>> + struct vcpu *v;
>> +
>> + for_each_vcpu ( d, v )
>> + {
>> + vcpu_schedule_lock_irq(v);
>> +
>> + if (v->affinity_broken)
>
> And here again.
ACK. Will resolve in v4
>
>> + {
>> + printk("Restoring vcpu affinity for domain %d vcpu %d\n",
>> + v->domain->domain_id, v->vcpu_id);
>
> XENLOG_DEBUG perhaps? Otherwise this can get pretty noisy
> even without loglvl= override during resume if there are many
> and/or big domains. To conserve on ring and transmit buffer space,
> I'd also suggest shortening the text to "Restoring affinity for
> d%dv%d\n" (and using d->domain_id).
>
> Jan
I modeled this after the printk where the affinity was broken, so they
could be matched up in the log, for anyone looking.
Should I also change that printk to XENLOG_DEBUG?
Ben
>
>> + cpumask_copy(v->cpu_affinity, v->cpu_affinity_saved);
>> + v->affinity_broken = 0;
>> + }
>> +
>> + if ( v->processor == smp_processor_id() )
>> + {
>> + set_bit(_VPF_migrating, &v->pause_flags);
>> + vcpu_schedule_unlock_irq(v);
>> + vcpu_sleep_nosync(v);
>> + vcpu_migrate(v);
>> + }
>> + else
>> + {
>> + vcpu_schedule_unlock_irq(v);
>> + }
>> + }
>> +
>> + domain_update_node_affinity(d);
>> +}
>> +
>> /*
>> * This function is used by cpu_hotplug code from stop_machine context
>> * and from cpupools to switch schedulers on a cpu.
>
>
prev parent reply other threads:[~2013-03-27 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 12:36 [PATCH] x86/S3: Restore broken vcpu affinity on resume (v3) Ben Guthro
2013-03-27 12:50 ` Jan Beulich
2013-03-27 12:56 ` Ben Guthro [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=5152EC79.5040802@citrix.com \
--to=benjamin.guthro@citrix.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.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 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.