Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp137420pxw; Fri, 8 Apr 2022 03:35:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPjD1Zfli9Ga1uRL3XW4vvPibAQ7MXTTR4AWB4p5uXgPVhm+J+EThvxIASHRvzoYm5K5gc X-Received: by 2002:a05:6402:51c6:b0:41d:196a:27a9 with SMTP id r6-20020a05640251c600b0041d196a27a9mr3812369edd.55.1649414114993; Fri, 08 Apr 2022 03:35:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649414114; cv=none; d=google.com; s=arc-20160816; b=RfZlXLp/OMv6irdyM4cLPeaN9899MVSbWBdSWU9g7pH9754zGzNA2Z/ezTV2xqv2vZ QEOrtDw+6NaLa9csk0x9N9OpOan9HBZMrI3eDoJ7j3k3UGixVFlEDiv00Tp5K/ZFlOmV +AJ3HaVn9OtWKaEQEKTnnqboHVIknQ6kLR558T36Bjf5Auqqd5yv4mXxiJ4zoiA1sr22 oTSayBhq57tkFJOco44EYyE77SVLdWiDk+R4Xl5w3T7UvjKT4di8+bCbm0Nga67rY4NF sbS3srmfU0LtIkgcLPYLtPZh3kiCqriEE1O1dy4EoxXn3dieSAzZFMxg8Kh6Aij15ACO NT9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jYeWLRq3w/QA/fgGz5d7DUt8TasCElEjUDqYwGdHypQ=; b=nd76zmIdknuNfBCS69jIhCLGmL76+gaNU27TEN4Ouzejy3Sc9FWodTnEvuXzDJIqL1 udyIApQih7OAlyxXJ4+ux/HZqKdMDDCOze0954At3cQOS/2NXl/cEnF9m2dTxtpybqqM zpXqLxRlsUWDb9OZ3/qnkvrho98OW2puaLvR93t0THVlyl689y7Ot3xdS2sqD5UNqw1e Je93+SeDI2udkNjDlnJuejctdwqngl0KZrzLPxafwsRgG3gB3/CfnSCc4yxTjBxcmVrm LXThCt70dCBhCU04LQKhxVpKCtw06j2jayQ9FUxIS04S68LymhoHRaj0aYIfocGTeprQ 6gCA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a1709062e8600b006dfe1d446f3si702862eji.84.2022.04.08.03.34.50; Fri, 08 Apr 2022 03:35:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232749AbiDHJUf (ORCPT + 99 others); Fri, 8 Apr 2022 05:20:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233241AbiDHJOt (ORCPT ); Fri, 8 Apr 2022 05:14:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3660B1E4 for ; Fri, 8 Apr 2022 02:11:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9C7A761C47 for ; Fri, 8 Apr 2022 09:11:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C19BC385A3; Fri, 8 Apr 2022 09:11:51 +0000 (UTC) Date: Fri, 8 Apr 2022 10:11:47 +0100 From: Catalin Marinas To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/10] mm/slab: Decouple ARCH_KMALLOC_MINALIGN from ARCH_DMA_MINALIGN Message-ID: References: <20220405135758.774016-1-catalin.marinas@arm.com> <20220405135758.774016-2-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, Apr 08, 2022 at 03:42:13PM +0900, Hyeonggon Yoo wrote: > On Tue, Apr 05, 2022 at 02:57:49PM +0100, Catalin Marinas wrote: > > diff --git a/include/linux/slab.h b/include/linux/slab.h > > index 373b3ef99f4e..d58211bdeceb 100644 > > --- a/include/linux/slab.h > > +++ b/include/linux/slab.h > > @@ -187,17 +187,30 @@ bool kmem_valid_obj(void *object); > > void kmem_dump_obj(void *object); > > #endif > > > > +/* > > + * slob does not support independent control of ARCH_KMALLOC_MINALIGN and > > + * ARCH_DMA_MINALIGN. > > + */ > > +#ifdef CONFIG_SLOB > > +#undef ARCH_KMALLOC_MINALIGN > > +#endif > > I think you should replace ARCH_KMALLOC_MINALIGN with ARCH_DMA_MINALIGN > in mm/slob.c too? Or detect minimum kmalloc alignment in runtime like SLAB/SLUB? One step at a time. The slob approach is a bit different, doesn't generate kmalloc-* caches, so I did not look at it yet. Also based on Vlastimil's email, there is some reworking going on in there already. > current code seem to break with SLOB on machines that has 128 byte cache lines > because ARCH_KMALLOC_MINALIGN is 64? Does it? The point of the #undef above was precisely to make sure ARCH_KMALLOC_MINALIGN stays the same as ARCH_DMA_MINALIGN when CONFIG_SLOB is enabled. -- Catalin