|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 1/8] tmem: Don't crash/hang/leak hypervisor when using shared pools within an guest.
On Thu, Aug 27, 2015 at 07:01:56AM -0400, Konrad Rzeszutek Wilk wrote:
[...]
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> ---
> xen/common/tmem.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/xen/common/tmem.c b/xen/common/tmem.c
> index f2dc26e..572944e 100644
> --- a/xen/common/tmem.c
> +++ b/xen/common/tmem.c
> @@ -1037,6 +1037,9 @@ static int shared_pool_join(struct tmem_pool *pool,
> struct client *new_client)
> tmem_client_info("adding new %s %d to shared pool owned by %s %d\n",
> tmem_client_str, new_client->cli_id, tmem_client_str,
> pool->client->cli_id);
> + else if (pool->shared_count)
Coding style.
> + tmem_client_info("inter-guest sharing of shared pool %s by client
> %d\n",
> + tmem_client_str, pool->client->cli_id);
> ++pool->shared_count;
> return 0;
> }
> @@ -1056,7 +1059,10 @@ static void shared_pool_reassign(struct tmem_pool
> *pool)
> }
> old_client->pools[pool->pool_id] = NULL;
> sl = list_entry(pool->share_list.next, struct share_list, share_list);
> - ASSERT(sl->client != old_client);
> + /*
> + * The sl->client can be old_client if there are multiple shared pools
> + * within an guest.
> + */
> pool->client = new_client = sl->client;
> for (poolid = 0; poolid < MAX_POOLS_PER_DOMAIN; poolid++)
> if (new_client->pools[poolid] == pool)
> @@ -1982,6 +1988,8 @@ static int do_tmem_new_pool(domid_t this_cli_id,
> {
> INIT_LIST_HEAD(&pool->share_list);
> pool->shared_count = 0;
> + if (shared_pool_join(pool, client))
Coding style.
> + goto fail;
> global_shared_pools[first_unused_s_poolid] = pool;
> }
> }
> --
> 2.1.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |