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 615AEC4332F for ; Mon, 12 Dec 2022 10:54:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 742848E0003; Mon, 12 Dec 2022 05:54:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6CBDB8E0002; Mon, 12 Dec 2022 05:54:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 545488E0003; Mon, 12 Dec 2022 05:54:34 -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 4202A8E0002 for ; Mon, 12 Dec 2022 05:54:34 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C1028160A2C for ; Mon, 12 Dec 2022 10:54:33 +0000 (UTC) X-FDA: 80233345626.17.D3F38E8 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf24.hostedemail.com (Postfix) with ESMTP id DA120180009 for ; Mon, 12 Dec 2022 10:54:30 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NPhcr4mM; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=O3k2kmLt; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670842471; a=rsa-sha256; cv=none; b=Pu0s9a0thEQnA9wtUkteUFqBdj+fNQur883sQilnk/CJNkMEl2M7NDi/FzVN3T2sJ3RWCL zJNzYpne+BitNhYmijy07yRoQe0NyNsIkIIVIbNgAx5SIzrFowO7QLS9gho1sOQ19CDVCy bJkV5dLLuk2h4TEKHG6rpuGn2Ku5/5c= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NPhcr4mM; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=O3k2kmLt; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670842471; 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=jz7Lips898H9fEO8FHmnp/U+76VwTMZfI3iV22huR7g=; b=FiEcZXqHUYaHcHTDaewiMVLIA+e9mdgQRVU0cBKz3m18r6UQXkBN6jRdSh6eo+Z9L8N4jy kT81W2xfu8SGGCIMy6l03qOVam1503joWhACHSF0vQIr8fuiTwSJSeRVZBTwmuD0mVCCih RGZM08m4dSm4I2GkgvAGL0+PgmQS4S8= 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 47AFF3380E; Mon, 12 Dec 2022 10:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1670842469; 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=jz7Lips898H9fEO8FHmnp/U+76VwTMZfI3iV22huR7g=; b=NPhcr4mM7jngyRfUkBlHonm+HGcTi0wz/1yZ/4z9opH+ikoBkU+eMJD5LcKrtJWEJ4kuRf 8wlEC2fB9ooi/Y4TL1B6T2Cuzm6uZHe2EoSSUjlkUUvHFK9IEETO0fFBYk3gAhlLFldx33 +L31eHsss/i+cwP6azCY7+7Zc3kd0uM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1670842469; 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=jz7Lips898H9fEO8FHmnp/U+76VwTMZfI3iV22huR7g=; b=O3k2kmLtaN98bHfuHywbtpiQfgfDvFKe3xdnCl/j7OeVZVogmPjrbyQWR6aW8L9zdbKTyp next6oVtHfsYK9BQ== 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 15B7F13456; Mon, 12 Dec 2022 10:54:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OPiABGUIl2MiUQAAMHmgww (envelope-from ); Mon, 12 Dec 2022 10:54:29 +0000 Message-ID: Date: Mon, 12 Dec 2022 11:54:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 10/12] mm, slub: remove percpu slabs with CONFIG_SLUB_TINY Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Baoquan He Cc: Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , Roman Gushchin , Andrew Morton , Linus Torvalds , Matthew Wilcox , patches@lists.linux.dev, Dennis Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20221121171202.22080-1-vbabka@suse.cz> <20221121171202.22080-11-vbabka@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: DA120180009 X-Stat-Signature: dwh48k3cnj96t6zy965hafpkr3mc3f6b X-HE-Tag: 1670842470-627792 X-HE-Meta: U2FsdGVkX1+s0e63G32YycwCJ4WXir1IHqhnlfGJ5qAocDabYRXEArfad4Rwn4FUnIW22ZD773vyi2CBy5Rouv/OGvuTfmixOXT/hLXS4ivTr+RS7NLHCORkVwpu3OHvxuXqkslz2KdJPoFaO46uzG8FJ2eCi5iA8Ogu7gzRVRw+dzRGaE5MgaKLEN3Lk8MIgGewrkgL0sbtsPR3gGkQjvDcNsZUVTm11Hmz76q+Mgg+YmoSwGT7vCYPdJbcHzhpok7Gmt6Qeamg8gBbti6U/pBJyci8mXQvqFJKnSytdhYfIUvBol4tZQCl82liC4StqVwvEQH78Kr1la0XVEwdjhCrZ68XXt4sD/SUod+w5mxHiqxgqQBMaXWlyp2eiRn7Xc6hjkp265+2LTbjW2ARfKgPGTbFvdyTFJJwozSXvnU2z4VQykOzbZX+SQ5dM+mREviaJFU9uBqX/ECtasEjcCsKGaoAks/o/aPmuLGNH3BDGelDoSIJ7Ap+7TbZSi53Cg6LjKSbCC/KGLxFOau1o13xY2ZERsozWHm0yh7YBAMKWDQ4+sASPIp2aOtFC5yZze7nydRm0jdhlPjZ662xx0tRYJJNLeX9hJRNT+C3JxddBD2M0VI2J8jWPde+mz1nekkXB2Wd9D9DJCPoPQKe/6x7rL2uz31snBEfCESeoBuRfa6hpMtGZ1JSjx0zlkcfTQvWTOdeGxEqmuy9Kg1iQULUq8tkB6KLNCVwJqzBDy+sB9rrQcrwFzclOwZ+0Yl/du3eFuvujlO9S7kwru08bYmurgbjNICli8kCE3ZGBQFRvowA49s69Tm9EE7FpO1LePg5+N53o+Bi4QO/h8AIJMFTvr1be6n6bij+sorH67N8NEq03QrhG6hC6ytydrC4yEDDwjtLUofhfV5bzPfSugSNXiFscD2oTLsOHWLSgioM3Q59orXgfN9IhfSP3ClRfDtN3C9ysMYieKufRFt ZHLO/EzD 3MHIquLOJXi7wJFWP3hn61qoQLTzBeiyFhD8aZLoTDDdN5CKad2KiyqKB5g== 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/27/22 12:05, Hyeonggon Yoo wrote: > On Mon, Nov 21, 2022 at 06:12:00PM +0100, Vlastimil Babka wrote: >> SLUB gets most of its scalability by percpu slabs. However for >> CONFIG_SLUB_TINY the goal is minimal memory overhead, not scalability. >> Thus, #ifdef out the whole kmem_cache_cpu percpu structure and >> associated code. Additionally to the slab page savings, this reduces >> percpu allocator usage, and code size. > > [+Cc Dennis] +To: Baoquan also. > Wondering if we can reduce (or zero) early reservation of percpu area > when #if !defined(CONFIG_SLUB) || defined(CONFIG_SLUB_TINY)? Good point. I've sent a PR as it was [1], but (if merged) we can still improve that during RC series, if it means more memory saved thanks to less percpu usage with CONFIG_SLUB_TINY. [1] https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git/tag/?h=slab-for-6.2-rc1 >> This change builds on recent commit c7323a5ad078 ("mm/slub: restrict >> sysfs validation to debug caches and make it safe"), as caches with >> enabled debugging also avoid percpu slabs and all allocations and >> freeing ends up working with the partial list. With a bit more >> refactoring by the preceding patches, use the same code paths with >> CONFIG_SLUB_TINY. >> >> Signed-off-by: Vlastimil Babka >