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

2017-01-11 Thread Juergen Gross
On 11/01/17 16:29, Boris Ostrovsky wrote: > + + +static bool test_reply(struct xb_req_data *req) +{ + if (req->state == xb_req_state_got_reply || !xenbus_ok()) + return true; + + /* Make sure to reread req->state each time. */ + cpu_relax();

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

2017-01-11 Thread Boris Ostrovsky
>>> + >>> + >>> +static bool test_reply(struct xb_req_data *req) >>> +{ >>> + if (req->state == xb_req_state_got_reply || !xenbus_ok()) >>> + return true; >>> + >>> + /* Make sure to reread req->state each time. */ >>> + cpu_relax(); >> I don't think I understand why this is needed

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

2017-01-10 Thread Juergen Gross
On 10/01/17 23:56, Boris Ostrovsky wrote: > > > >> diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c >> index ebc768f..ebdfbee 100644 >> --- a/drivers/xen/xenbus/xenbus_xs.c >> +++ b/drivers/xen/xenbus/xenbus_xs.c > > >> - >> -static struct xs_handle xs_state; >> +/*

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

2017-01-10 Thread Boris Ostrovsky
> diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c > index ebc768f..ebdfbee 100644 > --- a/drivers/xen/xenbus/xenbus_xs.c > +++ b/drivers/xen/xenbus/xenbus_xs.c > - > -static struct xs_handle xs_state; > +/* > + * Framework to protect suspend/resume handling against

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

2017-01-10 Thread Boris Ostrovsky
> diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c > b/drivers/xen/xenbus/xenbus_dev_frontend.c > index e4b9847..4d343ee 100644 > --- a/drivers/xen/xenbus/xenbus_dev_frontend.c > +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c > LGTM. -boris

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

2017-01-10 Thread Juergen Gross
On 10/01/17 17:36, Boris Ostrovsky wrote: > +static int process_msg(void) +{ + static struct xs_thread_state_read state; + struct xb_req_data *req; + int err; + unsigned int len; + + if (!state.in_msg) { + state.in_msg = true; +

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

2017-01-10 Thread Boris Ostrovsky
>> /* >> * xs_response_mutex is locked as long as we are processing one >> * message. state.in_msg will be true as long as we are holding the >> * lock in process_msg(). > > Then in_msg is the same as mutex_is_locked(&xs_response_mutex). And if > so, do we really need it? Nevermind this. The

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

2017-01-10 Thread Boris Ostrovsky
>>> +static int process_msg(void) >>> +{ >>> + static struct xs_thread_state_read state; >>> + struct xb_req_data *req; >>> + int err; >>> + unsigned int len; >>> + >>> + if (!state.in_msg) { >>> + state.in_msg = true; >>> + state.in_hdr = true; >>> + state.

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

2017-01-09 Thread Juergen Gross
On 09/01/17 22:17, Boris Ostrovsky wrote: > On 01/06/2017 10:05 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.

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

2017-01-09 Thread Boris Ostrovsky
On 01/06/2017 10:05 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. > > Rewrite xenbus to handle multiple requests

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

2017-01-06 Thread Juergen Gross
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. Rewrite xenbus to handle multiple requests concurrently by making use of the request id of the Xe