* evtchn_resize_ring() serialization
@ 2016-05-04 13:08 Jan Beulich
2016-05-04 13:14 ` David Vrabel
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2016-05-04 13:08 UTC (permalink / raw)
To: David Vrabel; +Cc: Juergen Gross, xen-devel, Boris Ostrovsky
David,
in the course of putting together the fix just sent I got puzzled by the
apparent raciness of the initial part of evtchn_resize_ring(). Is it
intentional that the function relies on being implicitly serialized via the
bind mutex? If so, it would seem that this should be stated in a
comment. If not, I think that part of the function would need some
adjustment.
Thanks, Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: evtchn_resize_ring() serialization
2016-05-04 13:08 evtchn_resize_ring() serialization Jan Beulich
@ 2016-05-04 13:14 ` David Vrabel
2016-05-04 13:38 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: David Vrabel @ 2016-05-04 13:14 UTC (permalink / raw)
To: Jan Beulich; +Cc: Juergen Gross, xen-devel, Boris Ostrovsky
On 04/05/16 14:08, Jan Beulich wrote:
> David,
>
> in the course of putting together the fix just sent I got puzzled by the
> apparent raciness of the initial part of evtchn_resize_ring(). Is it
> intentional that the function relies on being implicitly serialized via the
> bind mutex?
Yes.
Although, I'm not sure I'd call it "implicit", as I think the bind_mutex
rather explicitly serializes bind operations (which may include resizing
the ring).
David
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: evtchn_resize_ring() serialization
2016-05-04 13:14 ` David Vrabel
@ 2016-05-04 13:38 ` Jan Beulich
2016-05-04 13:42 ` David Vrabel
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2016-05-04 13:38 UTC (permalink / raw)
To: David Vrabel; +Cc: Juergen Gross, xen-devel, Boris Ostrovsky
>>> On 04.05.16 at 15:14, <david.vrabel@citrix.com> wrote:
> On 04/05/16 14:08, Jan Beulich wrote:
>> David,
>>
>> in the course of putting together the fix just sent I got puzzled by the
>> apparent raciness of the initial part of evtchn_resize_ring(). Is it
>> intentional that the function relies on being implicitly serialized via the
>> bind mutex?
>
> Yes.
>
> Although, I'm not sure I'd call it "implicit", as I think the bind_mutex
> rather explicitly serializes bind operations (which may include resizing
> the ring).
Well, that's only if you assume that re-sizing is something which can
only ever happen in the context of binding. As said - I had looked at
the function in isolation first; nothing says it's a helper for just one
very specific operation.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: evtchn_resize_ring() serialization
2016-05-04 13:38 ` Jan Beulich
@ 2016-05-04 13:42 ` David Vrabel
0 siblings, 0 replies; 4+ messages in thread
From: David Vrabel @ 2016-05-04 13:42 UTC (permalink / raw)
To: Jan Beulich; +Cc: Juergen Gross, xen-devel, Boris Ostrovsky
On 04/05/16 14:38, Jan Beulich wrote:
>>>> On 04.05.16 at 15:14, <david.vrabel@citrix.com> wrote:
>> On 04/05/16 14:08, Jan Beulich wrote:
>>> David,
>>>
>>> in the course of putting together the fix just sent I got puzzled by the
>>> apparent raciness of the initial part of evtchn_resize_ring(). Is it
>>> intentional that the function relies on being implicitly serialized via the
>>> bind mutex?
>>
>> Yes.
>>
>> Although, I'm not sure I'd call it "implicit", as I think the bind_mutex
>> rather explicitly serializes bind operations (which may include resizing
>> the ring).
>
> Well, that's only if you assume that re-sizing is something which can
> only ever happen in the context of binding. As said - I had looked at
> the function in isolation first; nothing says it's a helper for just one
> very specific operation.
You could add a comment saying "u->bind_mutex must be locked" if you
think it will help.
David
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-04 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-04 13:08 evtchn_resize_ring() serialization Jan Beulich
2016-05-04 13:14 ` David Vrabel
2016-05-04 13:38 ` Jan Beulich
2016-05-04 13:42 ` David Vrabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).