From: Wei Liu <wei.liu2@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org,
Ian Jackson <ian.jackson@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v1 07/12] tmem/libxc: Squash XEN_SYSCTL_TMEM_OP_[SET|SAVE]..
Date: Wed, 28 Sep 2016 12:06:20 +0100 [thread overview]
Message-ID: <20160928110620.GY16004@citrix.com> (raw)
In-Reply-To: <1475055746-22401-8-git-send-email-konrad.wilk@oracle.com>
On Wed, Sep 28, 2016 at 05:42:21AM -0400, Konrad Rzeszutek Wilk wrote:
> Specifically:
>
> XEN_SYSCTL_TMEM_OP_SET_[WEIGHT,COMPRESS] are now done via:
>
> XEN_SYSCTL_TMEM_SET_CLIENT_INFO
>
> and XEN_SYSCTL_TMEM_OP_SAVE_GET_[VERSION,MAXPOOLS,
> CLIENT_WEIGHT, CLIENT_FLAGS] can now be retrieved via:
>
> XEN_SYSCTL_TMEM_GET_CLIENT_INFO
>
> All this information is now in 'struct tmem_client' and
> that is what we pass around.
>
> Hypervisor wise we had to do a bit of casting. The
> 'struct xen_sysctl_tmem_op'->buf variable is a pointer to
> char. Casting that using the guest_handle_cast to a structure
> (struct tmem_client) does not work. Hence we first have to
> cast it a void and then to xen_sysctl_tmem_client_t.
> This could be improved by having an union and in fact the
> patch titled:
> "tmem: Handle 'struct tmem_info' as a seperate field in the"
> does that. It could be squashed in here but that can make
> it harder to review.
>
> On the toolstack, prior to this patch, the xc_tmem_control
> would use the bounce buffer only when arg1 was set and the cmd
> was to list. With the 'XEN_SYSCTL_TMEM_OP_SET_[WEIGHT|COMPRESS]'
> that made sense as the 'arg1' would have the value. However
> for the other ones (say XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_UUID)
> the 'arg1' would be the length of the 'buf'. If this
> confusing don't despair, patch patch titled:
> tmem/xc_tmem_control: Rename 'arg1' to 'len' and 'arg2' to arg.
> takes care of that.
>
> The acute reader of the toolstack code will discover that
> we only used the bounce buffer for LIST, not for any other
> subcommands that used 'buf'!?! Which means that the contents
> of 'buf' would never be copied back to the calleer 'buf'!
>
> I am not sure how this could possibly work, perhaps Xen 4.1
> (when this was introduced) was more relaxed about the bounce buffer
> being enabled. Anyhow this fixes xc_tmem_control to do it for
> any subcommand that has 'arg1'.
>
> Lastly some of the checks in xc_tmem_[restore|save] are removed
> as they can't ever be reached (not even sure how they could
> have been reached in the original submission). One of them
> is the check for the weight against -1 when in fact the
> hypervisor would never have provided that value.
>
> Now the checks are simple - as the hypercall always returns
> ->version and ->maxpools (which is mirroring how it was done
> prior to this patch). But if one wants to check the if a guest
> has any tmem activity then the patch titled
> "tmem: Batch and squash XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_
> [FLAGS,NPAGES,UUID] in one sub-call: XEN_SYSCTL_TMEM_OP_GET_POOLS."
> adds an ->nr_pools to check for that.
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
>
> v1: New submission.
> ---
> tools/libxc/xc_tmem.c | 72 ++++++++++++----------------
> tools/libxl/libxl.c | 26 +++++++---
> tools/python/xen/lowlevel/xc/xc.c | 2 -
Acked-by: Wei Liu <wei.liu2@citrix.com>
I welcome the effort to clean up tmem but I don't have any knowledge how
it works, nor can I test your code, so I can only trust your judgement
on this.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-09-28 11:06 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 9:42 [PATCH v1] Tmem cleanups/improvements for v4.8 Konrad Rzeszutek Wilk
2016-09-28 9:42 ` [PATCH v1 01/12] libxc/tmem/restore: Remove call to XEN_SYSCTL_TMEM_OP_SAVE_GET_VERSION Konrad Rzeszutek Wilk
2016-09-28 11:00 ` Wei Liu
2016-09-28 9:42 ` [PATCH v1 02/12] tmem: Retire XEN_SYSCTL_TMEM_OP_[SET_CAP|SAVE_GET_CLIENT_CAP] Konrad Rzeszutek Wilk
2016-09-28 11:00 ` Wei Liu
2016-09-28 15:03 ` Konrad Rzeszutek Wilk
2016-09-28 12:10 ` Jan Beulich
2016-09-30 14:04 ` Konrad Rzeszutek Wilk
2016-09-28 9:42 ` [PATCH v1 03/12] tmem: Wrap tmem dedup code with CONFIG_TMEM_DEDUP Konrad Rzeszutek Wilk
2016-09-28 12:18 ` Jan Beulich
2016-09-28 9:42 ` [PATCH v1 04/12] tmem: Wrap tmem tze code with CONFIG_TMEM_TZE Konrad Rzeszutek Wilk
2016-09-28 12:19 ` Jan Beulich
2016-09-28 9:42 ` [PATCH v1 05/12] tmem: Delete deduplication (and tze) code Konrad Rzeszutek Wilk
2016-09-28 12:34 ` Jan Beulich
2016-09-28 15:05 ` Konrad Rzeszutek Wilk
2016-09-28 9:42 ` [PATCH v1 06/12] tmem: Move client weight, frozen, live_migrating, and compress Konrad Rzeszutek Wilk
2016-09-28 12:39 ` Jan Beulich
2016-09-28 9:42 ` [PATCH v1 07/12] tmem/libxc: Squash XEN_SYSCTL_TMEM_OP_[SET|SAVE] Konrad Rzeszutek Wilk
2016-09-28 11:06 ` Wei Liu [this message]
2016-09-28 12:50 ` Jan Beulich
2016-09-28 9:42 ` [PATCH v1 08/12] tmem: Handle 'struct tmem_info' as a seperate field in the Konrad Rzeszutek Wilk
2016-09-28 11:00 ` Wei Liu
2016-09-28 12:56 ` Jan Beulich
2016-09-30 14:36 ` Konrad Rzeszutek Wilk
2016-09-30 14:56 ` Jan Beulich
2016-09-30 16:51 ` Konrad Rzeszutek Wilk
2016-09-28 9:42 ` [PATCH v1 09/12] tmem: Check version and maxpools when XEN_SYSCTL_TMEM_SET_CLIENT_INFO Konrad Rzeszutek Wilk
2016-09-28 11:00 ` Wei Liu
2016-09-28 12:58 ` Jan Beulich
2016-09-28 9:42 ` [PATCH v1 10/12] tmem: Unify XEN_SYSCTL_TMEM_OP_[[SAVE_[BEGIN|END]|RESTORE_BEGIN] Konrad Rzeszutek Wilk
2016-09-28 11:06 ` Wei Liu
2016-09-28 13:00 ` Jan Beulich
2016-09-28 9:42 ` [PATCH v1 11/12] tmem/xc_tmem_control: Rename 'arg1' to 'len' and 'arg2' to arg Konrad Rzeszutek Wilk
2016-09-28 11:07 ` Wei Liu
2016-09-28 9:42 ` [PATCH v1 12/12] tmem: Batch and squash XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_[FLAGS, NPAGES, UUID] in one sub-call: XEN_SYSCTL_TMEM_OP_GET_POOLS Konrad Rzeszutek Wilk
2016-09-28 11:07 ` Wei Liu
2016-09-28 13:11 ` Jan Beulich
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=20160928110620.GY16004@citrix.com \
--to=wei.liu2@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=xen-devel@lists.xenproject.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.