Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1069899pxb; Wed, 6 Apr 2022 08:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnDtHA5hE9UWcMHTFrSJvg9/0+AguOfHZN9XJRoMy5pzwGsu+LNJ5wc6VNNgrTN7FLINLP X-Received: by 2002:a05:6a00:2181:b0:4f6:f1b1:1ba7 with SMTP id h1-20020a056a00218100b004f6f1b11ba7mr9355837pfi.73.1649257360349; Wed, 06 Apr 2022 08:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649257360; cv=none; d=google.com; s=arc-20160816; b=tNQ14Mt5MRjUJx1io4ngeRZymcWzL5WUvYhr8z+vU0eM09nPiZTUMA08gRcOa+W8jt a2seoHrLSFvA5jLzy2gJykt/wPjqUhMaVoXG2jzKqphfsMAgHaBObHI/6niz1BDlmXi3 a7/pcRwirQT8/eHnsJ0DnCaNu4Ha0b+vJC6nE6YLJkwxK3yWY8ZZQYji5GaXyI7FgZ6l 2hr4MPeoNgeLjFAVG9zBYEp+Jqem+v4pQD2ryv4WJDVnMHAGXdd5fOuW78vy2QTzYJO4 qSza5Fp86nN9dIKsTOJ+IvJ5fb6ayAQut9RnsdSeASsNZOeWILYpSgVSyv4eH3HSxqk7 0yZw== 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=v0gMBAam7eXkJWPPVRvXseM+ZRPSLdEebDCITnAydG0=; b=IXHZaSD9tj0Op0Xo8MzJp9QnFI9ZufGGxLvWt8fhViXUjHMyZJjPBiPLKr3ONgwr+Q A18F5pvbaZU/MR9qyyHS7umhC/c5V3w/dVZbIRsPERvtzhLR3RQ4AR/g29vh8rPPrGlx TVEML5iXyP5XkvKzsmKl67x07QooNZsSDSJ/gsBdIKEr8BdZlvas2INcrkiEGUxIZQ5H fzdPwlpRqemw1FRZIcHdYqaHkZY+LOvt73V1VQldXRLYdHOetM2O4wXCiP0TsM3aizuh zu4VVv1J2DQzCHV9CV1nFfw7lH8Vhtg6KqQhabHWCMMjsUpeTK1F1wa47ixyse726AVF RIGg== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u20-20020a634714000000b0039859d7cf84si15881746pga.256.2022.04.06.08.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1C9CB2AF26C; Wed, 6 Apr 2022 05:49:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbiDFMuC (ORCPT + 99 others); Wed, 6 Apr 2022 08:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbiDFMth (ORCPT ); Wed, 6 Apr 2022 08:49:37 -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 AEEB048B848 for ; Wed, 6 Apr 2022 01:53:09 -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 49F4061372 for ; Wed, 6 Apr 2022 08:53:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7A69C385A5; Wed, 6 Apr 2022 08:53:05 +0000 (UTC) Date: Wed, 6 Apr 2022 09:53:02 +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, cl@linux.com, vbabka@suse.cz, iamjoonsoo.kim@lge.com, rientjes@google.com, penberg@kernel.org, roman.gushchin@linux.dev 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=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Apr 06, 2022 at 08:59:18AM +0900, Hyeonggon Yoo wrote: > On Tue, Apr 05, 2022 at 02:57:49PM +0100, Catalin Marinas wrote: > > In preparation for supporting a dynamic kmalloc() minimum alignment, > > allow architectures to define ARCH_KMALLOC_MINALIGN independently of > > ARCH_DMA_MINALIGN. In addition, always define ARCH_DMA_MINALIGN even if > > an architecture does not override it. > > [ +Cc slab maintainer/reviewers ] > > I get why you want to set minimum alignment of kmalloc() dynamically. > That's because cache line size can be different and we cannot statically > know that, right? > > But I don't get why you are trying to decouple ARCH_KMALLOC_MINALIGN > from ARCH_DMA_MINALIGN. kmalloc'ed buffer is always supposed to be DMA-safe. Arnd already replied. With this series, kmalloc'ed buffers are still DMA-safe for the SoC the kernel is running on. -- Catalin