Re: [PATCH] scsi: zfcp: Replace strlcpy() with strscpy()

2023-11-20 Thread Benjamin Block
Hey Kees, thanks for the patch. can you please send this patch to linux-scsi and CC the SCSI Maintainers (Martin and James) instead (having linux-s390 on CC is fine)? zFCP doesn't go via s390, being a SCSI driver. On Thu, Nov 16, 2023 at 11:14:35AM -0800, Kees Cook wrote: > strlcpy() reads the e

Re: [PATCH v9 2/2] arm64: dts: qcom: sm8250-xiaomi-pipa: Add initial device tree

2023-11-20 Thread Konrad Dybcio
On 24.10.2023 08:37, Luka Panio wrote: > Initial support for Xiaomi Pad 6 tablet, that have sm8250 soc. > > Signed-off-by: Luka Panio > --- [...] > + > + gpio_keys: gpio-keys { > + compatible = "gpio-keys"; > + > + pinctrl-names = "default"; > + pinctrl-0

Re: [PATCH v2 3/3] arm64: dts: qcom: Add device tree for Xiaomi Mi 11 Ultra

2023-11-20 Thread Konrad Dybcio
On 21.10.2023 12:20, Xilin Wu via B4 Relay wrote: > From: Xilin Wu > > Add support for Xiaomi Mi 11 Ultra. This commit brings support for: > * Front and rear display panels (initialized by bootloader) > * USB > * UFS > * PCIe0 > * Thermistor sensors > * ADSP/CDSP/Modem/SLPI > * IR Transmitter > *

[PATCH v2 01/21] mm/slab, docs: switch mm-api docs generation from slab.c to slub.c

2023-11-20 Thread Vlastimil Babka
The SLAB implementation is going to be removed, and mm-api.rst currently uses mm/slab.c to obtain kerneldocs for some API functions. Switch it to mm/slub.c and move the relevant kerneldocs of exported functions from one to the other. The rest of kerneldocs in slab.c is for static SLAB implementatio

[PATCH v2 03/21] KASAN: remove code paths guarded by CONFIG_SLAB

2023-11-20 Thread Vlastimil Babka
With SLAB removed and SLUB the only remaining allocator, we can clean up some code that was depending on the choice. Reviewed-by: Kees Cook Reviewed-by: Marco Elver Signed-off-by: Vlastimil Babka --- mm/kasan/common.c | 13 ++--- mm/kasan/kasan.h | 3 +-- mm/kasan/quarantine.

[PATCH v2 05/21] mm/memcontrol: remove CONFIG_SLAB #ifdef guards

2023-11-20 Thread Vlastimil Babka
With SLAB removed, these are never true anymore so we can clean up. Reviewed-by: Kees Cook Acked-by: Michal Hocko Signed-off-by: Vlastimil Babka --- mm/memcontrol.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 774bd6e21e27..94

[PATCH v2 00/21] remove the SLAB allocator

2023-11-20 Thread Vlastimil Babka
4026 - mm/slab.h | 551 ++--- mm/slab_common.c | 231 +-- mm/slub.c | 617 +- 29 files changed, 815 insertions(+), 5134 deletions(-) --- base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 change-id: 202

[PATCH v2 06/21] cpu/hotplug: remove CPUHP_SLAB_PREPARE hooks

2023-11-20 Thread Vlastimil Babka
The CPUHP_SLAB_PREPARE hooks are only used by SLAB which is removed. SLUB defines them as NULL, so we can remove those altogether. Signed-off-by: Vlastimil Babka --- include/linux/cpuhotplug.h | 1 - include/linux/slab.h | 8 kernel/cpu.c | 5 - 3 files changed,

[PATCH v2 08/21] mm/mempool/dmapool: remove CONFIG_DEBUG_SLAB ifdefs

2023-11-20 Thread Vlastimil Babka
CONFIG_DEBUG_SLAB is going away with CONFIG_SLAB, so remove dead ifdefs in mempool and dmapool code. Reviewed-by: Kees Cook Signed-off-by: Vlastimil Babka --- mm/dmapool.c | 2 +- mm/mempool.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/dmapool.c b/mm/dmapool.c

[PATCH v2 04/21] KFENCE: cleanup kfence_guarded_alloc() after CONFIG_SLAB removal

2023-11-20 Thread Vlastimil Babka
Some struct slab fields are initialized differently for SLAB and SLUB so we can simplify with SLUB being the only remaining allocator. Reviewed-by: Kees Cook Reviewed-by: Marco Elver Signed-off-by: Vlastimil Babka --- mm/kfence/core.c | 4 1 file changed, 4 deletions(-) diff --git a/mm/k

[PATCH v2 10/21] mm/slab: move struct kmem_cache_cpu declaration to slub.c

2023-11-20 Thread Vlastimil Babka
Nothing outside SLUB itself accesses the struct kmem_cache_cpu fields so it does not need to be declared in slub_def.h. This allows also to move enum stat_item. Reviewed-by: Kees Cook Signed-off-by: Vlastimil Babka --- include/linux/slub_def.h | 54 --

[PATCH v2 07/21] mm/slab: remove CONFIG_SLAB code from slab common code

2023-11-20 Thread Vlastimil Babka
In slab_common.c and slab.h headers, we can now remove all code behind CONFIG_SLAB and CONFIG_DEBUG_SLAB ifdefs, and remove all CONFIG_SLUB ifdefs. Reviewed-by: Kees Cook Signed-off-by: Vlastimil Babka --- include/linux/slab.h | 14 ++- mm/slab.h| 69

[PATCH v2 11/21] mm/slab: move the rest of slub_def.h to mm/slab.h

2023-11-20 Thread Vlastimil Babka
mm/slab.h is the only place to include include/linux/slub_def.h which has allowed switching between SLAB and SLUB. Now we can simply move the contents over and remove slub_def.h. Use this opportunity to fix up some whitespace (alignment) issues. Reviewed-by: Kees Cook Signed-off-by: Vlastimil Ba

[PATCH v2 14/21] mm/slab: move memcg related functions from slab.h to slub.c

2023-11-20 Thread Vlastimil Babka
We don't share those between SLAB and SLUB anymore, so most memcg related functions can be moved to slub.c proper. Reviewed-by: Kees Cook Acked-by: Michal Hocko Signed-off-by: Vlastimil Babka --- mm/slab.h | 206 -- mm/slub.c | 205 ++

[PATCH v2 17/21] mm/slab: move kmalloc_slab() to mm/slab.h

2023-11-20 Thread Vlastimil Babka
In preparation for the next patch, move the kmalloc_slab() function to the header, as it will have callers from two files, and make it inline. To avoid unnecessary bloat, remove all size checks/warnings from kmalloc_slab() as they just duplicate those in callers, especially after recent changes to

[PATCH v2 02/21] mm/slab: remove CONFIG_SLAB from all Kconfig and Makefile

2023-11-20 Thread Vlastimil Babka
Remove CONFIG_SLAB, CONFIG_DEBUG_SLAB, CONFIG_SLAB_DEPRECATED and everything in Kconfig files and mm/Makefile that depends on those. Since SLUB is the only remaining allocator, remove the allocator choice, make CONFIG_SLUB a "def_bool y" for now and remove all explicit dependencies on SLUB or SLAB

[PATCH v2 12/21] mm/slab: consolidate includes in the internal mm/slab.h

2023-11-20 Thread Vlastimil Babka
The #include's are scattered at several places of the file, but it does not seem this is needed to prevent any include loops (anymore?) so consolidate them at the top. Also move the misplaced kmem_cache_init() declaration away from the top. Signed-off-by: Vlastimil Babka --- mm/slab.h | 28 +

[PATCH v2 15/21] mm/slab: move struct kmem_cache_node from slab.h to slub.c

2023-11-20 Thread Vlastimil Babka
The declaration and associated helpers are not used anywhere else anymore. Reviewed-by: Kees Cook Signed-off-by: Vlastimil Babka --- mm/slab.h | 29 - mm/slub.c | 27 +++ 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/mm/slab

[PATCH v2 16/21] mm/slab: move kfree() from slab_common.c to slub.c

2023-11-20 Thread Vlastimil Babka
This should result in better code. Currently kfree() makes a function call between compilation units to __kmem_cache_free() which does its own virt_to_slab(), throwing away the struct slab pointer we already had in kfree(). Now it can be reused. Additionally kfree() can now inline the whole SLUB fr

[PATCH v2 21/21] mm/slub: optimize free fast path code layout

2023-11-20 Thread Vlastimil Babka
Inspection of kmem_cache_free() disassembly showed we could make the fast path smaller by providing few more hints to the compiler, and splitting the memcg_slab_free_hook() into an inline part that only checks if there's work to do, and an out of line part doing the actual uncharge. bloat-o-meter

[PATCH v2 19/21] mm/slub: remove slab_alloc() and __kmem_cache_alloc_lru() wrappers

2023-11-20 Thread Vlastimil Babka
slab_alloc() is a thin wrapper around slab_alloc_node() with only one caller. Replace with direct call of slab_alloc_node(). __kmem_cache_alloc_lru() itself is a thin wrapper with two callers, so replace it with direct calls of slab_alloc_node() and trace_kmem_cache_alloc(). This also makes sure

[PATCH v2 13/21] mm/slab: move pre/post-alloc hooks from slab.h to slub.c

2023-11-20 Thread Vlastimil Babka
We don't share the hooks between two slab implementations anymore so they can be moved away from the header. As part of the move, also move should_failslab() from slab_common.c as the pre_alloc hook uses it. This means slab.h can stop including fault-inject.h and kmemleak.h. Fix up some files that

[PATCH v2 18/21] mm/slab: move kmalloc() functions from slab_common.c to slub.c

2023-11-20 Thread Vlastimil Babka
This will eliminate a call between compilation units through __kmem_cache_alloc_node() and allow better inlining of the allocation fast path. Reviewed-by: Kees Cook Signed-off-by: Vlastimil Babka --- mm/slab.h| 3 -- mm/slab_common.c | 119 -

[PATCH v2 20/21] mm/slub: optimize alloc fastpath code layout

2023-11-20 Thread Vlastimil Babka
With allocation fastpaths no longer divided between two .c files, we have better inlining, however checking the disassembly of kmem_cache_alloc() reveals we can do better to make the fastpaths smaller and move the less common situations out of line or to separate functions, to reduce instruction ca

[PATCH v2 09/21] mm/slab: remove mm/slab.c and slab_def.h

2023-11-20 Thread Vlastimil Babka
Remove the SLAB implementation. Update CREDITS. Also update and properly sort the SLOB entry there. RIP SLAB allocator (1996 - 2024) Reviewed-by: Kees Cook Signed-off-by: Vlastimil Babka --- CREDITS | 12 +- include/linux/slab_def.h | 124 -- mm/slab.c| 4005