mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 3/3] xen: optimize xenbus driver for multiple concurrent xenstore accesses
Date: Thu, 19 Jan 2017 08:24:29 +0100	[thread overview]
Message-ID: <78661c52-dd9e-0030-fe37-eb31c4e42fbb@suse.com> (raw)
In-Reply-To: <ac2bf8f6-b2d5-ae3a-e588-02e879513429@oracle.com>

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

      reply	other threads:[~2017-01-19  7:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 14:15 [PATCH v2 0/3] xen: optimize xenbus performance Juergen Gross
2017-01-16 14:15 ` [PATCH v2 1/3] xen: clean up xenbus internal headers Juergen Gross
2017-01-17 23:21   ` Boris Ostrovsky
2017-01-16 14:15 ` [PATCH v2 2/3] xen: modify xenstore watch event interface Juergen Gross
2017-01-16 14:15 ` [PATCH v2 3/3] xen: optimize xenbus driver for multiple concurrent xenstore accesses Juergen Gross
2017-01-18 20:14   ` Boris Ostrovsky
2017-01-19  7:24     ` Juergen Gross [this message]

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=78661c52-dd9e-0030-fe37-eb31c4e42fbb@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome