Improve documentation, improve has_pollin handling. Sometimes writing documentation helps finding design issues :P Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
streamlining. renamespace public PWQR_* macros document stuff be more efficient for vanilla kernels Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
implement poll and read No matter if we implement some other kind of dirty notification mechanism, it feels right to have pwqr pollable for overcommit. Documentation: - drop the "in kernel unpark" method, it sucks - migrate to using non blocking "read" for the probing method. - document the pollability and how read works in the pwqr_create "manpage". lib: - implement epoll_create with flags. It requires a kernel supporting O_NONBLOCK/O_CLOEXEC flags to open(), I've been too lazy to implement the emulation yet. Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
check the `addr` argument for PWQ_WAIT is aligned to an integer. Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
fix asciidoc Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
rework the quarantine: it doesn't really need to be accounted. The notion of quarantine is purely virtual and we only care about it at WAKE time. It significantly simplifies the fastpath of our code, namely __pwqr_sb_update_state. Also allow the WAKE command to directly unpark threads if that fits with the concurrency level. I don't really expect userland to really use that, but it doesn't break anything and makes sense. Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
Implement the reluctancy to unpark threads. This means that a pool needs to undercommit for 0.1s before we allow it to grow its number of in-pool threads. Document the last todo: how to reduce the pool when we're overcommiting. Right now we only pray that userland will put some threads to WAIT. But frankly it's less than ideal. With the repulsion to start a new thread we hope though that the overcommit will never ever grow out of proportion for now. Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
Write some nice documentation about the design and APIs. Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>