Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp2434413pxb; Sat, 19 Feb 2022 11:12:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJypo2XGdsk4NGIZofyZY3b2suZ6GioCxYpQruOeldOLLSFUzCsoWaFbL+7ibi3wJ/0ego85 X-Received: by 2002:a05:6a00:ac2:b0:4e1:4a5:c338 with SMTP id c2-20020a056a000ac200b004e104a5c338mr13455926pfl.1.1645297963971; Sat, 19 Feb 2022 11:12:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645297963; cv=none; d=google.com; s=arc-20160816; b=RmGkJgCbwZEuWlStX/C8ykFwdBjAo8kqk0xCWbZwP5pWjzigmIESqiXu3Wnmx8wTFP BN2LDhc8U4zxLnzVk6V8GSOZShNPkep37LVhhetMcnc/0lQjcnvS6G0S6J7q85iQqAgY Aliw7pbeZJGxNmjGfGsYXJVBLtRLE3w7yLa5CyR4LmzMd0zo0iBrJScU3U/p5DE8bOnO JsOtQxjBGelRMM4zDRG3YLv3X9B3XjwLdwXcBLD9+PEnSYrjyOtQFTa0AdyKo1vONL8n 9MJ7IsMf3WyBghdEJY7x9jpEd/tqhDv2swLN0d+BEeDvLpdbL95Bccg05wLCL0y+HtAY 1muA== 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=Q3S/BU0h5z1TWDtM7/trwzzdXaxUs1NRowNdwGsTgok=; b=oosLrRYDqFovtScYPKciKBX1lvxi1cZTkPuUX3IYaxrFksI46qwSwF/WKS/Ju8OTLw Jk4abowkfrDMFfMaA5ef278pX7kHbyrOMywHHw+Q98OLiniZysgVqPo4ghR97+jUx8jr T2qDl8phQILqY7aLhXp5F1BMLqXWYDS4K2U9VAv28VYxHbJvq0t6CUlq3PJl9Z2f/Ro4 jG2yEpmn8IslvEQmEjoaq5yjiR10qMhtplP/T6BuNBBIGqJ5lGxrCFrNT+H3n6EuwwqP o/MS4rUpfdCWArmP3+i6djNK6VVKt89eErCAwDLTKQowb5TQcvtDiAeEQG9rDcNS6EyA A+8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YuK+xUE3; 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 k125si650434pgc.182.2022.02.19.11.12.24; Sat, 19 Feb 2022 11:12:43 -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=YuK+xUE3; 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 S241344AbiBSMAG (ORCPT + 99 others); Sat, 19 Feb 2022 07:00:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234010AbiBSMAF (ORCPT ); Sat, 19 Feb 2022 07:00:05 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D16F95DE5F for ; Sat, 19 Feb 2022 03:59:46 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id d187so4530876pfa.10 for ; Sat, 19 Feb 2022 03:59:46 -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=Q3S/BU0h5z1TWDtM7/trwzzdXaxUs1NRowNdwGsTgok=; b=YuK+xUE3N2UL4vhozvRT2RTu3henp67FsQdQcK59s4ZCoRpw/EAhgehnyf0YsqzR4W BT1m3M2DQzlt8rP7rULMnrJZxz2ivFGTXOZ6gTQCisFOde+YRONXi5n7Jac+Oeqc9Hx0 vfLnTOosOgoL5hMLh+LGaOHxWIcAnV6kwxLe7Q4U9kQ/z+hPNYOvi8YO8cp/SUpuQAk0 L3odT2JVMpt6ZQd1ZspgGSjwUAjPHoDpXxFqQLy5JgCFRV+aicxqVORXKqOxEwIoq3IA /e9eD2Z4ZfX0bhzZE/koRo8quqzM52m7YDNHAtLMVBVU6uoPItrQPyXEaApF+Kz5DbEx MG8Q== 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=Q3S/BU0h5z1TWDtM7/trwzzdXaxUs1NRowNdwGsTgok=; b=RQTG+96cloz5NSJPWFM0sRysHdAjQcctkID51HU0keCh+dEYCZksyyyOBTB+mEMIYg zvGIQZOrOTcYvOV788i7H8MyFZjOk5QcZAJTUuhsWO3EXEtcpQxXFiuZ/hPzwWPahgLq FlFI66OMocIIR5onq8AaIpFgIQpmCzd1KUXddShG/CimM3SHHejbg11PnjkeGbOB7qKx lMlkAH7KRTxGvLhql0L130I6hgwg7V4NqHqqDzD78gRlkVIuzfOicJWBErzbnYdntk6S m//Xp/AFhwNyYDueIhY2d+NcEs7wd694SlB3zT29L/vBhZ98Hjnv2eYjha04X0C9Soa7 oweQ== X-Gm-Message-State: AOAM531HY2mVlQ1AgXJetAYb36TvoCBforZTwwFmE+0zCa5pqRUjOzLC mDzTvzbxDyyg66lDCPN5vwE= X-Received: by 2002:a05:6a00:24ca:b0:4e1:cb76:32da with SMTP id d10-20020a056a0024ca00b004e1cb7632damr10876785pfv.81.1645271986371; Sat, 19 Feb 2022 03:59:46 -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 k16sm13009844pgh.45.2022.02.19.03.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 03:59:45 -0800 (PST) Date: Sat, 19 Feb 2022 11:59:41 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: David Laight Cc: Vlastimil Babka , 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> <7829ee15074448d5a7cec1a0e3c352d4@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7829ee15074448d5a7cec1a0e3c352d4@AcuMS.aculab.com> 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 04:10:28PM +0000, David Laight wrote: > From: Hyeonggon Yoo > > Sent: 18 February 2022 10:13 > ... > > I think SLUB can be memory-efficient as SLOB. > > Is SLOB (Address-Ordered next^Wfirst fit) stronger to fragmentation than SLUB? > > Dunno, but I had to patch the vxworks malloc to use 'best fit' > because 'first fit' based on a fifo free list was really horrid. > > I can't imagine an address ordered 'first fit' really being that much better. > > There are probably a lot more allocs and frees than the kernel used to have. > > Also isn't the performance of a 'first fit' going to get horrid > when there are a lot of small items on the free list. SLOB is focused on low memory usage, at the cost of poor performance. Its speed is not a concern. I think Address-Ordered sequential fit method pretty well in terms of low memory usage. And I think SLUB may replace SLOB, but we need to sure SLUB is absolute winner.. I wonder How slab maintainers think? > > Does SLUB split pages into 3s and 5s (on cache lime boundaries) > as well as powers of 2? > SLUB/SLAB use different strategy than SLOB, for better allocation performance. It's variant of segregated storage method. SLUB/SLAB both creates dedicated "caches" for each type of object. for example, on my system, there are slab cache for dentry(192), filp(256), fs_cache(64) ... etc. Objects that has different types are by default managed by different cache, which holds manages of pages. slab caches can be merged for better cacheline utilization. SLUB/SLAB also creates global kmalloc caches at boot time for power of 2 objects and (128, 256, 512, 1K, 2K, 4K, 8K on my system). Thanks, Hyeonggon. > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >