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 63491C25B10 for ; Mon, 6 May 2024 21:05:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA4D96B0099; Mon, 6 May 2024 17:05:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C55326B009A; Mon, 6 May 2024 17:05:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B434C6B009C; Mon, 6 May 2024 17:05:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 974BB6B0099 for ; Mon, 6 May 2024 17:05:12 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3F661C059E for ; Mon, 6 May 2024 21:05:12 +0000 (UTC) X-FDA: 82089201264.23.3DC7102 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) by imf02.hostedemail.com (Postfix) with ESMTP id 443D080012 for ; Mon, 6 May 2024 21:05:09 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=IWMB6EWo; spf=pass (imf02.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.181 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715029509; 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=1NSJc03A4NZroirCU9H8CMzH7+blLGtfIep/PPbV5bo=; b=QwbzP9ozS/6WBQBkhcafPYAABTz3Yw6ws+zsfvDvIlUlURh8b+rBadAWiHZJFNtvht0ahB LSAZzL9ATjdp4kw2eTcotMTsk74CVZkIMRA/56iAzEJG3jaoiu43qUB36Dp8sMG6hD4cb6 kvaxvmE023jvVR+BtKRK5vKFSeEpaDs= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=IWMB6EWo; spf=pass (imf02.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.181 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715029509; a=rsa-sha256; cv=none; b=n3BUqg/qyp0r0ohc082YHruh0U69fqNLBv9CnUMjaZ8JiliJaNwrw7w9Cjd+FPHK0Nki5X GKWL1xck0qJnO7WlvOPHs12xdtS5Q6FYb0Qfxht7NI3QXIPXqWPfncHrKcly4vDWEjkUjD Trzfro6Jbk/NXMiK3vtkuiTTxFploA4= Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715029507; h=from:from: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; bh=1NSJc03A4NZroirCU9H8CMzH7+blLGtfIep/PPbV5bo=; b=IWMB6EWo+7kE0zqbM4YzEH+F7t/xlK6DuUiAZhAfxz8EotR4Vh3GuehN5Sh1XlRBbkdPJU rUhQKMeN3PX2xVe6PO4KGTSr1EIXXuzTe+EHXvddG62T3v6EXQsS2bB9PqEi/HDEJj4vmA Sv4wKRc/IUi9jrtwoOmDeGkgjP43wPg= Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] SLUB: what's next? X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin In-Reply-To: <67304905-57d7-47f5-937b-2c4fb95d13ba@suse.cz> Date: Mon, 6 May 2024 14:04:54 -0700 Cc: Michal Hocko , lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, bpf Message-Id: <3B8114F2-2284-441C-BC26-5AA95D02B7A0@linux.dev> References: <67304905-57d7-47f5-937b-2c4fb95d13ba@suse.cz> To: Vlastimil Babka X-Migadu-Flow: FLOW_OUT X-Stat-Signature: bgd8o54pjni4pyqt8yj5msw1imus4oun X-Rspam-User: X-Rspamd-Queue-Id: 443D080012 X-Rspamd-Server: rspam05 X-HE-Tag: 1715029509-153467 X-HE-Meta: U2FsdGVkX18+9zDIi0ej/Lyfh+3SFcP12ZyDUsJ0yVwTeUf83rZqVV2lF2ar1vRkQm9eILzq2xHlzQxJct8UZ5ku6aUS7w69mI4uXVMfYowa1BFi29vZn/pK4yAOdvzCIjw3QEMGMKBXGa9gbYFesDp2iUduZ7+dXATvi8K7SdPoonhCzo1GirohDb+2Ava6CAo8vHAONK+ao93ezZW2+nMT0ab/amn2TzlIHAwm6QaB/v1ZIeH8N1SKnyoSLuiIfuHPO5KYa+EQ4kWSi6qFiLtAqK173fovFh7JkNYi/W8W+HYuHNBr+mixRAsbYXI5qMqHF1ykc8P+tbzUV7e4q+yMAhP8PX/y24vDhD/Ueqe6CBiOrT5JjOGjEntOC7hR9JQI8fkS+htiEIz+57E/coerjMcMnM9JV0UE9WzDmSnIVglfF4bqH+XcLknYKgDFlbLOiM/HkR7VNM+Wuxht0S4YrZ+YtlDALc7w11GeU87XTTQ9xzau2RE5OHV2rLUHJa+iEu7W7VAXGmRSNsVKBMwXdqTmN5keZZdbW0esc3KIK/bvF7blYJ4iYcKncQQTPbpIol1/B2AgzHK/25cKjf6BLqp+ZllQuXHhqnPcdBGos4tWShzsg+ylZOWPludGEqsWbtuhuzpmz7OJICO4RUgUqcfnmCgLdjXOWRkcPFu1tXijhlPgHiyjTvsrVJxdXE1+atg/6GhatZ8ILL5aKOZrQGAOgGEP3FMkeK8zXkx3pfAjRLNjRKTnnSY5SWNMDJZfp9OJr6Ml6R7D8J75i/wd6ebfCVsEtssROmqP8oLFV5SCbnicHlu7aPTUxOF6peUyzWJjmiEdBrxUpCDKdoLMQ2JP1suqvZOLJdqi2Y16h2ivx9J7wyJjix9BRNOBgkGLoEeR+clXtSi6btG5bgYB9PPgXrS8a1fbwVEFM1fa2pOPY4Evp56O+6qPOsip318Fn1J1IxAZbW7AAaO 4+OFOq7T qoZDLmAMrXkwXJwfStr9Ub0D4Kkq6VHiwcXyZvVD5Qw5CMo1LvVigfPE3pOaTOu/4MF9jPKZKmXV/6QA/2Q/iN0Qhel3pfR9YpZCohEtNbChI49WOhdtwsjQo0Tbm54Zm0fRUUINVTgzK+nlXLEc8I9pTKKX2wGgfGLah 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 May 2, 2024, at 2:26=E2=80=AFAM, Vlastimil Babka wrote= : >=20 > =EF=BB=BF >=20 >> On 5/2/24 09:59, Michal Hocko wrote: >>> On Tue 30-04-24 17:42:18, Vlastimil Babka wrote: >>> Hi, >>>=20 >>> I'd like to propose a session about the next steps for SLUB. This is >>> different from the BOF about sheaves that Matthew suggested, which would= be >>> not suitable for the whole group due to being not fleshed out enough yet= . >>> But the session could be scheduled after the BOF so if we do brainstorm >>> something promising there, the result could be discussed as part of the f= ull >>> session. >>>=20 >>> Aside from that my preliminary plan is to discuss: >>>=20 >>> - what was made possible by reducing the slab allocators implementations= to >>> a single one, and what else could be done now with a single implementati= on >>>=20 >>> - the work-in-progress work (for now in the context of maple tree) on SL= UB >>> per-cpu array caches and preallocation >>>=20 >>> - what functionality would SLUB need to gain so the extra caching done b= y >>> bpf allocator on top wouldn't be necessary? (kernel/bpf/memalloc.c) >>>=20 >>> - similar wrt lib/objpool.c (did you even noticed it was added? :) >>>=20 >>> - maybe the mempool functionality could be better integrated as well? >>>=20 >>> - are there more cases where people have invented layers outside mm and t= hat >>> could be integrated with some effort? IIRC io_uring also has some cachin= g on >>> top currently... >>>=20 >>> - better/more efficient memcg integration? This is definitely an interesting topic, especially in a light of recent sla= b accounting performance conversations with Linus. Unfortunately I=E2=80=99m= not attending in person this year, but happy to join virtually if it=E2=80=99= s possible. It=E2=80=99s not yet entirely clear to me if the kmem accounting performance= problem exists outside of some micro-benchmarks. Additionally, Linus proposed to optimize for cases when allocations might be= short-living. In the proposed form it would complicate call sites significa= ntly, but maybe we need some sort of transactional api, e.g.: memcg_kmem_local_accounting_start(); p1 =3D kmalloc(GFP_ACCOUNT_LOCAL); p2 =3D kmalloc(GFP_ACCOUNT_LOCAL); =E2=80=A6 kfree(p1); memcg_kmem_local_accounting_commit(); In this case all allocations within the transaction will be saved to some te= mporarily buffer and not fully accounted until memcg_kmem_local_accounting_c= ommit(). This will make them way faster. But a user should guarantee that th= ese allocations won=E2=80=99t be freed from any other context until memcg_km= em_local_accounting_commit(). Thanks!=