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 476C8C369D5 for ; Mon, 28 Apr 2025 15:32:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 179FA6B00AD; Mon, 28 Apr 2025 11:32:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 12A306B00AE; Mon, 28 Apr 2025 11:32:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01A336B00AF; Mon, 28 Apr 2025 11:32:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D6A786B00AD for ; Mon, 28 Apr 2025 11:32:15 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4CA66BF7A5 for ; Mon, 28 Apr 2025 15:32:16 +0000 (UTC) X-FDA: 83383843872.07.B12AB62 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf17.hostedemail.com (Postfix) with ESMTP id 68A4140017 for ; Mon, 28 Apr 2025 15:32:14 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=rM6kTdsA; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of jannh@google.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=jannh@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745854334; a=rsa-sha256; cv=none; b=nRkAzWqc2r26T4kez7OlpcxqXPisF69I7ljQ70QRjwMUou4Bo8gJuv0t194zShP7lFlhHY +byLdE1W84+XEj1A4b0fMr+D0DQUeGgKI1pNW5myPzS0FycCIYjHziQjfUslNvmD/KdaA0 N8SGAZU8rcI2yy0xoM7dqibZVeknvfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745854334; 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=nmLbr0QfBL7nDQ7Do+E6unI9CTORi+km8ON0wncACA8=; b=RSx9YMJ80Hxc2AcOSZcWPqCse7ZdrhoKRwcRdI76SCxs06vrj8L3Lj6C4HY4giBMb9xPPC PuBImtvzPFdZKq8QqdMZ2Sixd8NVjAi3Ftr3ccO8rRlpPircuRkI8uqqzBab7Vld5otwfp NFobwO/yX2rtc3yZn2//QZBqoVspNiw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=rM6kTdsA; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of jannh@google.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=jannh@google.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5f09f2b3959so14984a12.0 for ; Mon, 28 Apr 2025 08:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1745854333; x=1746459133; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nmLbr0QfBL7nDQ7Do+E6unI9CTORi+km8ON0wncACA8=; b=rM6kTdsA7DCJGnzoo/SFEW5hsZ523EuA+ehFJNQROUzrQKbaCXB12bGtDjPzMvqcCw kHfx0b8jyu/DUKaXFy7N1AcpcBPKGvbp3Kcxfy75672fwH76l/Cgo6Mxp/fmDKDXTsvC zfEv13ynLdmnyGYRiJyQKuzS7WW8J3A2E5UDvq3ouxxAiBYwFlUT7NAb7jTqmtFthkfQ OhptIRk4dKbduP3Nb12WBjQ8IS4k/9ygAzro1IgL+LWkhkdB0GrBV8HUAW4cV5RflLly 5kqjg7UvZFE0HXiIibPa1O7b2Sy/oYK1OLvP9/lAv7n8ftZeBgNGX0ZVbXy5B4/+ORIW TJXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745854333; x=1746459133; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nmLbr0QfBL7nDQ7Do+E6unI9CTORi+km8ON0wncACA8=; b=m9/umRNhn3Wv16zfQU76Mjz9w3tYWzZyWNMx0n/sF/oZqZ1Rbc9RKPUJGxqJFPiUCH 0u8UwxSQqJwU0g+6qQ49qUBoyBNURZ5lbsGd1zvzgt+YQ2Bo/rqkEo1gR2T6zqgqXvgN AcEvJeMht2JHvBSqdhhgqU5t9PyORXxv8gtQ/qbT1cOvfhQGHCGbdF7XvjhCEzumidjh agTLasfqUmx9rh3WT9MowIV1HDdUNtig2OK07OaDQHEjqJrvOFjniZtieZuAp0YYwMYy G0Ts+2Uz2smILJ0WkR+mZuwJY6cRAj11SfcZ129WYIWje0PN8U5YCMbwexg3wTMLt78u Sl5w== X-Forwarded-Encrypted: i=1; AJvYcCUu7odOFBDe6KGAtfxM0gajytxKhOzX5oEjjyoOHuCiYktP2HnJ5wMVQgvezNBtATMR7sYsgtzaFg==@kvack.org X-Gm-Message-State: AOJu0YzMSAMRE9Uw2dqNY2G0uy7vOE4E0ZlKHJ4fdMpcQ6vr3XXVOzzy 0nWQBqwliL/BqsNNioORoszz3dt5EiEutp9+RyLjlWs7r+gg9cj1de7ws4fiVdn91zH4ex+WmzR Dk9mzqoH8+UOmFojBF4SicGoFicRqC9efCY9z X-Gm-Gg: ASbGnctHsM6fz5m+YyyLSjb602PXtI756kf5Zb06fffl8chvVJSs9JUTu0ARW2VQPGP wir9jiwxw+9q8RWSicUNa3/+5w/WQ7RPJbfqhcE0qi6NmxyhrW71N7fvwtGjdxrdIJl0vvgm3DT CbuMq00atfSpSt+oG5G6hoq4UyF4F9mAd1pcJvWaOgMFG4R108Mg== X-Google-Smtp-Source: AGHT+IF84Nn6NPsX+bxWPTXrEhUGbnt9K3w1eGwhLr03ufZxPzsGNDvb4a3p1sU4AnDqKiUv8LwfHFBw+Zzmb6mKrYo= X-Received: by 2002:a50:c34b:0:b0:5f7:6082:70f8 with SMTP id 4fb4d7f45d1cf-5f837abd157mr13740a12.4.1745854332470; Mon, 28 Apr 2025 08:32:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jann Horn Date: Mon, 28 Apr 2025 17:31:35 +0200 X-Gm-Features: ATxdqUHBaOfNMT6PjLtYaAWGm-NqUOuuf1CIY1n4CW21Em6RAd9g-wvKXQNhUyE Message-ID: Subject: Re: [DISCUSSION] Revisiting Slab Movable Objects To: Harry Yoo Cc: Dave Chinner , Christoph Lameter , David Rientjes , Andrew Morton , Roman Gushchin , "Tobin C. Harding" , Alexander Viro , Matthew Wilcox , Vlastimil Babka , Rik van Riel , Andrea Arcangeli , "Liam R. Howlett" , Lorenzo Stoakes , Pedro Falcato , David Hildenbrand , Oscar Salvador , Michal Hocko , Byungchul Park , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 68A4140017 X-Stat-Signature: pyxw15czeg5jutwh1wmuoaqx5zmhcdst X-Rspam-User: X-HE-Tag: 1745854334-205862 X-HE-Meta: U2FsdGVkX18YaRhX7yGoORWu5gw9OeBMA9VPy1YlXkfRj2mve+MCQAllXkCXaVgASyemLVTwIMBWmhluhwlEdl5Pyz3ga+QXoAStmrpdV/NYDtpoJt7gdWGfrGamPx+wXwgpUtjJNA25RU0qu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ter, 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 Fri, Apr 25, 2025 at 1:09=E2=80=AFPM Harry Yoo wr= ote: > On Tue, Apr 22, 2025 at 07:54:08AM +1000, Dave Chinner wrote: > > On Mon, Apr 21, 2025 at 10:47:39PM +0900, Harry Yoo wrote: > > > Hi folks, > > > > > > As a long term project, I'm starting to look into resurrecting > > > Slab Movable Objects. The goal is to make certain types of slab memor= y > > > movable and thus enable targeted reclamation, migration, and > > > defragmentation. > > > > > > The main purpose of this posting is to briefly review what's been tri= ed > > > in the past, ask people why prior efforts have stalled (due to lack o= f > > > time or insufficient justification for additional complexity?), > > > and discuss what's feasible today. > > > > > > Please add anyone I may have missed to Cc. :) > > > > Adding -fsdevel because dentry/inode cache discussion needs to be > > visible to all the fs/VFS developers. > > > > I'm going to cut straight to the chase here, but I'll leave the rest > > of the original email quoted below for -fsdevel readers. > > > > > Previous Work on Slab Movable Objects > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > > > Without including any sort of viable proposal for dentry/inode > > relocation (i.e. the showstopper for past attempts), what is the > > point of trying to ressurect this? > > Migrating slabs still makes sense for other objects such as xarray / mapl= e > tree nodes, and VMAs. Do we have examples of how much memory is actually wasted on sparsely-used slabs, and which slabs this happens in, from some real workloads? If sparsely-used slabs are a sufficiently big problem, maybe another big hammer we have is to use smaller slab pages, or something along those lines? Though of course a straightforward implementation of that would probably have negative effects on the performance of SLUB fastpaths, and depending on object size it might waste more memory on padding. (An adventurous idea would be to try to align kmem_cache::size such that objects start at some subpage boundaries of SLUB folios, and then figure out a way to shatter SLUB folios into smaller folios at runtime while they contain objects... but getting the SLUB locking right for that without slowing down the fastpath for freeing an object would probably be a large pain.)