Re: [take19 1/4] kevent: Core files.



On Tue, Oct 17, 2006 at 03:52:34PM +0200, Eric Dumazet (dada1@xxxxxxxxxxxxx) wrote:
What about the case, which I described in other e-mail, when in case of
the full ring buffer, no new events are written there, and when
userspace commits (i.e. marks as ready to be freed or requeued by kernel)
some events, new ones will be copied from ready queue into the buffer?

Then, user might receive 'false events', exactly like poll()/select()/epoll()
can do sometime. IE a 'ready' indication while there is no current event
available on a particular fd / event_source.

Only if user simultaneously uses oth interfaces and remove even from the
queue when it's copy was in mapped buffer, but in that case it's user's
problem (and if we do want, we can store pointer/index of the ring
buffer entry, so when event is removed from the ready queue (using
kevent_get_events()), appropriate entry in the ring buffer will be
updated to show that it is no longer valid.

This should be safe, since those programs already ignore read()
returns -EAGAIN and other similar things.

Programmer prefers to receive two 'event available' indications than ZERO (and
be stuck for infinite time). Of course, hot path (normal cases) should return
one 'event' only.

In order words, being ultra fast 99.99 % of the time, but being able to block
forever once in a while is not an option.

Have I missed something? It looks like the only problematic situation is
described above when user simultaneously uses both interfaces.

Eric

--
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [take19 1/4] kevent: Core files.
    ... they are still accessible through usual queue) from mapped buffer. ... that buffer (i.e. says to kernel that appropriate kevents can be freed ... Each time the kernel cannot queue an event in the ring buffer, ...
    (Linux-Kernel)
  • Re: [take19 1/4] kevent: Core files.
    ... We need the mapped ring buffer. ... Considering the if at all and if then how of ring buffer implemetation ... coalescing multiple events into one until delivery. ... insertion of the same kevent will fire immediately, ...
    (Linux-Kernel)
  • [PATCH v8] Unified trace buffer
    ... This is a unified tracing buffer that implements a ring buffer that ... There are 4 types (all internal use for the ring buffer, ... Look at a next item in the cpu buffer. ... Read the iterator and increment it. ...
    (Linux-Kernel)
  • [PATCH v6] Unified trace buffer
    ... This is a unified tracing buffer that implements a ring buffer that ... There are 4 types (all internal use for the ring buffer, ... Look at a next item in the cpu buffer. ...
    (Linux-Kernel)
  • [PATCH v7] Unified trace buffer
    ... have the full buffer page free for data. ... There are 4 types (all internal use for the ring buffer, ... Look at a next item in the cpu buffer. ...
    (Linux-Kernel)