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 91620C4332F for ; Fri, 11 Nov 2022 21:11:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8E408E0012; Fri, 11 Nov 2022 16:11:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D17348E0008; Fri, 11 Nov 2022 16:11:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B905A8E0012; Fri, 11 Nov 2022 16:11:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A53048E0008 for ; Fri, 11 Nov 2022 16:11:27 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7F8B71C6BDC for ; Fri, 11 Nov 2022 21:11:27 +0000 (UTC) X-FDA: 80122407414.25.AEF8BCA Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf21.hostedemail.com (Postfix) with ESMTP id 97C981C0002 for ; Fri, 11 Nov 2022 21:11:26 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E784922021; Fri, 11 Nov 2022 21:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668201084; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U7S3ir/l0uio8KcE29E9g1I1ku+YQ2IOl6IeYpDw0JQ=; b=YRvzTqj9ip3ozeHd4K8lVIvhG4EKZ0FjMfv+h5lVBLSHCb2BPZTVj7SYuW8CnyIfi336Zc Lk4UeG+DtQAZvyIzHURvMCSE+JDF4Ihik3vtW59Gs0gtI35jppCMPSyv9/8niI8B516db4 LEL0pn0EUVUDXyMBnoigd77L24l0DDs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668201084; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U7S3ir/l0uio8KcE29E9g1I1ku+YQ2IOl6IeYpDw0JQ=; b=/PzWSF+/wH/o7jmzgXua5xS2zXgpo6HJYo8MgFHd54Zsg7axAmEtLGVdOXAsTZCnRAy9nG yc+PAI+mm0RLOlDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BB4F613273; Fri, 11 Nov 2022 21:11:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hu7oLHy6bmNyYQAAMHmgww (envelope-from ); Fri, 11 Nov 2022 21:11:24 +0000 Message-ID: Date: Fri, 11 Nov 2022 22:11:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [lkp] [+5395 bytes kernel size regression] [i386-tinyconfig] [b7c8731082] Deprecating and removing SLOB Content-Language: en-US To: Josh Triplett , oe-kbuild-all@lists.linux.dev, Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin Cc: kernel test robot , "linux-mm@kvack.org" References: From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668201087; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=U7S3ir/l0uio8KcE29E9g1I1ku+YQ2IOl6IeYpDw0JQ=; b=Hs1AvLJzCAR33RbhWMIlh+6lU4X2pVw2ZwiD1A5JUDqmNjKqmfBrKTLmUWZttB3K66OnGB Q2moH8LhIRpwhionq02VMRkKKppsqAc2xZjCIey/cQWv+GcRe2Cm2An+hbv/MVyx/B8IT8 zc8kPAUM0lsPS7jPvk34wjz+KL8d6RM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=YRvzTqj9; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="/PzWSF+/"; dmarc=none; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668201087; a=rsa-sha256; cv=none; b=6wQWHRhpQ0cGUUVShwXVjTKeHuzXeUWGD41zvt3euJJI71QcjD+qyZ5kbio9ctGV5f+ETX qUiU/S0lsuoC2sO1Mi/9Ujllnij6aLQQ20OcxVNHUxODmEr1EZXmfVB7DwSXLVp29B2iMW B+E9TYNdslLU8hTFyODeH/UshV8eP8o= X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 97C981C0002 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=YRvzTqj9; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="/PzWSF+/"; dmarc=none; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Stat-Signature: ueabajyjm4kf4oc4zowpzautjw7581gd X-HE-Tag: 1668201086-331725 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 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