From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15A26C433ED for ; Mon, 17 May 2021 14:24:20 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D56C3619A5 for ; Mon, 17 May 2021 14:24:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D56C3619A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZJxUJKkXLYvZraoNeHPdTJSjulNXFtrghe/aUHfEvOE=; b=h0MZY2avgryQX7QzCPSjXvmuW Yey1v9Hg9TCm6N1tmlIqv04BcsGvhbxRdQGLiUuuEbsHc8iYKmWGKl2t+Z9AWtswPmNb/AuHAtwoY Cv4dORQ9v2btdpqalH+FLLyjBwdjpAs3c/vz0qgwJlRswwTJedovF+ND7wjX9ma5XQwIromKm8Xpo oMq9wBXTjcBz8+4sIpd1wY4TjaeSrAo8CjZmSxg9oWu4cZzdL7SKfi8IuJ1JbB47GSeTcrLTkRmlP hlTeHv+P3F9lY8vvvP+Lq3XAVAsCE5GVD9XeSL9fTXMJCOCIvf7bb8f80sT5WX2AYIe5Sn+qaO1mo WVa1s2aNw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lie6p-00FEPR-2p; Mon, 17 May 2021 14:20:39 +0000 Received: from bombadil.infradead.org ([198.137.202.133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lie6l-00FEOq-JT for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 14:20:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Cj3W02e7NzL+ztRNr5txcFul3pShhoBfhfrCzeI7Ulc=; b=ap0d+PUGbeVTAwnz2AqFe7Zbnr y8TxFR9BBzhKH0cJF7So4IxSN4GCO/2lmyJSdJLuEoMV9QY9TgQ8Eu6HcOpr7+DZMC+jC2q9mbYmo LztISUszEPPzd4VBx0X0B+izTrzB+0AINfLTRnARAJKk7gjrZ2M0+18Y9jJ/CZwod0+4+BRYKgrlh hXhwtbMilBxpOF7ROFISA86pye7GLKGUNFw1RkgWxsIj7u2xAqSaeNFqHs6uIFCudITfFI6avOw4e A+Ooyl4vgD/8Cn9mbFN0keo0jubhSqFQuokqJ4Jxr/EtuUDDTCiLkcKIDlg0R/Qiyuye6f/qdUKiF Lu1M7Egw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lie6f-00Dqkr-L3 for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 14:20:34 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3778B61437; Mon, 17 May 2021 14:20:28 +0000 (UTC) Date: Mon, 17 May 2021 15:20:25 +0100 From: Catalin Marinas To: Arnd Bergmann Cc: Ard Biesheuvel , Vincent Whitchurch , Will Deacon , Linux ARM , kernel@axis.com Subject: Re: [PATCH] arm64: Make ARCH_DMA_MINALIGN configurable Message-ID: <20210517142025.GD1106@arm.com> References: <20210517074332.28280-1-vincent.whitchurch@axis.com> <20210517110406.GA1106@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_072029_728173_66BE1793 X-CRM114-Status: GOOD ( 19.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 17, 2021 at 03:35:39PM +0200, Arnd Bergmann wrote: > On Mon, May 17, 2021 at 2:01 PM Ard Biesheuvel wrote: > > On Mon, 17 May 2021 at 13:06, Catalin Marinas wrote: > > > On Mon, May 17, 2021 at 09:43:32AM +0200, Vincent Whitchurch wrote: > > > > > > Another option I recall discussing with Arnd about two years ago was to > > > start with the default 128 at boot but add the smaller slab caches > > > later, once we have more information. This can be just another 64 byte > > > cache or even go all the way down to 8 byte if all the devices are > > > cache coherent. > > > > > > > ARCH_SLAB_MINALIGN is also used to statically align (members of) > > struct types, so doing this at runtime is going to have limited > > effect. > > > > If a) ThunderX is the only platform we care about (do we?) that has > > 128 byte cachelines, and b) DMA is cache coherent on such platforms, > > couldn't we separate ARCH_SLAB_MINALIGN from ARCH_DMA_MINALIGN? I.e., > > set the first to 64 and keep the second at 128? > > What is the purpose of ARCH_DMA_MINALIGN then? If it's cache > coherent, does DMA buffer still need to be aligned to the cache line > size? For coherent DMA, we don't need the alignment from a correctness perspective. For performance, a driver can always pass SLAB_HWCACHE_ALIGN which ends up using cache_line_size(), so it gets the actual hardware value. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel