From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57537C433EF for ; Fri, 18 Feb 2022 10:38:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D30326B0074; Fri, 18 Feb 2022 05:38:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CDFE76B0075; Fri, 18 Feb 2022 05:38:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B80AC6B0078; Fri, 18 Feb 2022 05:38:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id A522C6B0074 for ; Fri, 18 Feb 2022 05:38:05 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5077D94FC8 for ; Fri, 18 Feb 2022 10:38:05 +0000 (UTC) X-FDA: 79155550530.07.2786AB7 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf22.hostedemail.com (Postfix) with ESMTP id BC5EBC0007 for ; Fri, 18 Feb 2022 10:38:04 +0000 (UTC) Received: by mail-pl1-f169.google.com with SMTP id j4so6822799plj.8 for ; Fri, 18 Feb 2022 02:38:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=LcqL4i71QUH+JJw7+SI/98dBrZjn5nAbXLi47gmA/IU=; b=AyMFXlcqFLqMLg2SWqB03zPZB6jTePzw2pSd7X2uRF7sw5xk8+TuG07WZPhgNoNnUo uCIJpLTbgiv9j0mmtlNEFHuOpERFaXFgx85hxLhaOkXFQdYIAFVB+73/8XX0HJG2ilOp B0Kvg1B6LV90iwy5/nGlTA/KYoBBnUpAcvQQUJi8cHK4msDfmlTlMauwZs48S35ZZB0G XeEOOpLI10ola/FSZlVlx76z5ucPVPej9RzSEdOG5TlHxC1NvfSzmOfuUQECM569MxGT 3teK2uWqviyIuoId/WIJR+ZrarzGOUBQItPHCQ1kRabT7bMz5o5IM/fllV2LM8BmULC2 7BHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LcqL4i71QUH+JJw7+SI/98dBrZjn5nAbXLi47gmA/IU=; b=HGMHaxxN9ztLKlk2N54b6+YTj41wN3noSJ8q5+g+G8qm+/WcUnt9UO7krrHyDJyN04 2emJfzvznW6s5z9IDg4luD0bvlm2q/Tqe8QMdRWuLa/qLry+TAMnNLgQup7Vf6f9EEW4 dAzi2/5BgxhNGIHNmLQXktsEw701+a6SAQlY0svpmRPvj2oPTukXJj52GlrgFnSatexp L4lEpxpUlmppLYBIfOTh3WB/602GfH8H9O8Mx6WbzhYQCAKGehs17ksBQXS4jyeoyidl jLzCe4nchmeP1zgVEQPEONnhj98cwRwbim/i6i4ndqBXn495EYplXcdqjT6AONaTo9qQ gkng== X-Gm-Message-State: AOAM530qtpO+PAFWtG9X4e0gYG0PB7U2ToExO+nZtsBgEwBvC9SunoY5 KbL6DOvYSFTH3a9Umh7ppWPvEdJYZP4nQw== X-Google-Smtp-Source: ABdhPJz32SXdkji8Ovdm/FdDKNJcFDEj43pwkAm4DR2lGp8YsS+2qClXj5s6bqJuP9zGhMPrTbUX9A== X-Received: by 2002:a17:902:860a:b0:14b:341e:5ffb with SMTP id f10-20020a170902860a00b0014b341e5ffbmr6908039plo.6.1645180683864; Fri, 18 Feb 2022 02:38:03 -0800 (PST) Received: from ip-172-31-19-208.ap-northeast-1.compute.internal (ec2-18-181-137-102.ap-northeast-1.compute.amazonaws.com. [18.181.137.102]) by smtp.gmail.com with ESMTPSA id l11sm4451064pjm.23.2022.02.18.02.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 02:38:03 -0800 (PST) Date: Fri, 18 Feb 2022 10:37:59 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: Christoph Lameter , Matthew Wilcox , Christoph Lameter , Linux Memory Management List , LKML , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton Subject: Re: Do we really need SLOB nowdays? Message-ID: References: <20211028100414.GA2928@kvm.asia-northeast3-a.c.our-ratio-313919.internal> <20211210110835.GA632811@odroid> <20211215062904.GA1150813@odroid> <54c6fff8-8c79-463b-a359-96e37bd13674@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 51n1ehoow8s7s6xyx5b167azhffy1nq6 X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AyMFXlcq; spf=pass (imf22.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: BC5EBC0007 X-HE-Tag: 1645180684-900378 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Feb 18, 2022 at 10:13:29AM +0000, Hyeonggon Yoo wrote: > On Wed, Dec 15, 2021 at 11:10:06AM +0100, Vlastimil Babka wrote: > > On 12/15/21 07:29, Hyeonggon Yoo wrote: > > > On Tue, Dec 14, 2021 at 06:24:58PM +0100, Vlastimil Babka wrote: > > >> 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? > > >> > > > > > > I don't know why Christoph's mail is not in my mailbox. maybe I deleted it > > > by mistake or I'm not cc-ed. > > > > > > Anyway, I tried to measure this again with SLUB and SLOB. > > > > > > SLUB uses few hundreds of bytes than SLOB. > > > > > > There isn't much difference in 'Memory required to boot'. > > > (interestingly SLUB requires less) > > > > > > 'Memory required to boot' is measured by reducing memory > > > until it says 'System is deadlocked on memory'. I don't know > > > exact reason why they differ. > > > > > > Note that the configuration is based on tinyconfig and > > > I added initramfs support + tty layer (+ uart driver) + procfs support, > > > + ELF binary support + etc. > > > > > > there isn't even block layer, but it's good starting point to see > > > what happens in small system. > > > > > > SLOB: > > > > > > Memory required to boot: 6950K > > > > > > Slab: 368 kB > > > > > > SLUB: > > > Memory required to boot: 6800K > > > > > > Slab: 552 kB > > > > > > SLUB with slab merging: > > > > > > Slab: 536 kB > > > > 168kB different on a system with less than 8MB memory looks rather > > significant to me to simply delete SLOB, I'm afraid. > > Just FYI... > Some experiment based on v5.17-rc3: > > SLOB: > Slab: 388 kB > > SLUB: > Slab: 540 kB (+152kb) > > SLUB with s->min_partial = 0: > Slab: 452 kB (+64kb) > > SLUB with s->min_partial = 0 && slub_max_order = 0: > Slab: 436 kB (+48kb) > > SLUB with s->min_partial = 0 && slub_max_order = 0 > + merging slabs crazily (just ignore SLAB_NEVER_MERGE/SLAB_MERGE_SAME): > Slab: 408 kB (+20kb) > > Decreasing further seem to be hard and > I guess +20kb are due to partial slabs. > > I think SLUB can be memory-efficient as SLOB. > Is SLOB (Address-Ordered next fit) stronger to fragmentation than SLUB? (Address-Ordered *first* fit)