From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH for-4.6 v2 4/4] oxenstored: move sd_notify_ready out of main loop Date: Mon, 10 Aug 2015 09:04:20 +0100 Message-ID: <55C85B04.9020803@citrix.com> References: <1439193619-28833-1-git-send-email-wei.liu2@citrix.com> <1439193619-28833-5-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZOi4H-0007uY-BN for xen-devel@lists.xenproject.org; Mon, 10 Aug 2015 08:04:25 +0000 In-Reply-To: <1439193619-28833-5-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu , Xen-devel Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org On 10/08/2015 09:00, Wei Liu wrote: > Oxenstored only needs to notify systemd its readiness state once. Move > sd_notify_ready out of main loop. > > Signed-off-by: Wei Liu > Acked-by: Dave Scott > --- > For 4.6: avoid wasting CPU cycles, easy to reason its correctness. > > There is a small risk that either I wrote the wrong code or I > misunderstand the usage of systemd API. However I've tested the modified > oxenstored it worked fine. > --- > tools/ocaml/xenstored/xenstored.ml | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml > index f484024..42b8183 100644 > --- a/tools/ocaml/xenstored/xenstored.ml > +++ b/tools/ocaml/xenstored/xenstored.ml > @@ -428,11 +428,11 @@ let _ = > process_domains store cons domains > in > > + if Systemd.launched_by_systemd () then > + Systemd.sd_notify_ready (); > while not !quit > do > try > - if Systemd.launched_by_systemd() then > - Systemd.sd_notify_ready (); You have tabs/spaces issues here. However, the two oxenstored patches are Tested-by: Andrew Cooper . XenServer testing over the weekend has shown no regressions. ~Andrew