From: Vlastimil Babka <vbabka@suse.cz>
To: Josh Triplett <josh@joshtriplett.org>,
oe-kbuild-all@lists.linux.dev, Christoph Lameter <cl@linux.com>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Pekka Enberg <penberg@kernel.org>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>,
Roman Gushchin <roman.gushchin@linux.dev>
Cc: kernel test robot <lkp@intel.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [lkp] [+5395 bytes kernel size regression] [i386-tinyconfig] [b7c8731082] Deprecating and removing SLOB
Date: Fri, 11 Nov 2022 22:11:24 +0100 [thread overview]
Message-ID: <eebc9dc8-6a45-c099-61da-230d06cb3157@suse.cz> (raw)
In-Reply-To: <Y26FN02o7jhV87wl@localhost>
On 11/11/22 18:24, Josh Triplett wrote:
> On Fri, Nov 11, 2022 at 08:49:57PM +0800, kernel test robot wrote:
>> FYI, we noticed a +5395 bytes kernel size regression due to commit:
>>
>> commit: b7c873108294f0fd19c7e4d6b038a05375b3cd33 (Deprecating and removing SLOB)
>> url: https://github.com/intel-lab-lkp/linux/commits/Vlastimil-Babka/mm-slob-rename-CONFIG_SLOB-to-CONFIG_SLOB_DEPRECATED/20221111-183529
>> base: https://git.kernel.org/cgit/linux/kernel/git/akpm/mm.git mm-everything
>> patch subject: [PATCH] mm, slob: rename CONFIG_SLOB to CONFIG_SLOB_DEPRECATED
>>
>>
>> Details as below (size data is obtained by `nm --size-sort vmlinux`):
>>
>> e1e3de44: Merge branch 'mm-nonmm-unstable' into mm-everything
>> b7c87310: Deprecating and removing SLOB
>
> This patch has the net effect of switching tiny over from SLOB to SLUB,
> which causes a 5k+ size regression.
>
> I *absolutely* appreciate the value of removing this much code, and I'm
> not going to propose keeping SLOB for the sole reason of being 5k
> smaller; it's not worth keeping a whole allocator for that. I also
> wouldn't be surprised if we get *some* of that back by simplifications
> this change enables in the rest of the kernel.
+Cc more slab people and linux-mm, the lkp report is here:
https://lore.kernel.org/all/Y25E9cJbhDAKi1vd@99bb1221be19/
Yeah, probably not immediately but if we succeed in removing SLAB as well,
the mm/slab_common.c wrapper can go away which should reduce the code.
> But I'm wondering if there might be any low-hanging fruit that could
> slim down SLUB to the tune of 5k or so, that has been previously ignored
> because SLOB served that use case? For instance, largely self-contained
> bits of SLUB functionality that could be omitted on the tiniest of
> systems?
Maybe not the whole of 5k, but looking at the symbol sizes we could get
something back with less aggressive inlining. Maybe add something like a
SLUB_TINY config that sets the other configs correctly for minimal footprint
and does tweaks like that to inlining or more code removal. Besides the code
size, the less obvious but probably more important is how many slab pages it
needs to allocate at runtime.
E.g. for the configs, "make tinyconfig" seems to not set those like
SLUB_DEBUG and SLUB_CPU_PARTIAL, which is good for making both code and page
allocation smaller, but it also doesn't set SLAB_MERGE_DEFAULT which should
result in fewer slab pages allocated if enabled.
With SLUB_TINY we could also ditch completely percpu caches and associated
code and just rely on the spin_lock protected partial list...
> - Josh Triplett
prev parent reply other threads:[~2022-11-11 21:11 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 15:55 Vlastimil Babka
2022-11-08 18:18 ` Christophe Leroy
2022-11-08 19:17 ` Andrew Morton
2022-11-08 18:46 ` Roman Gushchin
2022-11-08 20:13 ` Yosry Ahmed
2022-11-09 9:09 ` Vlastimil Babka
2022-11-08 21:44 ` Pasha Tatashin
2022-11-09 9:00 ` Vlastimil Babka
2022-11-09 15:50 ` Aaro Koskinen
2022-11-09 16:45 ` Geert Uytterhoeven
2022-11-09 17:45 ` Mike Rapoport
2022-11-09 21:16 ` Janusz Krzysztofik
2022-11-09 17:57 ` Conor.Dooley
2022-11-09 23:00 ` Damien Le Moal
2022-11-11 10:25 ` Vlastimil Babka
2022-11-12 1:40 ` Damien Le Moal
2022-11-11 10:33 ` Vlastimil Babka
2022-11-11 20:46 ` Conor Dooley
2022-11-12 1:40 ` Damien Le Moal
2022-11-14 1:55 ` Damien Le Moal
2022-11-14 5:48 ` Damien Le Moal
2022-11-14 9:36 ` Vlastimil Babka
2022-11-14 11:35 ` Damien Le Moal
2022-11-14 14:47 ` Hyeonggon Yoo
2022-11-15 4:24 ` Damien Le Moal
2022-11-15 4:28 ` Damien Le Moal
2022-11-16 7:57 ` Matthew Wilcox
2022-11-16 8:02 ` Damien Le Moal
2022-11-16 17:51 ` Vlastimil Babka
2022-11-17 0:22 ` Damien Le Moal
2022-11-21 4:30 ` Damien Le Moal
2022-11-21 17:02 ` Vlastimil Babka
2022-11-14 11:50 ` Hyeonggon Yoo
[not found] ` <Y25E9cJbhDAKi1vd@99bb1221be19>
[not found] ` <Y26FN02o7jhV87wl@localhost>
2022-11-11 21:11 ` Vlastimil Babka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eebc9dc8-6a45-c099-61da-230d06cb3157@suse.cz \
--to=vbabka@suse.cz \
--cc=42.hyeyoo@gmail.com \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=josh@joshtriplett.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox