From patchwork Fri Sep 30 18:11:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9358731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0331860757 for ; Fri, 30 Sep 2016 18:14:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFA5A2A14C for ; Fri, 30 Sep 2016 18:14:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E48492A153; Fri, 30 Sep 2016 18:14:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id C7F102A14C for ; Fri, 30 Sep 2016 18:14:42 +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 1bq2IL-0005et-MB; Fri, 30 Sep 2016 18:12:25 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bq2IJ-0005aU-OA for xen-devel@lists.xenproject.org; Fri, 30 Sep 2016 18:12:23 +0000 Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id 29/DE-03778-70BAEE75; Fri, 30 Sep 2016 18:12:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsXSO6nOVZdt9bt wg+89ohbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bUXZuYCna6Vrx5x9LAeMCsi5GLQ0hgMpPE jv5lrBDON0aJf8cOM0I4GxklFh06zQzhTGCUODxpH0sXIwcHm4CJxJtVjl2MnBwiAqYS2yeeZ AGpYRaYxijx6dQRJpCEsECoxLELPUwg9SwCqhKPpzOCmLwCrhIr1kSDmBIC8hLPbteDFHMKuE nc3jKNEcQWAqro/HOCFcSWEDCWaH97kW0CI98CRoZVjBrFqUVlqUW6RiZ6SUWZ6RkluYmZObq GBqZ6uanFxYnpqTmJScV6yfm5mxiBQVLPwMC4g/HmZL9DjJIcTEqivLJH34YL8SXlp1RmJBZn xBeV5qQWH2KU4eBQkuB9uPJduJBgUWp6akVaZg4wXGHSEhw8SiK8EiBp3uKCxNzizHSI1ClGR Slx3pUgCQGQREZpHlwbLEYuMcpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLm3QoyhSczrwRu+i ugxUxAi/OPvgFZXJKIkJJqYCz/++DGIbnYz0ffBfKdF77srKgd4cpkfrzl3/HvfK/mpLhtS79 eaHDq2FOf6RkhKtpTZH+aBfCtsmXkZA+617P1qIZ/3A0V5fT30w6Ih8VPVV2psc6ap3jxRtUM J+HLzVncQttWXRV1yMp9umn3ix/fb0/9umnyKraJvyRePbvgFakvGDvlyy0lluKMREMt5qLiR ABM33CZjAIAAA== X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1475259140!62673566!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 56766 invoked from network); 30 Sep 2016 18:12:22 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Sep 2016 18:12:22 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8UICEQX005484 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Sep 2016 18:12:14 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u8UICEvo022418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 Sep 2016 18:12:14 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u8UICCE5029228; Fri, 30 Sep 2016 18:12:13 GMT Received: from localhost.us.oracle.com (/10.154.132.195) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Sep 2016 11:12:11 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, konrad@kernel.org Date: Fri, 30 Sep 2016 14:11:47 -0400 Message-Id: <1475259114-8693-3-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1475259114-8693-1-git-send-email-konrad.wilk@oracle.com> References: <1475259114-8693-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: Wei Liu , Ian Jackson , Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v2 2/9] tmem: Retire XEN_SYSCTL_TMEM_OP_[SET_CAP|SAVE_GET_CLIENT_CAP] 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP It is not used by anything. Its intent was to complement the 'weight' attribute but there hadn't been any request for this. If there is a need to resurface it, it can be integrated back via the XEN_SYSCTL_TMEM_SET_CLIENT_INFO introduced in "tmem/libxc: Squash XEN_SYSCTL_TMEM_OP_[SET|SAVE].." Acked-by: Wei Liu Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ian Jackson Cc: Wei Liu v1: First submission v2: Added Wei's Ack. Deleted ->cap from 'struct client' --- docs/man/xl.pod.1.in | 4 ---- tools/libxc/xc_tmem.c | 13 +++---------- tools/libxl/libxl.c | 4 +--- tools/libxl/xl_cmdtable.c | 1 - tools/python/xen/lowlevel/xc/xc.c | 1 - xen/common/tmem_control.c | 16 ++-------------- xen/include/public/sysctl.h | 2 -- xen/include/xen/tmem_xen.h | 1 - 8 files changed, 6 insertions(+), 36 deletions(-) diff --git a/docs/man/xl.pod.1.in b/docs/man/xl.pod.1.in index 803c67e..8e2aa5b 100644 --- a/docs/man/xl.pod.1.in +++ b/docs/man/xl.pod.1.in @@ -1589,10 +1589,6 @@ B Weight (int) -=item B<-c> I - -Cap (int) - =item B<-p> I Compress (int) diff --git a/tools/libxc/xc_tmem.c b/tools/libxc/xc_tmem.c index 31ae3f5..24c8b43 100644 --- a/tools/libxc/xc_tmem.c +++ b/tools/libxc/xc_tmem.c @@ -212,7 +212,7 @@ int xc_tmem_save(xc_interface *xch, int marker = field_marker; int i, j; uint32_t max_pools, version; - uint32_t weight, cap, flags; + uint32_t weight, flags; uint32_t pool_id; uint32_t minusone = -1; struct tmem_handle *h; @@ -238,10 +238,7 @@ int xc_tmem_save(xc_interface *xch, weight = xc_tmem_control(xch,0,XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_WEIGHT,dom,0,0,NULL); if ( write_exact(io_fd, &weight, sizeof(weight)) ) return -1; - cap = xc_tmem_control(xch,0,XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_CAP,dom,0,0,NULL); - if ( write_exact(io_fd, &cap, sizeof(cap)) ) - return -1; - if ( flags == -1 || weight == -1 || cap == -1 ) + if ( flags == -1 || weight == -1 ) return -1; if ( write_exact(io_fd, &minusone, sizeof(minusone)) ) return -1; @@ -384,7 +381,7 @@ int xc_tmem_restore(xc_interface *xch, int dom, int io_fd) uint32_t this_max_pools, this_version; uint32_t pool_id; uint32_t minusone; - uint32_t weight, cap, flags; + uint32_t weight, flags; int checksum = 0; if ( read_exact(io_fd, &this_version, sizeof(this_version)) ) @@ -410,10 +407,6 @@ int xc_tmem_restore(xc_interface *xch, int dom, int io_fd) return -1; if ( xc_tmem_control(xch,0,XEN_SYSCTL_TMEM_OP_SET_WEIGHT,dom,0,0,NULL) < 0 ) return -1; - if ( read_exact(io_fd, &cap, sizeof(cap)) ) - return -1; - if ( xc_tmem_control(xch,0,XEN_SYSCTL_TMEM_OP_SET_CAP,dom,0,0,NULL) < 0 ) - return -1; if ( read_exact(io_fd, &minusone, sizeof(minusone)) ) return -1; while ( read_exact(io_fd, &pool_id, sizeof(pool_id)) == 0 && pool_id != -1 ) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 9bf1f4c..ab44e3c 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -6156,8 +6156,6 @@ static int32_t tmem_setop_from_string(char *set_name) { if (!strcmp(set_name, "weight")) return XEN_SYSCTL_TMEM_OP_SET_WEIGHT; - else if (!strcmp(set_name, "cap")) - return XEN_SYSCTL_TMEM_OP_SET_CAP; else if (!strcmp(set_name, "compress")) return XEN_SYSCTL_TMEM_OP_SET_COMPRESS; else @@ -6171,7 +6169,7 @@ int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name, uint32_t set) GC_INIT(ctx); if (subop == -1) { - LOGEV(ERROR, -1, "Invalid set, valid sets are "); + LOGEV(ERROR, -1, "Invalid set, valid sets are "); rc = ERROR_INVAL; goto out; } diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c index 5a57342..588d5d9 100644 --- a/tools/libxl/xl_cmdtable.c +++ b/tools/libxl/xl_cmdtable.c @@ -407,7 +407,6 @@ struct cmd_spec cmd_table[] = { "[|-a] [-w[=WEIGHT]|-c[=CAP]|-p[=COMPRESS]]", " -a Operate on all tmem\n" " -w WEIGHT Weight (int)\n" - " -c CAP Cap (int)\n" " -p COMPRESS Compress (int)", }, { "tmem-shared-auth", diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 8411789..287f590 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -1641,7 +1641,6 @@ static PyObject *pyxc_tmem_control(XcObject *self, case XEN_SYSCTL_TMEM_OP_FREEZE: case XEN_SYSCTL_TMEM_OP_DESTROY: case XEN_SYSCTL_TMEM_OP_SET_WEIGHT: - case XEN_SYSCTL_TMEM_OP_SET_CAP: case XEN_SYSCTL_TMEM_OP_SET_COMPRESS: default: break; diff --git a/xen/common/tmem_control.c b/xen/common/tmem_control.c index 81a2414..ca34852 100644 --- a/xen/common/tmem_control.c +++ b/xen/common/tmem_control.c @@ -103,9 +103,9 @@ static int tmemc_list_client(struct client *c, tmem_cli_va_param_t buf, struct tmem_pool *p; bool_t s; - n = scnprintf(info,BSIZE,"C=CI:%d,ww:%d,ca:%d,co:%d,fr:%d," + n = scnprintf(info,BSIZE,"C=CI:%d,ww:%d,co:%d,fr:%d," "Tc:%"PRIu64",Ge:%ld,Pp:%ld,Gp:%ld%c", - c->cli_id, c->weight, c->cap, c->compress, c->frozen, + c->cli_id, c->weight, c->compress, c->frozen, c->total_cycles, c->succ_eph_gets, c->succ_pers_puts, c->succ_pers_gets, use_long ? ',' : '\n'); if (use_long) @@ -273,11 +273,6 @@ static int __tmemc_set_var(struct client *client, uint32_t subop, uint32_t arg1) atomic_sub(old_weight,&tmem_global.client_weight_total); atomic_add(client->weight,&tmem_global.client_weight_total); break; - case XEN_SYSCTL_TMEM_OP_SET_CAP: - client->cap = arg1; - tmem_client_info("tmem: cap set to %d for %s=%d\n", - arg1, tmem_cli_id_str, cli_id); - break; case XEN_SYSCTL_TMEM_OP_SET_COMPRESS: if ( tmem_dedup_enabled() ) { @@ -341,11 +336,6 @@ static int tmemc_save_subop(int cli_id, uint32_t pool_id, break; rc = client->weight == -1 ? -2 : client->weight; break; - case XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_CAP: - if ( client == NULL ) - break; - rc = client->cap == -1 ? -2 : client->cap; - break; case XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_FLAGS: if ( client == NULL ) break; @@ -404,7 +394,6 @@ int tmem_control(struct xen_sysctl_tmem_op *op) guest_handle_cast(op->buf, char), op->arg1, op->arg2); break; case XEN_SYSCTL_TMEM_OP_SET_WEIGHT: - case XEN_SYSCTL_TMEM_OP_SET_CAP: case XEN_SYSCTL_TMEM_OP_SET_COMPRESS: ret = tmemc_set_var(op->cli_id, cmd, op->arg1); break; @@ -414,7 +403,6 @@ int tmem_control(struct xen_sysctl_tmem_op *op) case XEN_SYSCTL_TMEM_OP_SAVE_GET_VERSION: case XEN_SYSCTL_TMEM_OP_SAVE_GET_MAXPOOLS: case XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_WEIGHT: - case XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_CAP: case XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_FLAGS: case XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_FLAGS: case XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_NPAGES: diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h index fd0fa67..c493f33 100644 --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -768,14 +768,12 @@ DEFINE_XEN_GUEST_HANDLE(xen_sysctl_psr_cat_op_t); #define XEN_SYSCTL_TMEM_OP_DESTROY 3 #define XEN_SYSCTL_TMEM_OP_LIST 4 #define XEN_SYSCTL_TMEM_OP_SET_WEIGHT 5 -#define XEN_SYSCTL_TMEM_OP_SET_CAP 6 #define XEN_SYSCTL_TMEM_OP_SET_COMPRESS 7 #define XEN_SYSCTL_TMEM_OP_QUERY_FREEABLE_MB 8 #define XEN_SYSCTL_TMEM_OP_SAVE_BEGIN 10 #define XEN_SYSCTL_TMEM_OP_SAVE_GET_VERSION 11 #define XEN_SYSCTL_TMEM_OP_SAVE_GET_MAXPOOLS 12 #define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_WEIGHT 13 -#define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_CAP 14 #define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_FLAGS 15 #define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_FLAGS 16 #define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_NPAGES 17 diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h index 582951a..86a5b24 100644 --- a/xen/include/xen/tmem_xen.h +++ b/xen/include/xen/tmem_xen.h @@ -409,7 +409,6 @@ struct client { long eph_count, eph_count_max; domid_t cli_id; uint32_t weight; - uint32_t cap; bool_t compress; bool_t frozen; bool_t shared_auth_required;