Commit Graph

6 Commits

Author SHA1 Message Date
Francesco Mazzoli
9112cac1b0 si_mem_available() returns the _pages_ available, not bytes 2023-05-26 17:22:43 +00:00
Francesco Mazzoli
1a701f22a2 Actually reclaim spans 2023-05-25 10:22:31 +00:00
Francesco Mazzoli
52e50a1888 Simplify span cache locking further
With seqcount with the current locking strategy we can get into
subtle nasty situations. For now, just be "dumb" with a rw semaphore.

For example, consider the case where we get the span in the
seqcount protected section in get_span. Between getting the
span and acquiring it the reclaimer might free it.

Ideally we'd do something similar to what Paweł planned (seqcount
and RCU protection) but let's start with something simple which
seems to work.

Also, shard the LRU by 128, to reduce contention, and fix a couple
of unrelated bugs.
2023-05-25 08:34:40 +00:00
Francesco Mazzoli
47c1022896 Bugfixes 2023-05-23 22:10:11 +00:00
Francesco Mazzoli
8f32ecc1b6 Cached spans reclamation
Right now this is very crude (global spinlock), but reasonably simple.
We can improve if needed.
2023-05-23 16:57:29 +00:00
Francesco Mazzoli
6addbdee6a First version of kernel module
Initial version really by Pawel, but many changes in between.

Big outstanding issues:

* span cache reclamation (unbounded memory otherwise...)
* bad block service detection and workarounds
* corrupted blocks detection and workaround

Co-authored-by: Paweł Dziepak <pawel.dziepak@xtxmarkets.com>
2023-05-18 15:29:41 +00:00