Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1182860rdb; Wed, 20 Sep 2023 01:52:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJBMY0wpN/tcog4d8a3NO3Y/o7vg4TLlSAck7wN64nePNGBgRKSUtxE+YJc7C+JXdCNTm7 X-Received: by 2002:a05:6358:7e55:b0:142:d40b:817c with SMTP id p21-20020a0563587e5500b00142d40b817cmr2254264rwm.2.1695199966945; Wed, 20 Sep 2023 01:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695199966; cv=none; d=google.com; s=arc-20160816; b=ghEVNLBdYlR5k9g5ueGL8M3bCD2CSNW49AGfpaj4cVtFvQsDt+GJIIMKOZcHLefD/I yvvT+QeEnnIjlnwogQI/Jf1UXS4t1YVsRV+vraCxJT5bVFACbZMC2s2JPdG0rupCxENG UzDshYd73oFWggvKDkG9fkRCzZc0EKAwktStelt6o/MUiiojohXUJC1xHV4yySDKPW+S wvil8XImkqssBKWEm+N2YUrVCTHzo8RA+wxmSMEszgwpeK4/b8rsfFovGxbYSjrIiK36 U2347syVyIiwP34XZQX8TsGZXmR2aTYcGX87dB/+rCn+P3tjRXPOit3br+bJBpxFqEVZ sjew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=HX5pPg3EIgB5tnraIeoBZTHS0SCTNA9W4l/mVV5w2no=; fh=fe5j8yUfbpa0EfRV97Qb831ahK/1iaSSL4vJqus8dTI=; b=xhFU/vhDkejRHzdl0ZjDqFZX74ZUVsDTu11HupmGiLxv5CpGTM3lsdXRSdylW57zDq E7PDEpGPNiGEUwToBr+706+GuvjgeGYNlcitn35nf2wajX7iyJqPFjpPs3g4bgMfH8kO +oT4V8D0nlJKLmlTVpxcyB3MAHsH3tsKGPtnc4u1UX2KAyHvk0KPdkCIRpR/8hIt9sTT TgiBs9csHEg3YyLRe2SXOUBZu0xK0MO3BEgiMTJt/kNiymKN0V95kPgWLnEUnBY5fuGD 3vK56iDkz0fUsHeEyz0qFdftVC5xu9CVC7sZ9PL7zERRFiyu1w8k3cqpCPU/E7zWh0EM eHVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LHVFHkXQ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l5-20020a633e05000000b0056c2892bfb9si3631406pga.644.2023.09.20.01.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 01:52:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LHVFHkXQ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E9608826E8CC; Wed, 20 Sep 2023 01:50:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233861AbjITIuB (ORCPT + 99 others); Wed, 20 Sep 2023 04:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233853AbjITIt7 (ORCPT ); Wed, 20 Sep 2023 04:49:59 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35D7BDC; Wed, 20 Sep 2023 01:49:52 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 419801FE0A; Wed, 20 Sep 2023 08:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1695199791; h=from:from:reply-to: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=HX5pPg3EIgB5tnraIeoBZTHS0SCTNA9W4l/mVV5w2no=; b=LHVFHkXQ55/j0xSp+zPQLMOZ3OlKzq82cbMsy3h/grCDs2mXdcylirJP/DxG52b++qCDfG fI5JcmZV4PWWa+4eARqDxPaBl37nm9P76+W/o166WPruHNXqO1Ah+UKqIJ4Ka41VbbsgLl oq7pJ0qfkb0s2fwF4g5ljtQA0ePPK4s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1695199791; h=from:from:reply-to: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=HX5pPg3EIgB5tnraIeoBZTHS0SCTNA9W4l/mVV5w2no=; b=t468LGTetz8kGMyaGPGD279qVaYSRjdOcZU+YgTSUTf4EincTWPBRpxxEq7xwQqDQiYU2z BdCfOFI9FPXSBZCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CF004132C7; Wed, 20 Sep 2023 08:49:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4e28MS6yCmXeYAAAMHmgww (envelope-from ); Wed, 20 Sep 2023 08:49:50 +0000 Message-ID: <40bc28e5-c971-055f-eff4-b9d67fe768cc@suse.cz> Date: Wed, 20 Sep 2023 10:49:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [RFC PATCH 00/14] Prevent cross-cache attacks in the SLUB allocator Content-Language: en-US To: Matteo Rizzo , "Lameter, Christopher" Cc: Dave Hansen , penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, keescook@chromium.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, corbet@lwn.net, luto@kernel.org, peterz@infradead.org, jannh@google.com, evn@google.com, poprdi@google.com, jordyzomer@google.com, Mike Rapoport References: <20230915105933.495735-1-matteorizzo@google.com> <7a4f5128-28fd-3c5f-34c2-1c34f4448174@intel.com> <1d7573c0-ebbc-6ed2-f152-1045eb0542f9@os.amperecomputing.com> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 20 Sep 2023 01:50:06 -0700 (PDT) On 9/18/23 14:08, Matteo Rizzo wrote: > On Fri, 15 Sept 2023 at 18:30, Lameter, Christopher >> Problems: >> >> - Overhead due to more TLB lookups >> >> - Larger amounts of TLBs are used for the OS. Currently we are trying to >> use the maximum mappable TLBs to reduce their numbers. This presumably >> means using 4K TLBs for all slab access. > > Yes, we are using 4K pages for the slab mappings which is going to increase > TLB pressure. I also tried writing a version of the patch that uses 2M > pages which had slightly better performance, but that had its own problems. > For example most slabs are much smaller than 2M, so we would need to create > and map multiple slabs at once and we wouldn't be able to release the > physical memory until all slabs in the 2M page are unused which increases > fragmentation. At last LSF/MM [1] we basically discarded direct map fragmentation avoidance as solving something that turns out to be insignificant, with the exception of kernel code. As kernel code is unlikely to be allocated from kmem caches due to W^X, we can hopefully assume it's also insignificant for the virtual slab area. [1] https://lwn.net/Articles/931406/