Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3053813rwl; Sat, 1 Apr 2023 22:34:28 -0700 (PDT) X-Google-Smtp-Source: AKy350aHiQ6tqzsOaF8Xii4jGIpWv8lp5AQy7xtRFVJak9rNnnMWSRdLWyaAn61aOzH3DhpzWE0r X-Received: by 2002:a17:90b:1e43:b0:23d:1b50:1ebe with SMTP id pi3-20020a17090b1e4300b0023d1b501ebemr38430934pjb.27.1680413667964; Sat, 01 Apr 2023 22:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680413667; cv=none; d=google.com; s=arc-20160816; b=ajjmTQqyrBM2B9BRQXPWCvUvQHfW1ske8rW4a9sImVD7di/43sxJ/tXDn4tXAXTYUx cM2sSc5VJppJk/sRX+oX2mba4gUUl4ArDnl8KGYImjSWXhQwmojfhXZHCMY3TUJGkxaz LxGZYryTcwjjGHl+A+XX/FJvvnSpqnY6rdO/0lm/cQ4k1aT/AAdPIu3/vJMYn+wMbUre gxq5lV8uCNzpzT4RzfJL3UEfvbgEjgBRdJm6ze6r4PhcXoRj5QJzZyiU4eGv0IyyCLzj VoVq/tX0j2JDxQRzDpNw19S6LgsaZsJVaR4Pb8rZwl7Kzl0WRKFx7Iz5qMkH6vmJBIce DXCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HcLtKW5dA48qzTUGgoX0tKQeVpPNMnjuygndAHWt5os=; b=rRddztRdwAQIYZIbBv5FqVqqx8AJmXrHYK9jIGlVmiuBhk3lBkgAfx8Xa6jcgSTsyU DIXNZid3vNW3tUwRhp2isa07yzWKYNQODopGf+JkRVczxGeGWvkpTxhTrn9a0+zBffbT s7LKwhnDPLD8ooMOb6izk6uDCQ1lGkEEbj+BspLvkH0t0CmkieJUxYDTIttWLpBWs4Qf sHOmPueJ//7MVc22NJD5j8fCG2gPeAPMT65LiNHxfOQMQGb9FwrNJaeUJtcg8OZbq/xx mGzZvHnVmqh3RPmYrMWsaegGHQVzj/9pWuutvOzb+s/B5a8WIBTGeKBx8IXtkCN43a+f lKTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GMeoq310; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc10-20020a17090b3b8a00b0023672f9f970si3984302pjb.5.2023.04.01.22.34.06; Sat, 01 Apr 2023 22:34:27 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=GMeoq310; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbjDBFJq (ORCPT + 99 others); Sun, 2 Apr 2023 01:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjDBFJo (ORCPT ); Sun, 2 Apr 2023 01:09:44 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C173A27B for ; Sat, 1 Apr 2023 22:09:44 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id x15so24384909pjk.2 for ; Sat, 01 Apr 2023 22:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680412183; 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=HcLtKW5dA48qzTUGgoX0tKQeVpPNMnjuygndAHWt5os=; b=GMeoq310zOmtFnO+ZbfugK6HsZIFju4p8arLMffSNZlknshUAGo9SFe/6YEZaYgq7n MXwl9IoqYSYSO/IimzIITK28JnoDkfX4siV9m1Kf4yTFCa8Teznyz2hweCZjheEb7FW2 Ju754vzEaSgiGnK3K05hblR/sUQpF1LWdbPhHIovsnrQPUW4uYI7NygezqjeB3ZBlp2q U65wKQKQg5VQErOw4ut0Po+Fl57BVUK7NWS5oKuwamOxfkG9aBxqIVlnUHBv2Geehlbd Hgl77r/Qr1j8bJrgoO7qUsWN2LK6+QLWznxl7Vq3AzJ4GF9tCaM3Kg8ldEWq4NmRD0zx mxww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680412183; 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=HcLtKW5dA48qzTUGgoX0tKQeVpPNMnjuygndAHWt5os=; b=46Od7iZjHa6IE3MLA82OCM2DZ5Wr0t+HVWezkZbwS1vLXmKDknJ6pe/XVSFYDr4eIx A54QrYNRhJ81C9DEb5Bv5xLl7QmqU2/9JXeQvDIg7cncV4Osi0sszmHQxgLGJ6KdXYan ZV38r1DrhyCrsPZYUDket5eC9ofD3qLtIfTcGvMiWEBtnkpG7l9q4uxatgW1ToGXKSbK qQ2Zu5EJbYv9eYkI/iIgmi0fX+hQN8QmizP31BEOTWbKnkNEB6ZLGKdFLmd2iLIIc430 B3ZADkYHFIUHRopfnXsGj4XsNjNzBjg9hBRwKZdg02oYxvSD8wH7dXaDWMzqiOVfZ+z7 VG5A== X-Gm-Message-State: AAQBX9dzmATwv1xd6m07Yatjwa8WSrRBoP7R4uIhmyDVuJ9KtjIGyzY0 KYm6aw+Xv6l7zUsgsxKsRzOqyqSdHg0f6QeUGq2Rht57/KEFhg== X-Received: by 2002:a17:90a:5145:b0:23d:551c:c5fb with SMTP id k5-20020a17090a514500b0023d551cc5fbmr9770700pjm.4.1680412183513; Sat, 01 Apr 2023 22:09:43 -0700 (PDT) MIME-Version: 1.0 References: <20230401094658.11146-1-vbabka@suse.cz> In-Reply-To: <20230401094658.11146-1-vbabka@suse.cz> From: Jeff Xie Date: Sun, 2 Apr 2023 13:09:31 +0800 Message-ID: Subject: Re: [PATCH] mm: remove all the slab allocators To: Vlastimil Babka Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Sat, Apr 1, 2023 at 5:47=E2=80=AFPM Vlastimil Babka wro= te: > > As the SLOB removal is on track and the SLAB removal is planned, I have > realized - why should we stop there and not remove also SLUB? What's a > slab allocator good for in 2023? The RAM sizes are getting larger and > the modules cheaper [1]. The object constructor trick was perhaps > interesting in 1994, but not with contemporary CPUs. So all the slab > allocator does today is just adding an unnecessary layer of complexity > over the page allocator. > > Thus, with this patch, all three slab allocators are removed, and only a > layer that passes everything to the page allocator remains in the slab.h > and mm/slab_common.c files. This will allow users to gradually > transition away and use the page allocator directly. To summarize the > advantages: > > - Less code to maintain: over 13k lines are removed by this patch, and > more could be removed if I wast^Wspent more time on this, and later as > users are transitioned from the legacy layer. This no longer needs a > separate subsystem so remove it from MAINTAINERS (I hope I can keep the > kernel.org account anyway, though). > > - Simplified MEMCG_KMEM accounting: while I was lazy and just marked it > BROKEN in this patch, it should be trivial to use the page memcg > accounting now that we use the page allocator. The per-object > accounting went through several iterations in the past and was always > complex and added overhead. Page accounting is much simpler by > comparison. > > - Simplified KASAN and friends: also was lazy in this patch so they > can't be enabled but should be easy to fix up and work just on the > page level. > > - Simpler debugging: just use debug_pagealloc=3Don, no need to look up th= e > exact syntax of the absurdly complex slub_debug parameter. This really simplifies the complexity of dealing with memory problems in the production environment, and I hope it can be merged into the linux kernel soon. Acked-by: Jeff Xie --=20 Thanks, JeffXie