On 2019-06-03 11:09, Peter Zijlstra wrote:
On Fri, May 31, 2019 at 08:58:19PM +0200, Roman Penyaev wrote:
On 2019-05-31 18:51, Peter Zijlstra wrote:
> But like you show, it can be done. It also makes the thing wait-free, as
> opposed to merely lockless.
You think it's better? I did not
On Fri, May 31, 2019 at 08:58:19PM +0200, Roman Penyaev wrote:
> On 2019-05-31 18:51, Peter Zijlstra wrote:
> > But like you show, it can be done. It also makes the thing wait-free, as
> > opposed to merely lockless.
>
> You think it's better? I did not like this variant from the very
>
On 2019-05-31 18:51, Peter Zijlstra wrote:
On Fri, May 31, 2019 at 04:21:30PM +0200, Roman Penyaev wrote:
The ep_add_event_to_uring() is lockless, thus I can't increase tail
after,
I need to reserve the index slot, where to write to. I can use shadow
tail,
which is not seen by userspace, but
On Fri, May 31, 2019 at 04:28:36PM +0200, Roman Penyaev wrote:
> On 2019-05-31 14:53, Peter Zijlstra wrote:
> > On Fri, May 31, 2019 at 01:15:21PM +0200, Roman Penyaev wrote:
> > > On 2019-05-31 11:56, Peter Zijlstra wrote:
> > > > On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> >
On Fri, May 31, 2019 at 04:21:30PM +0200, Roman Penyaev wrote:
> The ep_add_event_to_uring() is lockless, thus I can't increase tail after,
> I need to reserve the index slot, where to write to. I can use shadow tail,
> which is not seen by userspace, but I have to guarantee that tail is updated
On 2019-05-31 14:53, Peter Zijlstra wrote:
On Fri, May 31, 2019 at 01:15:21PM +0200, Roman Penyaev wrote:
On 2019-05-31 11:56, Peter Zijlstra wrote:
> On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> > + i = __atomic_fetch_add(>user_header->tail, 1,
> > +
On 2019-05-31 14:56, Peter Zijlstra wrote:
On Fri, May 31, 2019 at 01:15:21PM +0200, Roman Penyaev wrote:
On 2019-05-31 11:56, Peter Zijlstra wrote:
> On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> > +static inline bool ep_add_event_to_uring(struct epitem *epi,
> > __poll_t
On Fri, May 31, 2019 at 01:24:07PM +0200, Roman Penyaev wrote:
> On 2019-05-31 11:55, Peter Zijlstra wrote:
> > On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> > > +#define atomic_set_unless_zero(ptr, flags) \
> > > +({
On Fri, May 31, 2019 at 01:15:21PM +0200, Roman Penyaev wrote:
> On 2019-05-31 11:56, Peter Zijlstra wrote:
> > On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> > > +static inline bool ep_add_event_to_uring(struct epitem *epi,
> > > __poll_t pollflags)
> > > +{
> > > + struct
On Fri, May 31, 2019 at 01:15:21PM +0200, Roman Penyaev wrote:
> On 2019-05-31 11:56, Peter Zijlstra wrote:
> > On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> > > + i = __atomic_fetch_add(>user_header->tail, 1,
> > > +__ATOMIC_ACQUIRE);
>
On 2019-05-31 11:55, Peter Zijlstra wrote:
On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
+#define atomic_set_unless_zero(ptr, flags) \
+({ \
+ typeof(ptr) _ptr = (ptr);
On 2019-05-31 11:56, Peter Zijlstra wrote:
On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
+static inline bool ep_add_event_to_uring(struct epitem *epi, __poll_t
pollflags)
+{
+ struct eventpoll *ep = epi->ep;
+ struct epoll_uitem *uitem;
+ bool added = false;
On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> +#define atomic_set_unless_zero(ptr, flags) \
> +({ \
> + typeof(ptr) _ptr = (ptr); \
> + typeof(flags) _flags =
On Thu, May 16, 2019 at 10:58:03AM +0200, Roman Penyaev wrote:
> +static inline bool ep_add_event_to_uring(struct epitem *epi, __poll_t
> pollflags)
> +{
> + struct eventpoll *ep = epi->ep;
> + struct epoll_uitem *uitem;
> + bool added = false;
> +
> + if (WARN_ON(!pollflags))
> +
Both add and remove events are lockless and can be called in parallel.
ep_add_event_to_uring():
o user item is marked atomically as ready
o if on previous stem user item was observed as not ready,
then new entry is created for the index uring.
ep_remove_user_item():
15 matches
Mail list logo