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 1C7D0C021A4 for ; Mon, 24 Feb 2025 18:15:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8886228000E; Mon, 24 Feb 2025 13:15:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 837C028000D; Mon, 24 Feb 2025 13:15:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 689BD28000E; Mon, 24 Feb 2025 13:15:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3609028000D for ; Mon, 24 Feb 2025 13:15:23 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CDFE71CBB40 for ; Mon, 24 Feb 2025 18:15:22 +0000 (UTC) X-FDA: 83155640484.20.35ACFD6 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf21.hostedemail.com (Postfix) with ESMTP id 55B121C001E for ; Mon, 24 Feb 2025 18:15:20 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="Li+7Oa/n"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=0yGRLsnO; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="k/xS/ekK"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=hwADte08; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 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=1740420920; 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=M3Ef04I0Xna9Ma2aqsawRhgvFUFn8LFOS7cvkTxcg5w=; b=5F3WZk3TrR2dgpX44axDUnyyciIvkZgpcKiE8x6tO+oVNp5Mbs9sOeSo7slQn/nYT2u4/S imaptOD/t67KDPiWzm943kmxRMA7DCL8Yp6LCdQauW1Sh0yD8wR0+X7X+eTPIH5Rcv4Wh3 NEP6dwhDwPj22eCmFXPm1FPqAiQ/vgk= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="Li+7Oa/n"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=0yGRLsnO; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="k/xS/ekK"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=hwADte08; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740420920; a=rsa-sha256; cv=none; b=qQ55Ide8HZK0VrJiGmIPKnHcLmIgBAf8OfGG8LUIBZezQW2EkytJAojYxudRvGEQ2X1rwL Ih300s5bk+5elt/6wWOnUAaYjaWGhYKlR6aU6+MFTD4tdit3sbi87iotDvZLufYg8To0DS MohotbDx5U5sroP85A166iWxs9wK8gs= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3D7FC1F449; Mon, 24 Feb 2025 18:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740420918; 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:autocrypt:autocrypt; bh=M3Ef04I0Xna9Ma2aqsawRhgvFUFn8LFOS7cvkTxcg5w=; b=Li+7Oa/ngGPYp6ATBEO0/IcG3Z494t0kRvp1P24RV6v4C7JGLkeeEgncwPSZBVGhnCPG8X 9xx9X8IRE2Og8+kD5vCQZeWfQXKaZaADV9lYWdRXklQ57vSfaCoHVZg/jCTWp+PW3TSGsw +XmuWHqamxVzSdpyzu7YAL27b31QdDU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740420918; 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:autocrypt:autocrypt; bh=M3Ef04I0Xna9Ma2aqsawRhgvFUFn8LFOS7cvkTxcg5w=; b=0yGRLsnOu99CO21ds0vhmyffNA2oPayH2JHp/dNIyYNWRvaIXV3gVqDvyLMwhDvFaviXEw RGtkgTY+0GYhbSBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740420917; 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:autocrypt:autocrypt; bh=M3Ef04I0Xna9Ma2aqsawRhgvFUFn8LFOS7cvkTxcg5w=; b=k/xS/ekKFcyPN6TVmKeANcHwWrAmq6D6CaOfNHxRli4DWZzM3B5Q8YM1MqfGNd0rGs0b5J 7TrshSpEPreH07F8LzPpl3usyg+/e66CJiXJ0GbrKtwTRnpnqA/fLHSLmhCR/poVtGDaoj Zqqsfba1a4ponLXCRBZMjVbKiW0qJ8w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740420917; 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:autocrypt:autocrypt; bh=M3Ef04I0Xna9Ma2aqsawRhgvFUFn8LFOS7cvkTxcg5w=; b=hwADte08Ngot5RBluIGTqFYA+GmOn4VpZwlzAT/m+xBAVdc6Jc2dWRzyFr55q78J/vTGrI xvCy4A0EEI8GLCCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 20DE113707; Mon, 24 Feb 2025 18:15:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id j6TwBjW3vGdEEgAAD6G6ig (envelope-from ); Mon, 24 Feb 2025 18:15:17 +0000 Message-ID: <704ba4a7-37ec-4c6b-9de4-0c662e5c5ce1@suse.cz> Date: Mon, 24 Feb 2025 19:15:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [LSF/MM/BPF TOPIC] SLUB allocator, mainly the sheaves caching layer Content-Language: en-US To: Shakeel Butt Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, bpf , Christoph Lameter , David Rientjes , Hyeonggon Yoo <42.hyeyoo@gmail.com>, "Uladzislau Rezki (Sony)" , Alexei Starovoitov References: <14422cf1-4a63-4115-87cb-92685e7dd91b@suse.cz> From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; keydata= xsFNBFZdmxYBEADsw/SiUS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TyH+gydURl2wJuzo/aZ7Y7PpqaODbYv727Dvm5eX64HCyyAH0s6sOCyGF5/p eIhrOn24oBf67KtdAN3H9JoFNUVTYJc1VJU3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Rspam-User: X-Stat-Signature: gwz1tr9kthwq6xhiiz35j6pzdg44kr83 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 55B121C001E X-HE-Tag: 1740420920-823054 X-HE-Meta: U2FsdGVkX1/dcGeiL6iSinKXI0RJ2gyR4q3L07im2TkC+76Vx3w1uAqFrgBMRt6zGewRzrpPpUp5ogXJaRA4Pla4cthvt0GWxD2ueHHHJ9eZPgjkaASfmkVJU9+2uaoF+Um+h75oDRhQInQGGbgu5G1orXNxmvxjUN4b5zT0m9QXvXVGwm3TSGgLlmy0Mblxz4VmxIZs/yP1GR1oqcx5/HV951Kjc4n+NQcM3D66eKjgAKgsfbsCInkYwzZnto2zhrucU9TsE9dfWsG81UMPqra2Cv68dUNwPluFuH+fc+98t7ZJtm5vbDfiE+DOsJW+eMLiw5GpJzLlYeGLjLJe8t7i3H2DUcVUX7fIev4OYhN/3pob2w+LUE/giozlgzggHGDeDt7sV6rf3U1Em1kQqY77FberST86mU0xw5AtmGxspeK2sKVAkIx92tRiqqQtv10qGgQwzYd9nCTgVqWOb6PjJWGs520RXZ9le1HvsEidKngOmQv/fQSwdRGMjpHPO7TkwGCGlgu30O3OuN7CHTkJpTw6FnNlxBiMyV/8ZHVqL9npvEhdQYXt7+/5QyDXhiFVh+Lm4njKCMjF3ri2bWt7OXg87Dm7HV1eG1BAgq/b3Ep/X+CfzG3mE8FCfPnEw2jp1DHx2ryYyXF8MTu/jUK38/siCtXYFjgIrCcHTYVT/Kl6ed/F6hTasYtoPqzAv/gnl6eFw2CJ7VBr0+Btqyzok/kh+i0zx6D+mm4tc7zVfmqBEBeGnFTV5hWwrj2D+AhvnQ9+msX54vis3yhNhjN/bS93H3J2f83+SmUtbxtftglZyQsfZ53Tlcqj8mtww3PDvKei6O/V4OckYneNKlYA8JCc6FVg42W5ksvHnlpYMgcg52U9eGCh3ElqSRyi+Z9y6konDMMR6kZDZ/YmcqUPhxvNI0hv/oRmnfcKOux1n4yjpaxS7EZS1m/kMHEnbvz8gAaRjB7nh+9Zuhk BZXO3CRo 7FULJWvPng+VtpoVd5rqQXbhwqpZlj66qeg4wEmqhYCxIXTOWOsBXIfVPiCuxNa+pYGFz+gabKSjB2F6IZ4sngHLU9zaJWCRFWpackMOkE2rYblfkUNnXtcrh758vshT21UG+OXMhUrWszCt9DzHItHGM0L28BKwBQLMQfiqSBeUoJ0fF1fXwASdoIA71Uo1KGXpTMImKtPppLr4YhH3q7hdFu+Fo3hr17TrKjtNtrx/IXdSoOHPSUgKooWK100SmOwd1AIttvELdI+2OEZP3GA3pk8iYzIM94TU41gpu1bvlQuTiXYZfq9gKqZ+Z7Tm9aPVhjzc7ecS8MoGxF8lB0tUB//qbm07573VlWY4RAS6n9qQ= 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: List-Subscribe: List-Unsubscribe: On 2/24/25 19:02, Shakeel Butt wrote: > On Mon, Feb 24, 2025 at 05:13:25PM +0100, Vlastimil Babka wrote: >> Hi, >> >> I'd like to propose a session about the SLUB allocator. >> >> Mainly I would like to discuss the addition of the sheaves caching layer, >> the latest RFC posted at [1]. >> >> The goals of that work is to: >> >> - Reduce fastpath overhead. The current freeing fastpath only can be used if >> the same target slab is still the cpu slab, which can be only expected for a >> very short term allocations. Further improvements should come from the new >> local_trylock_t primitive. >> >> - Improve efficiency of users such as like maple tree, thanks to more >> efficient preallocations, and kfree_rcu batching/reusal >> >> - Hopefully also facilitate further changes needed for bpf allocations, also >> via local_trylock_t, that could possibly extend to the other parts of the >> implementation as needed. >> >> The controversial discussion points I expect about this approach are: >> >> - Either sheaves will not support NUMA restrictions (as in current RFC), or >> bring back the alien cache flushing issues of SLAB (or there's a better idea?) >> >> - Will it be possible to eventually have sheaves enabled for every cache and >> replace the current slub's fastpaths with it? Arguably these are also not >> very efficient when NUMA-restricted allocations are requested for varying >> NUMA nodes (cpu slab is flushed if it's from a wrong node, to load a slab >> from the requested node). >> >> Besides sheaves, I'd like to summarize recent kfree_rcu() changes and we >> could discuss further improvements to that. >> >> Also we can discuss what's needed to support bpf allocations. I've talked >> about it last year, but then focused on other things, so Alexei has been >> driving that recently (so far in the page allocator). > > What about pre-memcg-charged sheaves? We had to disable memcg charging > of some kernel allocations You mean due to bad performance? Which ones for example? Was the overhead due to accounting of how much is charged, or due to the associating memcgs with objects? > and I think sheaves can help in reenabling > it. You mean by mean having separate sheaves per memcg? Wouldn't that mean risking that too many objects could be cached in them, we'd have to flush eventually e.g. the least recently used ones, etc? Or do you mean some other scheme? Thanks, Vlastimil