2016-10-28 08:14:10 +00:00
|
|
|
======================
|
2016-11-19 00:06:13 +00:00
|
|
|
Core API Documentation
|
2016-10-28 08:14:10 +00:00
|
|
|
======================
|
|
|
|
|
2016-11-19 00:06:13 +00:00
|
|
|
This is the beginning of a manual for core kernel APIs. The conversion
|
|
|
|
(and writing!) of documents for this manual is much appreciated!
|
|
|
|
|
|
|
|
Core utilities
|
|
|
|
==============
|
2016-10-28 08:14:10 +00:00
|
|
|
|
2020-03-02 22:17:17 +00:00
|
|
|
This section has general and "core core" documentation. The first is a
|
|
|
|
massive grab-bag of kerneldoc info left over from the docbook days; it
|
|
|
|
should really be broken up someday when somebody finds the energy to do
|
|
|
|
it.
|
|
|
|
|
2016-10-28 08:14:10 +00:00
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
2017-03-30 20:11:32 +00:00
|
|
|
kernel-api
|
2020-03-02 22:17:17 +00:00
|
|
|
workqueue
|
2022-04-19 02:54:16 +00:00
|
|
|
watch_queue
|
2020-04-03 09:36:17 +00:00
|
|
|
printk-basics
|
2020-03-02 22:17:17 +00:00
|
|
|
printk-formats
|
2022-04-05 11:48:29 +00:00
|
|
|
printk-index
|
2020-03-02 22:17:17 +00:00
|
|
|
symbol-namespaces
|
2022-09-27 16:05:57 +00:00
|
|
|
asm-annotations
|
2020-03-02 22:17:17 +00:00
|
|
|
|
|
|
|
Data structures and low-level utilities
|
|
|
|
=======================================
|
|
|
|
|
|
|
|
Library functionality that is used throughout the kernel.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
2020-02-25 22:21:25 +00:00
|
|
|
kobject
|
2020-05-01 15:37:52 +00:00
|
|
|
kref
|
2016-11-28 17:30:53 +00:00
|
|
|
assoc_array
|
2020-03-02 22:17:17 +00:00
|
|
|
xarray
|
Maple Tree: add new data structure
Patch series "Introducing the Maple Tree"
The maple tree is an RCU-safe range based B-tree designed to use modern
processor cache efficiently. There are a number of places in the kernel
that a non-overlapping range-based tree would be beneficial, especially
one with a simple interface. If you use an rbtree with other data
structures to improve performance or an interval tree to track
non-overlapping ranges, then this is for you.
The tree has a branching factor of 10 for non-leaf nodes and 16 for leaf
nodes. With the increased branching factor, it is significantly shorter
than the rbtree so it has fewer cache misses. The removal of the linked
list between subsequent entries also reduces the cache misses and the need
to pull in the previous and next VMA during many tree alterations.
The first user that is covered in this patch set is the vm_area_struct,
where three data structures are replaced by the maple tree: the augmented
rbtree, the vma cache, and the linked list of VMAs in the mm_struct. The
long term goal is to reduce or remove the mmap_lock contention.
The plan is to get to the point where we use the maple tree in RCU mode.
Readers will not block for writers. A single write operation will be
allowed at a time. A reader re-walks if stale data is encountered. VMAs
would be RCU enabled and this mode would be entered once multiple tasks
are using the mm_struct.
Davidlor said
: Yes I like the maple tree, and at this stage I don't think we can ask for
: more from this series wrt the MM - albeit there seems to still be some
: folks reporting breakage. Fundamentally I see Liam's work to (re)move
: complexity out of the MM (not to say that the actual maple tree is not
: complex) by consolidating the three complimentary data structures very
: much worth it considering performance does not take a hit. This was very
: much a turn off with the range locking approach, which worst case scenario
: incurred in prohibitive overhead. Also as Liam and Matthew have
: mentioned, RCU opens up a lot of nice performance opportunities, and in
: addition academia[1] has shown outstanding scalability of address spaces
: with the foundation of replacing the locked rbtree with RCU aware trees.
A similar work has been discovered in the academic press
https://pdos.csail.mit.edu/papers/rcuvm:asplos12.pdf
Sheer coincidence. We designed our tree with the intention of solving the
hardest problem first. Upon settling on a b-tree variant and a rough
outline, we researched ranged based b-trees and RCU b-trees and did find
that article. So it was nice to find reassurances that we were on the
right path, but our design choice of using ranges made that paper unusable
for us.
This patch (of 70):
The maple tree is an RCU-safe range based B-tree designed to use modern
processor cache efficiently. There are a number of places in the kernel
that a non-overlapping range-based tree would be beneficial, especially
one with a simple interface. If you use an rbtree with other data
structures to improve performance or an interval tree to track
non-overlapping ranges, then this is for you.
The tree has a branching factor of 10 for non-leaf nodes and 16 for leaf
nodes. With the increased branching factor, it is significantly shorter
than the rbtree so it has fewer cache misses. The removal of the linked
list between subsequent entries also reduces the cache misses and the need
to pull in the previous and next VMA during many tree alterations.
The first user that is covered in this patch set is the vm_area_struct,
where three data structures are replaced by the maple tree: the augmented
rbtree, the vma cache, and the linked list of VMAs in the mm_struct. The
long term goal is to reduce or remove the mmap_lock contention.
The plan is to get to the point where we use the maple tree in RCU mode.
Readers will not block for writers. A single write operation will be
allowed at a time. A reader re-walks if stale data is encountered. VMAs
would be RCU enabled and this mode would be entered once multiple tasks
are using the mm_struct.
There is additional BUG_ON() calls added within the tree, most of which
are in debug code. These will be replaced with a WARN_ON() call in the
future. There is also additional BUG_ON() calls within the code which
will also be reduced in number at a later date. These exist to catch
things such as out-of-range accesses which would crash anyways.
Link: https://lkml.kernel.org/r/20220906194824.2110408-1-Liam.Howlett@oracle.com
Link: https://lkml.kernel.org/r/20220906194824.2110408-2-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: David Howells <dhowells@redhat.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Hildenbrand <david@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-06 19:48:39 +00:00
|
|
|
maple_tree
|
2020-03-02 22:17:17 +00:00
|
|
|
idr
|
|
|
|
circular-buffers
|
2020-04-01 17:33:43 +00:00
|
|
|
rbtree
|
2020-03-02 22:17:17 +00:00
|
|
|
generic-radix-tree
|
|
|
|
packing
|
2020-06-23 13:31:38 +00:00
|
|
|
this_cpu_ops
|
2020-03-02 22:17:17 +00:00
|
|
|
timekeeping
|
|
|
|
errseq
|
2022-09-27 16:05:58 +00:00
|
|
|
wrappers/atomic_t
|
|
|
|
wrappers/atomic_bitops
|
2020-03-02 22:17:17 +00:00
|
|
|
|
2022-01-10 10:50:43 +00:00
|
|
|
Low level entry and exit
|
|
|
|
========================
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
|
|
|
entry
|
|
|
|
|
2020-03-02 22:17:17 +00:00
|
|
|
Concurrency primitives
|
|
|
|
======================
|
|
|
|
|
|
|
|
How Linux keeps everything from happening at the same time. See
|
2021-06-16 06:27:23 +00:00
|
|
|
Documentation/locking/index.rst for more related documentation.
|
2020-03-02 22:17:17 +00:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
2017-12-05 10:46:35 +00:00
|
|
|
refcount-vs-atomic
|
2020-05-01 15:37:51 +00:00
|
|
|
irq/index
|
2016-11-28 17:30:54 +00:00
|
|
|
local_ops
|
2020-03-02 22:17:17 +00:00
|
|
|
padata
|
|
|
|
../RCU/index
|
2022-09-27 16:05:58 +00:00
|
|
|
wrappers/memory-barriers.rst
|
2020-03-02 22:17:17 +00:00
|
|
|
|
|
|
|
Low-level hardware management
|
|
|
|
=============================
|
|
|
|
|
|
|
|
Cache management, managing CPU hotplug, etc.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
|
|
|
cachetlb
|
|
|
|
cpu_hotplug
|
|
|
|
memory-hotplug
|
2017-03-30 20:11:30 +00:00
|
|
|
genericirq
|
2020-03-02 22:17:17 +00:00
|
|
|
protection-keys
|
|
|
|
|
|
|
|
Memory management
|
|
|
|
=================
|
|
|
|
|
|
|
|
How to allocate and use memory in the kernel. Note that there is a lot
|
2022-06-27 06:00:26 +00:00
|
|
|
more memory-management documentation in Documentation/mm/index.rst.
|
2020-03-02 22:17:17 +00:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
2018-09-14 09:27:58 +00:00
|
|
|
memory-allocation
|
2020-06-23 13:31:38 +00:00
|
|
|
unaligned-memory-access
|
2020-05-01 15:37:45 +00:00
|
|
|
dma-api
|
|
|
|
dma-api-howto
|
|
|
|
dma-attributes
|
|
|
|
dma-isa-lpc
|
2018-08-24 00:01:12 +00:00
|
|
|
mm-api
|
2020-03-02 22:17:17 +00:00
|
|
|
genalloc
|
2020-01-31 06:12:54 +00:00
|
|
|
pin_user_pages
|
2018-06-30 14:55:06 +00:00
|
|
|
boot-time-mm
|
2020-03-02 22:17:17 +00:00
|
|
|
gfp_mask-from-fs-io
|
2016-10-28 08:14:11 +00:00
|
|
|
|
2016-11-19 00:06:13 +00:00
|
|
|
Interfaces for kernel debugging
|
|
|
|
===============================
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
2016-11-19 00:21:32 +00:00
|
|
|
debug-objects
|
|
|
|
tracepoint
|
2020-05-01 15:37:50 +00:00
|
|
|
debugging-via-ohci1394
|
2016-11-19 00:06:13 +00:00
|
|
|
|
2020-03-02 22:17:17 +00:00
|
|
|
Everything else
|
|
|
|
===============
|
|
|
|
|
|
|
|
Documents that don't fit elsewhere or which have yet to be categorized.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
|
|
|
librs
|
2023-01-20 17:50:34 +00:00
|
|
|
netlink
|
2020-03-02 22:17:17 +00:00
|
|
|
|
2019-07-26 12:51:29 +00:00
|
|
|
.. only:: subproject and html
|
2016-10-28 08:14:10 +00:00
|
|
|
|
|
|
|
Indices
|
|
|
|
=======
|
|
|
|
|
|
|
|
* :ref:`genindex`
|