From patchwork Thu Apr 14 17:07:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 8839721 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 942E6C0553 for ; Thu, 14 Apr 2016 17:10:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA343202EB for ; Thu, 14 Apr 2016 17:10:25 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D56ED20270 for ; Thu, 14 Apr 2016 17:10:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqkkk-0004D3-8l; Thu, 14 Apr 2016 17:08:26 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqkki-0004C8-V8 for xen-devel@lists.xensource.com; Thu, 14 Apr 2016 17:08:25 +0000 Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id 20/E8-26345-88ECF075; Thu, 14 Apr 2016 17:08:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42JxWrrBXrf9HH+ 4wbKTahb3prxnd2D02N63iz2AMYo1My8pvyKBNWP5sUlMBS8EKtadvcTUwLiZt4uRg0NCwF/i zXHtLkZODjYBXYmmLX/ZQGwRAWWJ401fWLsYuTiYBbYwSdy+eIAJJCEsECux/dZaMJtFQFVia c9xRhCbV8BDYsWjVcwgtoSAokT3swlggzgFPCWetz1gB7GFgGrOr9vLCrJXSEBNYu76eIhWQY mTM5+wgNjMAhISB1+8YIY4jVvib7f9BEa+WUiqZiGpWsDItIpRvTi1qCy1SNdUL6koMz2jJDc xM0fX0NBELze1uDgxPTUnMalYLzk/dxMjMJwYgGAH47rFzocYJTmYlER5TffwhwvxJeWnVGYk FmfEF5XmpBYfYpTh4FCS4P11BignWJSanlqRlpkDDGyYtAQHj5II70eQNG9xQWJucWY6ROoUo 6KUOO9vkIQASCKjNA+uDRZNlxhlpYR5GYEOEeIpSC3KzSxBlX/FKM7BqCTMa34WaApPZl4J3P RXQIuZgBaXveMFWVySiJCSamDU8Vr/e3fCE7a+FxnBDFvnJ3z9GPMvPfM509rCG2d7t+qd7Vr no9LAce3Fh7hs98s/ddV/G7BJH/a32NjyZ+di9p9+d0SnTn642E7vcRGjd+eSexP7M5VyUnMt /zxfe9Um+ManjJN94QlOPVerys8cd98gOcn83JMfk9JWBLra3f3Dr7ZeKvW9EktxRqKhFnNRc SIA7NUNhaECAAA= X-Env-Sender: prvs=90553d6a3=Ian.Jackson@citrix.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1460653701!35668589!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29430 invoked from network); 14 Apr 2016 17:08:23 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 14 Apr 2016 17:08:23 -0000 X-IronPort-AV: E=Sophos;i="5.24,485,1454976000"; d="scan'208";a="353779108" From: Ian Jackson To: Date: Thu, 14 Apr 2016 18:07:38 +0100 Message-ID: <1460653660-6654-2-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1460653660-6654-1-git-send-email-ian.jackson@eu.citrix.com> References: <1460653660-6654-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Juergen Gross , Wei Liu , George Dunlap , Ian Jackson , Dario Faggioli , Tim Deegan , Jan Beulich Subject: [Xen-devel] [PATCH 1/3] libxc: Revert "do some retries in xc_cpupool_removecpu() for EBUSY case" X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP libxc may be called from within long-running daemons such as libvirt. In such a system this sleep would enable an uncooperative or buggy guest to block all toolstack operations for an extended period. Sadly, therefore, such a retry loop is not feasible without a lot of engineering which is probably not appropriate. This reverts commit 1ef6beea187bca8d11152b6c7d987b2b9450f936 "libxc: do some retries in xc_cpupool_removecpu() for EBUSY case" Signed-off-by: Ian Jackson CC: Dario Faggioli CC: Wei Liu --- tools/libxc/xc_cpupool.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c index 261b9c9..c42273e 100644 --- a/tools/libxc/xc_cpupool.c +++ b/tools/libxc/xc_cpupool.c @@ -20,7 +20,6 @@ */ #include -#include #include "xc_private.h" static int do_sysctl_save(xc_interface *xch, struct xen_sysctl *sysctl) @@ -138,34 +137,17 @@ int xc_cpupool_addcpu(xc_interface *xch, return do_sysctl_save(xch, &sysctl); } -/* - * The hypervisor might return EBUSY when trying to remove a cpu from a - * cpupool when a domain running in this cpupool has pinned a vcpu - * temporarily. Do some retries in this case, perhaps the situation - * cleans up. - */ -#define NUM_RMCPU_BUSY_RETRIES 5 - int xc_cpupool_removecpu(xc_interface *xch, uint32_t poolid, int cpu) { - unsigned retries; - int err; DECLARE_SYSCTL; sysctl.cmd = XEN_SYSCTL_cpupool_op; sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_RMCPU; sysctl.u.cpupool_op.cpupool_id = poolid; sysctl.u.cpupool_op.cpu = (cpu < 0) ? XEN_SYSCTL_CPUPOOL_PAR_ANY : cpu; - for ( retries = 0; retries < NUM_RMCPU_BUSY_RETRIES; retries++ ) { - err = do_sysctl_save(xch, &sysctl); - if ( err < 0 && errno == EBUSY ) - sleep(1); - else - break; - } - return err; + return do_sysctl_save(xch, &sysctl); } int xc_cpupool_movedomain(xc_interface *xch,