Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562446

Re: [PATCH v2 3/3] xen: optimize xenbus driver for multiple concurrent xenstore accesses

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Juergen Gross <jgross@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/3] xen: optimize xenbus driver for multiple concurrent xenstore accesses
Date Thu, 19 Jan 2017 08:50:01 +0100
Message-ID <t1fDP-73Y-9@gated-at.bofh.it> (permalink)
References <t0giB-1uH-15@gated-at.bofh.it> <t0giB-1uH-13@gated-at.bofh.it> <t17mX-1Gi-39@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Date Thu, 19 Jan 2017 08:24:29 +0100
X-Original-Message-ID <78661c52-dd9e-0030-fe37-eb31c4e42fbb@suse.com>
X-Original-References <20170116141533.8946-1-jgross@suse.com> <20170116141533.8946-4-jgross@suse.com> <ac2bf8f6-b2d5-ae3a-e588-02e879513429@oracle.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1562446

Show key headers only | View raw


On 18/01/17 21:14, Boris Ostrovsky wrote:
> On 01/16/2017 09:15 AM, Juergen Gross wrote:
>> +
>> +static uint32_t xs_request_enter(struct xb_req_data *req)
>> +{
>> +	uint32_t rq_id;
>> +
>> +	req->type = req->msg.type;
>> +
>> +	spin_lock(&xs_state_lock);
>> +	for (;;) {
>> +		if (req->msg.tx_id != 0)
>> +			break;
>> +		if (xs_suspend_active) {
>> +			spin_unlock(&xs_state_lock);
>> +			wait_event(xs_state_enter_wq, xs_suspend_active == 0);
>> +			spin_lock(&xs_state_lock);
>> +			continue;
>> +		}
>> +		if (req->type == XS_TRANSACTION_START)
>> +			xs_state_users++;
>> +		break;
>> +	}
>> +	xs_state_users++;
>> +	rq_id = xs_request_id++;
>> +	spin_unlock(&xs_state_lock);
>> +
>> +	return rq_id;
>> +}
> 
> I should have noticed this last time but I've been looking at this code
> again and I don't think I understand why you are incrementing count for
> XS_TRANSACTION_START inside the loop.
> 
> In fact, why not just 'while(xs_suspend_active) {}' loop?

That's a valid question.

I'll change it. The reason to have the larger loop body isn't existing
any longer.


Juergen

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 3/3] xen: optimize xenbus driver for multiple  concurrent xenstore accesses Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-01-19 00:00 +0100
  Re: [PATCH v2 3/3] xen: optimize xenbus driver for multiple  concurrent xenstore accesses Juergen Gross <jgross@suse.com> - 2017-01-19 08:50 +0100

csiph-web