asm-generic: Provide kmap_size.h
authorThomas Gleixner <tglx@linutronix.de>
Tue, 3 Nov 2020 09:27:17 +0000 (10:27 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 6 Nov 2020 22:14:54 +0000 (23:14 +0100)
commit4f8b96cd47b06f1e3ec71c1a3216113efe8dbfb5
treee2024b147f7d55c20c9e3aaf24a4bfe7b22ef60e
parent673afbace459ae6fd8d03bda410e0a9f10438c99
asm-generic: Provide kmap_size.h

kmap_types.h is a misnomer because the old atomic MAP based array does not
exist anymore and the whole indirection of architectures including
kmap_types.h is inconinstent and does not allow to provide guard page
debugging for this misfeature.

Add a common header file which defines the mapping stack size for all
architectures. Will be used when converting architectures over to a
generic kmap_local/atomic implementation.

The array size is chosen with the following constraints in mind:

    - The deepest nest level in one context is 3 according to code
      inspection.

    - The worst case nesting for the upcoming reemptible version would be:

      2 maps in task context and a fault inside
      2 maps in the fault handler
      3 maps in softirq
      2 maps in interrupt

So a total of 16 is sufficient and probably overestimated.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/r/20201103095857.078043987@linutronix.de
include/asm-generic/Kbuild
include/asm-generic/kmap_size.h [new file with mode: 0644]