expiring_fifo: Optimize memory usage for single-element lists
expiring_fifo: Optimize memory usage for single-element lists

expiring_fifo is used to implement wait lists in synchronization
primitives like a semaphore (which in turn is used to implement a
condition_variable). In some uses, there will be at most one waiter.

Even if there is only one waiter, we currently allocate room for 128
waiters (a chunked_fifo chunk) which needs a 32KB allocation. This
results in lots of memory waste if the application is using lots of
synchronization primitives.

condition_variable, for instance, is used by Scylla to implement
notification of a per-table worker fiber. There could be many such
fibers.

The fix is to avoid chunked_fifo for single-element lists.

std::unique_ptr was chosen as the holder instead of std::optional<> to
avoid increasing the size of the semaphore. Not all semaphores are
contended.

Fixes #629

Message-Id: <7377f1274d8868309ad04994646949900e2167f3@scylladb.com>

dreamsxin/seastar,scylladb/seastar,dreamsxin/seastar,dreamsxin/seastar,cloudius-systems/seastar,cloudius-systems/seastar,cloudius-systems/seastar,scylladb/seastar,syuu1228/seastar,avikivity/seastar,avikivity/seastar,syuu1228/seastar,scylladb/seastar,syuu1228/seastar,avikivity/seastar