Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6196199rwb; Tue, 22 Nov 2022 09:59:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf6xpmyjeSGQ92q8fl06JomdBy9SGyNQ5hwRkPJgDn2UABQ23yprJ0UORqfMWN7leWhpEcHb X-Received: by 2002:a17:90a:9e2:b0:218:7103:ea94 with SMTP id 89-20020a17090a09e200b002187103ea94mr27506193pjo.215.1669139942502; Tue, 22 Nov 2022 09:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669139942; cv=none; d=google.com; s=arc-20160816; b=u6dgWkdYKFTf91VKsz6r8VgfeugXBNcWBfx7uA1qfw1yY+brYX0uZGy4il+lW1vdjP b4CqWPvSbRPyNp/unVknky1QuBAYhzUwrk6ejMt0LbjG2McseDZuG6+DuixQHthxxYVh /8/Gy3kMtqNHTJynLQhLDA3mpsidRifgGY2ChHPNha/3cWJdtCnv9/MH0AtrMhmjyYt2 AbsewDUiC2PBeoj8n9qFX7MQ4+sT0dOmWXAhsVjj3CTvcw4t9hYlQyKzd7KvoOjzqIDO rFQClskAmYpldt7TZhw3x3Jazxs61Ne6eorD9Mx8D+Q75230mxmMwyf9hDVoY+G8FjvE vH3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=AWib7uk/pXojLTP6WLnsRKQNx+DKIkZTOrXloBCRaME=; b=YlnyAuRvoH6uj9WImskQ/5d+wO4ZcuLoXjdJ0O84ziGi1m7R8gtJ+ByGhHiDMjrgLn NHG2VSmuSXys7jDYfuv7QPQoECG6zZsu0cnHeA1GuO0o/SyZSIa8Clwf9hmAisMSNwv5 K/IHjcgMQh/e4PpUivfpglTD90Nk6IdTN+yNK1DSaU6KMHXN4peD4wjzCwW3s0Fxj8++ 8CkPbYFyBhy5mjrVl3VEfZg7fswiK4rcye/w+USggCcIs27r8bgBDnfKulI6YBc08Q5y HibtdRICNllHliBH3WBbdLUe0OqR1Tlo4Au0eyukVJP4KLCTS7HLYDPTFZVpxIAu8lHS l5Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=lySZ7U8u; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WsG7hmw+; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a193-20020a6390ca000000b0043c00d4d5a3si14203545pge.93.2022.11.22.09.58.43; Tue, 22 Nov 2022 09:59:02 -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=@arndb.de header.s=fm3 header.b=lySZ7U8u; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WsG7hmw+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234468AbiKVRQP (ORCPT + 90 others); Tue, 22 Nov 2022 12:16:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232665AbiKVRQL (ORCPT ); Tue, 22 Nov 2022 12:16:11 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7667F73407; Tue, 22 Nov 2022 09:16:10 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 412F65C01AC; Tue, 22 Nov 2022 12:16:07 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Tue, 22 Nov 2022 12:16:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1669137367; x=1669223767; bh=AWib7uk/pX ojLTP6WLnsRKQNx+DKIkZTOrXloBCRaME=; b=lySZ7U8uKnWn00jTXtr9CAy5eX nv56f5UzD8Tk1XQ/zM5Lhx6iJpKUBacT8Jhv8GyD2PflS6Y7GxJQc0fIKYqg5Oes CFa1i/Ts0YaZ3w+29HTSOtSLJVf8UyxvgO7Elc+4A1sD1p/Xc15Cgj/ipv+7sC75 6w/wVc+YoF9EFV6ZnauvYJWW3dZBEdWUU3Bunbq5pUvgvqvufeUJEzM47bRam58J c3BOM4tOLUQkAGfA/RhyWi1+/qHvJbvC8bLwEEGaDCDs9qV6wxZFKoq3UYhXxQKt Wh8d/wv3tWb9gfqRvidRS+ZMd1z1j9zWUlznP4LRf6uszZiJKJUYJDZHHY8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669137367; x=1669223767; bh=AWib7uk/pXojLTP6WLnsRKQNx+DK IkZTOrXloBCRaME=; b=WsG7hmw+LKirM0tmH9Kzn5cWIv1cpT8+lNht2XAQJ9s3 4ZLi37KXbwyfZUymR+BePagoJCdji1Vzcj0n80TQIde9wB6INMz6g6O95orGjmgQ D4kmajLzD+hdqXIR6sGDItFx17483bKqA/prajubW26vU7eE2HfQ48F4RU3AbTOn BflQWRTk2zMsv9br6one4vxpVJ+2Kq+zgKTclR29Zf4FJW/LONRJf+GU2SCd5pYG J4BngUHmANTkgBSU86Eb3htMc55hA4qxKx5rSTTKWS1MsK5pY95N8jw9lUbptr/n 4Z8nSzdK1pAXa5mMpKlxS3WdFwiL2He3irWZfBm6bA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrheelgdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 30CBAB60086; Tue, 22 Nov 2022 12:16:03 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <501fbee3-cd3d-461c-9c79-0a5f2d1382b6@app.fastmail.com> In-Reply-To: References: <20221121171202.22080-1-vbabka@suse.cz> Date: Tue, 22 Nov 2022 18:15:39 +0100 From: "Arnd Bergmann" To: "Vlastimil Babka" , "Christoph Lameter" , "David Rientjes" , "Joonsoo Kim" , "Pekka Enberg" Cc: "Hyeonggon Yoo" <42.hyeyoo@gmail.com>, "Roman Gushchin" , "Andrew Morton" , "Linus Torvalds" , "Matthew Wilcox" , patches@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Aaro Koskinen" , "Christophe Leroy" , "Conor Dooley" , "Damien Le Moal" , "Geert Uytterhoeven" , "Janusz Krzysztofik" , "Jonas Bonn" , "Josh Triplett" , "Kees Cook" , linux-arm-kernel@lists.infradead.org, Linux-OMAP , linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, openrisc@lists.librecores.org, "Rich Felker" , "Russell King" , "Stafford Horne" , "Stefan Kristiansson" , "Tony Lindgren" , "Yoshinori Sato" Subject: Re: [PATCH 00/12] Introduce CONFIG_SLUB_TINY and deprecate SLOB Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Tue, Nov 22, 2022, at 17:59, Vlastimil Babka wrote: > On 11/22/22 17:33, Arnd Bergmann wrote: >> On Mon, Nov 21, 2022, at 18:11, Vlastimil Babka wrote: >> I can imagine those machines wanting to use sysfs in general >> but not for the slab caches, so having a separate knob to >> configure out the sysfs stuff could be useful without having >> to go all the way to SLUB_TINY. > > Right, but AFAIK that wouldn't save much except some text size and kobjects, > so probably negligible for >32MB? Makes sense, I assume you have a better idea of how much this could save. I'm not at all worried about the .text size, but my initial guess was that the metadata for sysfs would be noticeable. >> For the options that trade off performance against lower >> fragmentation (MIN/MAX_PARTIAL, KMALLOC_RECLAIM, percpu >> slabs), I wonder if it's possible to have a boot time >> default based on the amount of RAM per CPU to have a better >> tuned system on most cases, rather than having to go >> to one extreme or the other at compile time. > > Possible for some of these things, but for others that brings us back to the > question what are the actual observed issues. If it's low memory in absolute > number of pages, these can help, but if it's fragmentation (and the kind if > RAM sizes should have page grouping by mobility enabled), ditching e.g. the > KMALLOC_RECLAIM could make it worse. Unfortunately some of these tradeoffs > can be rather unpredictable. Are there any obvious wins on memory uage? I would guess that it would be safe to e.g. ditch percpu slabs when running with less 128MB per CPU, and the MIN/MAX_PARTIAL values could easily be a function of the number of pages in total or per cpu, whichever makes most sense. As a side-effect, those could also grow slightly larger on huge systems by scaling them with log2(totalpages). Arnd