From patchwork Fri Oct 15 21:03:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12562783 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5F21C433F5 for ; Fri, 15 Oct 2021 21:03:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 346B6611CE for ; Fri, 15 Oct 2021 21:03:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 346B6611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8FBF6900002; Fri, 15 Oct 2021 17:03:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AB676B0072; Fri, 15 Oct 2021 17:03:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 799D7900002; Fri, 15 Oct 2021 17:03:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id 6ACF26B006C for ; Fri, 15 Oct 2021 17:03:40 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 16DCF39BA6 for ; Fri, 15 Oct 2021 21:03:40 +0000 (UTC) X-FDA: 78699898200.01.7F22D1B Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf10.hostedemail.com (Postfix) with ESMTP id 874F56001980 for ; Fri, 15 Oct 2021 21:03:37 +0000 (UTC) Date: Fri, 15 Oct 2021 23:03:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634331817; 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; bh=1msSm3Ty5Tf5iwnCTVDFA0MQFWN/h30fn+LSpeBF1PI=; b=ujcyHBQ7se6124JITJzEEDw0+O8Gsjzaqf73vin8ilyaDki8GvBarumRxfWN82NIetNJRg sy1bcdHzUr7QpoYCDH0DeagiZYT/FYmsSJOpl/2fxhWTdLEtLUvEWMmGUnDIoKMdPAPLIX eT49Y3yNyfjCjFdI/JlWAsgabfpgNhtLWLC6Mq6XMumNB83RkXbvbdXELBmNYRPUuu4Byy yfeAy3X2upmRkr7iWlMVpUk6sfGYhjJyPpfHU/68Yv5rT3gsH0ihmU9wVEyFQXqCw71+zD IISC0zySt/PoknEZkxZ5Ht7gV86O6mBV8uTaAniqJ0UIoU1Q7NhZcnco3b+zJQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634331817; 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; bh=1msSm3Ty5Tf5iwnCTVDFA0MQFWN/h30fn+LSpeBF1PI=; b=54l4eFXhlMNe1N5wLcwLSbsnOb72dC1r1LHhDfd5kbYqzzh55RiMxFD43Je4VTFzmWbrOZ YBURZPBaAHTzZoAw== From: Sebastian Andrzej Siewior To: linux-mm@kvack.org Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Ingo Molnar , Thomas Gleixner Subject: [PATCH] mm: Allow only SLUB on PREEMPT_RT Message-ID: <20211015210336.gen3tib33ig5q2md@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 874F56001980 X-Stat-Signature: mixgxtttxod4cxeaeiprwkwo5bwq1fs4 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=ujcyHBQ7; dkim=pass header.d=linutronix.de header.s=2020e header.b=54l4eFXh; spf=pass (imf10.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de X-HE-Tag: 1634331817-3 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: From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:03 -0500 Memory allocators may disable interrupts or preemption as part of the allocation and freeing process. For PREEMPT_RT it is important that these sections remain deterministic and short and therefore don't depend on the size of the memory to allocate/ free or the inner state of the algorithm. Until v3.12-RT the SLAB allocator was an option but involved several changes to meet all the requirements. The SLUB design fits better with PREEMPT_RT model and so the SLAB patches were dropped in the 3.12-RT patchset. Comparing the two allocator, SLUB outperformed SLAB in both throughput (time needed to allocate and free memory) and the maximal latency of the system measured with cyclictest during hackbench. SLOB was never evaluated since it was unlikely that it preforms better than SLAB. During a quick test, the kernel crashed with SLOB enabled during boot. Disable SLAB and SLOB on PREEMPT_RT. [bigeasy: commit description.] Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Acked-by: Vlastimil Babka --- init/Kconfig | 2 ++ 1 file changed, 2 insertions(+) --- a/init/Kconfig +++ b/init/Kconfig @@ -1896,6 +1896,7 @@ choice config SLAB bool "SLAB" + depends on !PREEMPT_RT select HAVE_HARDENED_USERCOPY_ALLOCATOR help The regular slab allocator that is established and known to work @@ -1916,6 +1917,7 @@ config SLUB config SLOB depends on EXPERT bool "SLOB (Simple Allocator)" + depends on !PREEMPT_RT help SLOB replaces the stock allocator with a drastically simpler allocator. SLOB is generally more space efficient but