Mateusz Guzik <[email protected]> writes:
> Apologies for late reply.

No problem. Your comment is welcomed, but I was actually waiting to see
if my testing comes back with anything suspicious.

> The diff reads ok to me, but I would consider not looping in case of
> seq mismatch.

You mean something like below?

static inline int ep_events_available(struct eventpoll *ep)
{
        unsigned int seq = read_seqcount_begin(&ep->seq);

        return !list_empty_careful(&ep->rdllist) ||
               READ_ONCE(ep->ovflist) != EP_UNACTIVE_PTR ||
               read_seqcount_retry(&ep->seq, seq);
}

Looping almost never happens, so I don't think it makes any
difference. But sure, it is a bit shorter.

> So does it solve the problem?

Yes it does.

> I think a somewhat of a blocker here would be to bench the thing -- I
> would expect some slowdown compared to stock kernel but should be
> still be faster than the previously proposed patch.

I expect the slowdown to be in the noise, but I will do a benchmark.

Nam

Reply via email to