Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1209128pxb; Fri, 18 Feb 2022 03:02:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrz3nD2hrvB3K2EpAA5ykzKXq6ya/L1XzZ6Z2EhU7Y3fiW401A/6jG1Ay8qUPJ8IB9YiOR X-Received: by 2002:a05:6402:354c:b0:412:b2f2:f8e4 with SMTP id f12-20020a056402354c00b00412b2f2f8e4mr5159426edd.269.1645182142791; Fri, 18 Feb 2022 03:02:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645182142; cv=none; d=google.com; s=arc-20160816; b=LLmkvMGLATwkvGiU3YZJi7f0ooH+5sTj5rz2rYMUs40lg3EsYu8GCOyn6jPq+6d6kd RBU5EOnJoqdfBjksn2Sk1YQv8hgVUCN+Dr6vF9A4zNj3gImwWLlP+W3iTnf/P43kZeFI rZ4H6TKYvtv26+KOnz6l1DA9s7jHZsWqpVgm/FADDlgm/caEFwhUfqI4OcRMnrUOGTiV OZK+kWAQCbzb0A2Sj/jNCLpIyCeU++b9rjWQPsL2WsrTs1Or80LPguKqdBV20NqOapI5 UxFVhmhXkbRQ1Zt1B/TMn1jSMgKHAWPClmP/fx3KZNboyH3OdiD15B4XWXS89UzTGjSO uGzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LcqL4i71QUH+JJw7+SI/98dBrZjn5nAbXLi47gmA/IU=; b=r+7t7fe/VAxPWoH1HgGrG1wIb/mtWijHKC7c7E5Avsfp6MY8ydriaGvWIU/xLw1WFo 0lim57HpwF8embQcVUELPC+G1v02nP0TKNq7CZl2R1juoYYBcW/bpzGIIeNT7zOA7eb/ /OLLuBLnCkrnU6tkDSZaG1BSDokzGO4xSzFqc22gIQIekeXjXIjvnjgKXlCCTQu9yut5 y1ODt2Ht8kPSDnQO3h0GmxRDVQjH69RODR6ituKjM05fH478PyklrJ7tll0nU7jPiwm1 oqjeriZGHVc3l3coSx8rQq0rG96ynw2XS4rMZUlkaJCR3DnU+DwJWkikY2H1BzyGIS0A yojQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AyMFXlcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8si3847956ejr.980.2022.02.18.03.01.59; Fri, 18 Feb 2022 03:02:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AyMFXlcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232508AbiBRKiW (ORCPT + 99 others); Fri, 18 Feb 2022 05:38:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbiBRKiU (ORCPT ); Fri, 18 Feb 2022 05:38:20 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E21C3204B for ; Fri, 18 Feb 2022 02:38:04 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id w20so6813738plq.12 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=XXhciKsKdR+r7XsOTxb54VHz5wlLT7xfOB/UcGzoPkxZH2cLqagT6AepALReCAJeue w+Lo1r9PEDMIuZVZgPgPEIROc25kUZByLvIAVBw8jnwoJ9WkPZ9Q5jzRJjOdB3QS8ys1 6gyMicUMa0V/xQAjPzRrvAC9T+a9+Q2QfDEuBcFcHKnyX89cunF6zS5JnPG9sqhdvbFy 0+m5w7lUsx0nxnz4RrLl5XeBT9yyAG8k8nVSHPrfNHG7aK/Q4aFm68VQxJa6PwmVzrPy ZgNwJdfhptwm3dQw76lmHMzEBBDTonA2z8a8LixyTH4MCufp6LLWv8cE966KYCCfqAWm jjPg== X-Gm-Message-State: AOAM532vDa47xuEnZ5l8XomJZcIVuQqMQkU+hg0K84sGUY/IFV6gswxq 5OiYEjeXBlPDB072wIG2HpQ= 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-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)