From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754938AbdBGWit convert rfc822-to-8bit (ORCPT ); Tue, 7 Feb 2017 17:38:49 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:23997 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbdBGWir (ORCPT ); Tue, 7 Feb 2017 17:38:47 -0500 Subject: Re: [PATCH v3 3/3] xen: optimize xenbus driver for multiple concurrent xenstore accesses To: Juergen Gross , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org References: <20170123100918.13523-1-jgross@suse.com> <20170123100918.13523-4-jgross@suse.com> <46b54be4-297a-af8f-aac2-f2a080752034@oracle.com> <252c5d0b-0195-0a56-e236-21e8da449071@oracle.com> <12bbe7e7-eea4-09d0-8282-0b04504daeb2@suse.com> From: Boris Ostrovsky Message-ID: <34056227-cffb-fe01-ee79-8f9a40a90ea0@oracle.com> Date: Tue, 7 Feb 2017 17:39:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/07/2017 12:51 PM, Boris Ostrovsky wrote: > On 01/24/2017 11:23 AM, Juergen Gross wrote: >> On 24/01/17 14:47, Boris Ostrovsky wrote: >>> On 01/23/2017 01:59 PM, Boris Ostrovsky wrote: >>>> On 01/23/2017 05:09 AM, Juergen Gross wrote: >>>>> Handling of multiple concurrent Xenstore accesses through xenbus driver >>>>> either from the kernel or user land is rather lame today: xenbus is >>>>> capable to have one access active only at one point of time. >>>>> >>>>> >>> This patch appears to break save/restore: >> Hmm, tried multiple times, but I can't reproduce this issue. >> >> Anything special in the setup? I tried a 64 bit pv guest and did >> "xl save". >> >> Do I have to run some load in parallel? > Any luck reproducing this? I am still failing the test on dumpdata but I > couldn't reproduce it on another system. The problem appears to be xs_state_users being non-zero when we call xs_suspend_enter(). >>From what I understand this is caused by xs_request_exit() not decrementing it when closing a transaction. This seems to be happening when XS_TRANSACTION_END transaction returns XS_ERROR (I haven't traced what causes this error but it doesn't appear to cause any visible harm). Does the patch below make sense? diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index e62cb09..ffd5fac 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -140,7 +140,7 @@ void xs_request_exit(struct xb_req_data *req) spin_lock(&xs_state_lock); xs_state_users--; if ((req->type == XS_TRANSACTION_START && req->msg.type == XS_ERROR) || - req->msg.type == XS_TRANSACTION_END) + req->type == XS_TRANSACTION_END) xs_state_users--; spin_unlock(&xs_state_lock); I ran a few tests on dumpdata and they completed successfully. I'll keep this for the overnight runs too, with a different Xen version. -boris