Commit 5d26ce2a authored by Steve Sistare's avatar Steve Sistare Committed by Cheng Yu
Browse files

sched: Provide sparsemask, a reduced contention bitmap

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8PIYZ
CVE: NA

Reference: https://lore.kernel.org/lkml/1541767840-93588-2-git-send-email-steven.sistare@oracle.com/



---------------------------

Provide struct sparsemask and functions to manipulate it.  A sparsemask is
a sparse bitmap.  It reduces cache contention vs the usual bitmap when many
threads concurrently set, clear, and visit elements, by reducing the number
of significant bits per cacheline.  For each cacheline chunk of the mask,
only the first K bits of the first word are used, and the remaining bits
are ignored, where K is a creation time parameter.  Thus a sparsemask that
can represent a set of N elements is approximately (N/K * CACHELINE) bytes
in size.

This type is simpler and more efficient than the struct sbitmap used by
block drivers.

Signed-off-by: default avatarSteve Sistare <steven.sistare@oracle.com>
Signed-off-by: default avatarCheng Yu <serein.chengyu@huawei.com>
parent 58befe88
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment