From: David Vrabel <david.vrabel@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: "Keir (Xen.org)" <keir@xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
"jbeulich@suse.com" <jbeulich@suse.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [RFC PATCH V3 06/22] Define extended event channel registration interface
Date: Thu, 28 Feb 2013 12:32:40 +0000 [thread overview]
Message-ID: <512F4E68.2000707@citrix.com> (raw)
In-Reply-To: <1361975655-22295-7-git-send-email-wei.liu2@citrix.com>
On 27/02/13 14:33, Wei Liu wrote:
> This interface allows user to query supported event channel types. If we need
> to disable a specific ABI in the future, we just need to remove the dead code
> and clear corresponding feature bit.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> xen/include/public/event_channel.h | 44 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
> index 07ff321..dff3364 100644
> --- a/xen/include/public/event_channel.h
> +++ b/xen/include/public/event_channel.h
> @@ -71,6 +71,7 @@
> #define EVTCHNOP_bind_vcpu 8
> #define EVTCHNOP_unmask 9
> #define EVTCHNOP_reset 10
> +#define EVTCHNOP_register_extended 11
> /* ` } */
>
> typedef uint32_t evtchn_port_t;
> @@ -258,6 +259,49 @@ struct evtchn_reset {
> typedef struct evtchn_reset evtchn_reset_t;
>
> /*
> + * EVTCHNOP_register_extended: Register extended event channel
> + * NOTES:
> + * 1. Currently only 3-level is supported.
> + * 2. Should fall back to 2-level if this call fails.
> + */
> +/* 64 bit guests need 8 pages for evtchn_pending and evtchn_mask for
> + * 256k event channels while 32 bit ones only need 1 page for 32k
> + * event channels. */
> +#define EVTCHN_MAX_L3_PAGES 8
> +struct evtchn_register_3level {
> + /* IN parameters. */
> + uint32_t nr_pages; /* for evtchn_{pending,mask} */
> + uint32_t nr_vcpus; /* for l2sel_{mfns,offsets} */
> + XEN_GUEST_HANDLE(xen_pfn_t) evtchn_pending;
> + XEN_GUEST_HANDLE(xen_pfn_t) evtchn_mask;
> + XEN_GUEST_HANDLE(xen_pfn_t) l2sel_mfns;
> + XEN_GUEST_HANDLE(xen_pfn_t) l2sel_offsets;
> +};
Registering per-VCPU resources at start-of-day doesn't seem like the
right thing to do here. Why waste resources for VCPUs that are never
going to be used? And I don't think we want to constraint how VCPU
hotplug works by requiring resource for all possible VCPUs to be
allocated up-front.
If there isn't enough resource for all VCPUs to all use the 3-level ABI
then I think the preferred trade off is to offline the VCPUs that cannot
get resources and not fallback to the 2-level ABI.
The event channel limit is a hard scalability limit, number of VCPUs is
a soft limit, so a guest is more likely to gracefully degrade in
usefulness if it loses VCPUs instead of available event channels.
Obviously, if 3-level is requested and the boot VCPUs fails to enable
it, then it should fallback to 2-level because this is better than just
panicking.
> +typedef struct evtchn_register_3level evtchn_register_3level_t;
> +DEFINE_XEN_GUEST_HANDLE(evtchn_register_3level_t);
> +
> +/* commands:
> + * EVTCHN_EXTENDED_QUERY(0): query supported extended event channel types,
> + * _NONE supported types are or'ed in return value of
> + * the hypercall.
> + * EVTCHN_EXTENDED_*: specific extended event channel subcommand.
Combining query and register makes no sense.
> + */
> +#define EVTCHN_EXTENDED_QUERY 0
> +/* supported extended event channel */
> +#define EVTCHN_EXTENDED_NONE 0
> +#define _EVTCHN_EXTENDED_L3 0
> +#define EVTCHN_EXTENDED_L3 (1U << _EVTCHN_EXTENDED_L3)
> +struct evtchn_register_extended {
> + /* IN parameters. */
> + uint32_t cmd;
> + union {
> + evtchn_register_3level_t l3;
> + } u;
> +};
Adding new members to this union as new event channels ABI are
implemented are going to change its size and potentially the alignment
of the union member. This seems a potential for future ABI
compatibility problems. See also by comment to patch 18.
There doesn't seem to be any value in having a single register sub-op
for all possible future ABIs. Just add a new sub-op for each new ABI.
David
next prev parent reply other threads:[~2013-02-28 12:32 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 14:33 [RFC PATCH V3] Implement 3-level event channel in Xen Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 01/22] Clean up trailing whitespaces Wei Liu
2013-02-28 11:30 ` David Vrabel
2013-02-28 11:36 ` Wei Liu
2013-02-28 11:38 ` Jan Beulich
2013-02-28 12:14 ` Ian Campbell
2013-02-28 12:29 ` Wei Liu
2013-02-28 13:08 ` Jan Beulich
2013-02-27 14:33 ` [RFC PATCH V3 02/22] Dynamically allocate d->evtchn Wei Liu
2013-02-27 16:35 ` Jan Beulich
2013-02-27 14:33 ` [RFC PATCH V3 03/22] Move event channel macros / struct definition to proper place Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 04/22] flask: include xen/event.h Wei Liu
2013-02-28 11:20 ` David Vrabel
2013-02-28 11:22 ` Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 05/22] Change MAX_EVTCHNS macro to max_evtchns inline function Wei Liu
2013-02-28 11:58 ` David Vrabel
2013-02-28 13:59 ` Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 06/22] Define extended event channel registration interface Wei Liu
2013-02-27 16:42 ` Jan Beulich
2013-02-28 11:25 ` Wei Liu
2013-02-28 11:32 ` Jan Beulich
2013-02-28 11:41 ` Wei Liu
2013-02-28 12:32 ` David Vrabel [this message]
2013-02-28 15:04 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 07/22] Add evtchn_extended in struct domain Wei Liu
2013-02-28 11:55 ` David Vrabel
2013-02-27 14:34 ` [RFC PATCH V3 08/22] Calculate max event channels for EVTCHN_EXTENDED_L3 Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 09/22] Bump EVTCHNS_PER_BUCKET to 512 Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 10/22] Add evtchn_is_{pending, masked} and evtchn_clear_pending Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 11/22] Update Xen public header Wei Liu
2013-02-28 12:00 ` David Vrabel
2013-02-27 14:34 ` [RFC PATCH V3 12/22] Add supported extended event channel ABI bitmap Wei Liu
2013-02-27 16:47 ` Jan Beulich
2013-02-28 11:21 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 13/22] Add evtchn_abi_str Wei Liu
2013-02-27 16:51 ` Jan Beulich
2013-02-28 11:28 ` Wei Liu
2013-02-28 11:33 ` Jan Beulich
2013-02-27 14:34 ` [RFC PATCH V3 14/22] Add control structures for 3-level event channel Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 15/22] Genneralized event channel operations Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 16/22] Introduce some macros for event channels Wei Liu
2013-02-27 16:53 ` Jan Beulich
2013-02-27 17:04 ` Ian Campbell
2013-02-28 7:54 ` Jan Beulich
2013-02-28 8:35 ` Ian Campbell
2013-02-28 11:17 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 17/22] Infrastructure to manipulate 3-level event channel pages Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 18/22] Implement EVTCHNOP_register_extended Wei Liu
2013-02-28 12:33 ` David Vrabel
2013-02-27 14:34 ` [RFC PATCH V3 19/22] Enable exteneded event channel ABI query Wei Liu
2013-02-28 12:36 ` David Vrabel
2013-02-27 14:34 ` [RFC PATCH V3 20/22] Implement 3-level event channel routines Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 21/22] Only allow extended event channel on Dom0 and driver domains Wei Liu
2013-02-27 16:58 ` Jan Beulich
2013-02-28 11:19 ` Wei Liu
2013-02-28 12:43 ` David Vrabel
2013-02-28 19:29 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 22/22] libxl: add evtchn_extended flag Wei Liu
2013-02-28 12:48 ` David Vrabel
2013-03-01 11:55 ` Ian Jackson
2013-02-27 16:28 ` [RFC PATCH V3] Implement 3-level event channel in Xen Keir Fraser
2013-02-27 17:01 ` Jan Beulich
2013-02-27 19:49 ` Keir Fraser
2013-02-27 23:19 ` Wei Liu
2013-02-28 5:58 ` Keir Fraser
2013-02-28 7:23 ` Jan Beulich
2013-03-01 12:00 ` Ian Jackson
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=512F4E68.2000707@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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.