Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp820011rdg; Wed, 11 Oct 2023 06:32:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAItuPEStDwAnhgJR3NqbzkVlDEZaUOsbY3FPzcOdnd91cLxLfQGktzlYFZCwLCKPpfUZd X-Received: by 2002:a05:6358:3418:b0:142:fb25:c7e6 with SMTP id h24-20020a056358341800b00142fb25c7e6mr25107967rwd.13.1697031129446; Wed, 11 Oct 2023 06:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697031129; cv=none; d=google.com; s=arc-20160816; b=XE4AmIArbxrqAhvnyVCAp+GFoFTLSk5cfe137mvqvXxKcCfP43fWz4hLFO9WHjwKH/ 3DI6CmaWw/dV7xmdgU/V1o+Xit9aMaaABbI0gjPeRjnG/MRVzdl7OHxXXbNa17RfQOQI 8J62iPFiakzpiJkbONHCSa0demGDKSk33krmdsCXEH8XqMMr1C9Sh8DZDqPpQ1aVCFoI ZpZxrtElJkdC2F70ELX+Ob7AhHTrLz4aI7jW3cbvVkVB38jzhPBvOLglwIb3xPePG8uA 8ujXiKKFzIEgjmjZM4QjXmrCzDWpLlM94u7qld2plJYZFNJgt3DFSINKiFUmZGCTrHe2 LF1Q== 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=HljStu/Mi1i6SudIv7bnTBAyqUy/d41TujLNpYF5gMY=; fh=3e3sgIyerFJGFJb3GCJbVHJo0NePGC1MzrNfPjbNvio=; b=TnEITnRdr6rOiZxxjAvoPpP6XZmDDXQw1bSBCKouqdeBc4/fiRPQMvvjorMMRAA+Dj EDdObd5ag7Ow2sm/NquTWo/WVouq6L2B4ZTL3g4Yr5TFXHvgBwWOEKasTzy3+SP7rfDq zJZSdbrqOPUmi5bFEE+lx/ao++7n1YBy4thNuH92mydjjllpQ8aLP5yuepfcWdIUbzBG 3C2Pws7GbHLYALqcmpDeyr0CSHSK+i+EnHXVWexUghdVpI/mKCPiboJeEATQqWLJT9I2 vlxTp3LRefp0z1j4yZKteA/CWAeAlGARsvINTNTHSsolPjyvUjIhMRpoVe5As+uOeOd6 qY7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=aY11rfjx; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id h71-20020a63834a000000b005a1d8815ec0si231586pge.37.2023.10.11.06.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 06:32:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=aY11rfjx; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 46C2E8089863; Wed, 11 Oct 2023 06:32:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234976AbjJKNbz (ORCPT + 99 others); Wed, 11 Oct 2023 09:31:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232185AbjJKNbx (ORCPT ); Wed, 11 Oct 2023 09:31:53 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7203690 for ; Wed, 11 Oct 2023 06:31: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 2817E1FEAE; Wed, 11 Oct 2023 13:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1697031111; 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=HljStu/Mi1i6SudIv7bnTBAyqUy/d41TujLNpYF5gMY=; b=aY11rfjxTE1FoeWh6i9Jql5jaIjxUPytLcWtK2OULeNH9XeIosVjcl49lSJGDZyiiQ7cHy M20he2RtrKjbkcjoo+3rja5ilfQxv4CHAHbRvKwWmX636VF65mmtSHPyVmRaeg2YNoqcWr Mj3A4BflLN/Rh6kui5F4I8rNOIujNBs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1697031111; 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=HljStu/Mi1i6SudIv7bnTBAyqUy/d41TujLNpYF5gMY=; b=PAmlM41fP4rh/VdU5dAsjrnxjAWX6nOLZNJeAgeEnJBWqG69vJKdY5DTG2uB0LffBORKle 8PfVse5bOIiYZHAw== 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 0A6E1134F5; Wed, 11 Oct 2023 13:31:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oB+/AcejJmVZTgAAMHmgww (envelope-from ); Wed, 11 Oct 2023 13:31:51 +0000 Message-ID: Date: Wed, 11 Oct 2023 15:31: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: [RESEND PATCH] mm: slab: Do not create kmalloc caches smaller than arch_slab_minalign() Content-Language: en-US To: Catalin Marinas Cc: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, Mark Rutland , Peter Collingbourne , Petr Tesarik References: <20231006163934.3273940-1-catalin.marinas@arm.com> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Wed, 11 Oct 2023 06:32:07 -0700 (PDT) On 10/9/23 13:20, Catalin Marinas wrote: >> > mm/slab_common.c | 7 +++++-- >> > 1 file changed, 5 insertions(+), 2 deletions(-) >> > >> > diff --git a/mm/slab_common.c b/mm/slab_common.c >> > index cd71f9581e67..8b45922ed295 100644 >> > --- a/mm/slab_common.c >> > +++ b/mm/slab_common.c >> > @@ -895,10 +895,13 @@ void __init setup_kmalloc_cache_index_table(void) >> > >> > static unsigned int __kmalloc_minalign(void) >> > { >> > + unsigned int minalign = dma_get_cache_alignment(); >> > + >> > if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) && >> > is_swiotlb_allocated()) >> > - return ARCH_KMALLOC_MINALIGN; >> > - return dma_get_cache_alignment(); >> > + minalign = ARCH_KMALLOC_MINALIGN; >> > + >> > + return ALIGN(minalign, arch_slab_minalign()); >> >> Could it be max() instead of ALIGN()? It would be more obvious, at least to >> me :) > > Yeah, max() would do since they are all a power of two. Do you want me > to repost? No need, picked up and changed locally. Thanks!