On Fri, Sep 18, 2020 at 04:15:15PM -0500, Bob Pearson wrote: > This patch does following: > - Replace the rwlock used for pool->pool_lock by a spinlock. > Rwlock is a multi-reader single writer lock but there are > cases where a multi-writer lock is required, especially where > multiple objects can be created at the same time. Not sure what a multi-write lock is, sounds scary > - Be more careful about type checking in pool APIs. > Originally each object used in rxe had a pool_entry struct as > the first member of it's struct. Since then about half have > it first and the other half have it later in the struct. The > pool APIs used void * as a hack to avoid type checking. This > patch changes the APIs so the pool_entry struct is position > independent. When used a parameter a macro is used to convert > the object pointer to the entry pointer. The offset of the entry > is stored for each pool and used to convert the entry address to > the object address. > - Provide locked and unlocked versions of the APIs. > The current code uses a lock in each API to allow atomic > updates to the pools. But some uses fail to work because they > combined multiple pool operations and expect them to be > atomic. As an example doing a lookup to see if a matching object > exists for a multicast group followed by a create of a new group > if it does not. By letting the caller take the pool lock and then > combine unlocked operations this problem is fixed. > - Replace calls to pool APIs with the typesafe versions. > - Replaced a few calls to pr_warn with pr_err_once. This probably needs to be split up Jason