* [PATCH] slightly simplify SCHEDOP_remote_shutdown handling
@ 2015-06-17 12:55 Jan Beulich
2015-06-17 12:59 ` Andrew Cooper
2015-06-17 12:59 ` George Dunlap
0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-06-17 12:55 UTC (permalink / raw)
To: xen-devel
Cc: George Dunlap, Ian Campbell, Keir Fraser, Ian Jackson, Tim Deegan
[-- Attachment #1: Type: text/plain, Size: 710 bytes --]
There's no need for two exit paths each using rcu_unlock_domain() on
its own here.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -970,16 +970,10 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
break;
ret = xsm_schedop_shutdown(XSM_DM_PRIV, current->domain, d);
- if ( ret )
- {
- rcu_unlock_domain(d);
- return ret;
- }
-
- domain_shutdown(d, (u8)sched_remote_shutdown.reason);
+ if ( likely(!ret) )
+ domain_shutdown(d, sched_remote_shutdown.reason);
rcu_unlock_domain(d);
- ret = 0;
break;
}
[-- Attachment #2: simplify-schedop-remote-shutdown.patch --]
[-- Type: text/plain, Size: 758 bytes --]
slightly simplify SCHEDOP_remote_shutdown handling
There's no need for two exit paths each using rcu_unlock_domain() on
its own here.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -970,16 +970,10 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
break;
ret = xsm_schedop_shutdown(XSM_DM_PRIV, current->domain, d);
- if ( ret )
- {
- rcu_unlock_domain(d);
- return ret;
- }
-
- domain_shutdown(d, (u8)sched_remote_shutdown.reason);
+ if ( likely(!ret) )
+ domain_shutdown(d, sched_remote_shutdown.reason);
rcu_unlock_domain(d);
- ret = 0;
break;
}
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] slightly simplify SCHEDOP_remote_shutdown handling
2015-06-17 12:55 [PATCH] slightly simplify SCHEDOP_remote_shutdown handling Jan Beulich
@ 2015-06-17 12:59 ` Andrew Cooper
2015-06-17 12:59 ` George Dunlap
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2015-06-17 12:59 UTC (permalink / raw)
To: Jan Beulich, xen-devel
Cc: George Dunlap, Ian Campbell, Keir Fraser, Ian Jackson, Tim Deegan
On 17/06/15 13:55, Jan Beulich wrote:
> There's no need for two exit paths each using rcu_unlock_domain() on
> its own here.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] slightly simplify SCHEDOP_remote_shutdown handling
2015-06-17 12:55 [PATCH] slightly simplify SCHEDOP_remote_shutdown handling Jan Beulich
2015-06-17 12:59 ` Andrew Cooper
@ 2015-06-17 12:59 ` George Dunlap
1 sibling, 0 replies; 3+ messages in thread
From: George Dunlap @ 2015-06-17 12:59 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Ian Campbell, Keir Fraser, Ian Jackson, Tim Deegan
On 06/17/2015 01:55 PM, Jan Beulich wrote:
> There's no need for two exit paths each using rcu_unlock_domain() on
> its own here.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -970,16 +970,10 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
> break;
>
> ret = xsm_schedop_shutdown(XSM_DM_PRIV, current->domain, d);
> - if ( ret )
> - {
> - rcu_unlock_domain(d);
> - return ret;
> - }
> -
> - domain_shutdown(d, (u8)sched_remote_shutdown.reason);
> + if ( likely(!ret) )
> + domain_shutdown(d, sched_remote_shutdown.reason);
>
> rcu_unlock_domain(d);
> - ret = 0;
>
> break;
> }
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-17 13:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 12:55 [PATCH] slightly simplify SCHEDOP_remote_shutdown handling Jan Beulich
2015-06-17 12:59 ` Andrew Cooper
2015-06-17 12:59 ` George Dunlap
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.