From: Vlastimil Babka <vbabka@suse.cz>
To: Christoph Lameter <cl@gentwo.org>, Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
Christoph Lameter <cl@gentwo.de>,
Linux Memory Management List <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Do we really need SLOB nowdays?
Date: Tue, 14 Dec 2021 18:24:58 +0100 [thread overview]
Message-ID: <cbfaeb40-13c7-15b6-177d-07b3f3c4a0a9@suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2112101305500.290446@gentwo.de>
On 12/10/21 13:06, Christoph Lameter wrote:
> On Fri, 10 Dec 2021, Hyeonggon Yoo wrote:
>
>> > > (But I still have doubt if we can run linux on machines like that.)
>> >
>> > I sent you a series of articles about making Linux run in 1MB.
>>
>> After some time playing with the size of kernel,
>> I was able to run linux in 6.6MiB of RAM. and the SLOB used
>> around 300KiB of memory.
>
> What is the minimal size you need for SLUB?
Good question. Meanwhile I tried to compare Slab: in /proc/meminfo on a virtme run:
virtme-run --mods=auto --kdir /home/vbabka/wrk/linux/ --memory 2G,slots=2,maxmem=4G --qemu-opts --smp 4
Got ~30800kB with SLOB, 34500kB with SLUB without DEBUG and PERCPU_PARTIAL.
Then did a quick and dirty patch (below) to never load c->slab in
___slab_alloc() and got to 32200kB. Fiddling with
slub_min_order/slub_max_order didn't actually help, probably due to causing
more internal fragmentation.
So that's relatively close, but on a really small system the difference can
be possibly more prominent. Also my test doesn't account for text/data or
percpu usage differences.
diff --git a/mm/slub.c b/mm/slub.c
index 68aa112e469b..fd9c853971d1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3054,6 +3054,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
*/
goto return_single;
+ goto return_single;
+
retry_load_slab:
local_lock_irqsave(&s->cpu_slab->lock, flags);
next prev parent reply other threads:[~2021-12-14 17:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-17 4:28 [RFC] More deterministic SLOB for real time embedded systems Hyeonggon Yoo
2021-10-17 13:36 ` segregated list + slab merging is much better than original SLOB Hyeonggon Yoo
2021-10-17 13:57 ` Do we really need SLOB nowdays? Hyeonggon Yoo
2021-10-17 14:39 ` Matthew Wilcox
2021-10-18 9:45 ` Hyeonggon Yoo
2021-10-25 8:17 ` Christoph Lameter
2021-10-28 10:04 ` Hyeonggon Yoo
2021-10-28 12:08 ` Matthew Wilcox
2021-10-30 6:12 ` Hyeonggon Yoo
[not found] ` <20211210110835.GA632811@odroid>
2021-12-10 12:06 ` Christoph Lameter
2021-12-14 17:24 ` Vlastimil Babka [this message]
[not found] ` <20211215062904.GA1150813@odroid>
2021-12-15 10:10 ` Vlastimil Babka
2021-12-15 15:23 ` Christoph Lameter
2022-02-18 10:13 ` Hyeonggon Yoo
2022-02-18 10:37 ` Hyeonggon Yoo
2022-02-18 16:10 ` David Laight
2022-02-19 11:59 ` Hyeonggon Yoo
2021-10-25 8:15 ` Christoph Lameter
2021-10-25 8:14 ` [RFC] More deterministic SLOB for real time embedded systems Christoph Lameter
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=cbfaeb40-13c7-15b6-177d-07b3f3c4a0a9@suse.cz \
--to=vbabka@suse.cz \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.de \
--cc=cl@gentwo.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=willy@infradead.org \
/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