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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0054AC433DB for ; Fri, 19 Mar 2021 19:23:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 70AF361962 for ; Fri, 19 Mar 2021 19:23:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70AF361962 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D3DC56B006E; Fri, 19 Mar 2021 15:23:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC6126B0070; Fri, 19 Mar 2021 15:23:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B40B66B0071; Fri, 19 Mar 2021 15:23:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id 952B06B006E for ; Fri, 19 Mar 2021 15:23:26 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 483F818098528 for ; Fri, 19 Mar 2021 19:23:26 +0000 (UTC) X-FDA: 77937597612.07.7211708 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 6377B3E8 for ; Fri, 19 Mar 2021 19:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616181773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yzBLyra/x1U0+SSJOrcy0pzeoO1kIL+ryJEPu6MRP8Q=; b=CNzhPUwnXeC5fwqqMu3LIAdiOCdMOYTaBayaXKeGXXd2h9an15j1CIe3HAulfWS1pd1/Pm 4Z28S5607CYc56s5+Ie1UGCds5CtsziUuwLAvfxg+9SbgzS+RL0w+JQrqfKRwK11II2P5g +ceMj8hU7CiSkAu8xofKO1FtPi0iktc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-308-aPYvQGA2NhSCroMbXFR6fg-1; Fri, 19 Mar 2021 15:22:51 -0400 X-MC-Unique: aPYvQGA2NhSCroMbXFR6fg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7D13801817; Fri, 19 Mar 2021 19:22:50 +0000 (UTC) Received: from optiplex-lnx.redhat.com (unknown [10.3.128.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id E53535D6D5; Fri, 19 Mar 2021 19:22:49 +0000 (UTC) From: Rafael Aquini To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] mm/slab_common: provide "slab_merge" option for !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT) builds Date: Fri, 19 Mar 2021 15:22:33 -0400 Message-Id: <20210319192233.199099-1-aquini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6377B3E8 X-Stat-Signature: zgjgnz5mhng5zmhradutp7iij7gpngeg Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf20; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=63.128.21.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616181774-389113 Content-Transfer-Encoding: quoted-printable 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: This is a minor addition to the allocator setup options to provide a simple way to on demand enable back cache merging for builds that by default run with CONFIG_SLAB_MERGE_DEFAULT not set. Signed-off-by: Rafael Aquini --- Documentation/admin-guide/kernel-parameters.txt | 7 +++++++ mm/slab_common.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentat= ion/admin-guide/kernel-parameters.txt index 04545725f187..06519eecbfec 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4877,6 +4877,10 @@ =20 slram=3D [HW,MTD] =20 + slab_merge [MM] + Enable merging of slabs with similar size when the + kernel is built without CONFIG_SLAB_MERGE_DEFAULT. + slab_nomerge [MM] Disable merging of slabs with similar size. May be necessary if there is some reason to distinguish @@ -4924,6 +4928,9 @@ lower than slub_max_order. For more information see Documentation/vm/slub.rst. =20 + slub_merge [MM, SLUB] + Same with slab_merge. + slub_nomerge [MM, SLUB] Same with slab_nomerge. This is supported for legacy. See slab_nomerge for more information. diff --git a/mm/slab_common.c b/mm/slab_common.c index 88e833986332..30db72269036 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -71,11 +71,19 @@ static int __init setup_slab_nomerge(char *str) return 1; } =20 +static int __init setup_slab_merge(char *str) +{ + slab_nomerge =3D false; + return 1; +} + #ifdef CONFIG_SLUB __setup_param("slub_nomerge", slub_nomerge, setup_slab_nomerge, 0); +__setup_param("slub_merge", slub_merge, setup_slab_merge, 0); #endif =20 __setup("slab_nomerge", setup_slab_nomerge); +__setup("slab_merge", setup_slab_nomerge); =20 /* * Determine the size of a slab object --=20 2.26.2