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


Groups > linux.kernel > #1562258

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

From Boris Ostrovsky <boris.ostrovsky@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/3] xen: optimize xenbus driver for multiple concurrent xenstore accesses
Date 2017-01-19 00:00 +0100
Message-ID <t17mX-1Gi-39@gated-at.bofh.it> (permalink)
References <t0giB-1uH-15@gated-at.bofh.it> <t0giB-1uH-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

-boris

Back to linux.kernel | Previous | Next — Next 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