From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [RFC PATCH 2/3] Dynamically allocate domain->evtchn, also bump EVTCHNS_PER_BUCKET to 512. Date: Mon, 31 Dec 2012 18:22:34 +0000 Message-ID: <1356978155-18293-3-git-send-email-wei.liu2@citrix.com> References: <1356978155-18293-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1356978155-18293-1-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: xen-devel@lists.xen.org Cc: Wei Liu , Wei Liu List-Id: xen-devel@lists.xenproject.org From: Wei Liu Signed-off-by: Wei Liu --- xen/common/event_channel.c | 8 ++++++++ xen/include/xen/sched.h | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 87e422e..9898f8e 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -1172,6 +1172,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport) int evtchn_init(struct domain *d) { + d->evtchn = (struct evtchn **) + xzalloc_array(struct evtchn *, NR_EVTCHN_BUCKETS); + + if ( !d->evtchn ) + return -ENOMEM; + spin_lock_init(&d->event_lock); d->evtchn_level = 2; if ( get_free_port(d) != 0 ) @@ -1215,6 +1221,8 @@ void evtchn_destroy(struct domain *d) spin_unlock(&d->event_lock); clear_global_virq_handlers(d); + + xfree(d->evtchn); } diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 1c43e0a..5f23213 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -63,7 +63,7 @@ extern struct domain *dom0; }; \ __v;}) -#define EVTCHNS_PER_BUCKET 128 +#define EVTCHNS_PER_BUCKET 512 #define NR_EVTCHN_BUCKETS (NR_EVENT_CHANNELS / EVTCHNS_PER_BUCKET) struct evtchn @@ -272,7 +272,7 @@ struct domain spinlock_t rangesets_lock; /* Event channel information. */ - struct evtchn *evtchn[NR_EVTCHN_BUCKETS]; + struct evtchn **evtchn; spinlock_t event_lock; unsigned int evtchn_level; -- 1.7.10.4