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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1511C77B7F for ; Tue, 16 May 2023 17:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=DMIUNiUqxUrUZDXWtmzfeRKgyOSQcmd8lFlLS8xeLJk=; b=wKYtL/c0SawI1H TIGGBK9VL4pEGHUwBikSCTZecbHjavoxk3wz1ZAU3OtmATnrTEPu3Gqva71aiWl5c+rSWkp7W1+qs 9kExPCu/cJuBVrwBSRjfu3ApqYmuC4e2DOAn31XxDSTVN5G5nTQQn+IP5u/hIugHlmZAKS0jTGf3B OLSkpXVUwbFLtczXj7ISDNOxQSNFFWTia4iuOBQll/0feRYvooZxg2g0DMXJZCB+OULoPCxfoUlO/ T1nb6Mhqx+GsG4+/3SIrth1I1780KhnOLUfUVtpes9LPAtmmmxVdzcTI2m3qNVqty+NX6+IXFsADW h7mFbcEZU6SyZfiQg/cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyyL4-006bgZ-2D; Tue, 16 May 2023 17:19:54 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyyL1-006bg1-1d for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 17:19:52 +0000 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 AFFF761224; Tue, 16 May 2023 17:19:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C18C6C433EF; Tue, 16 May 2023 17:19:46 +0000 (UTC) Date: Tue, 16 May 2023 18:19:43 +0100 From: Catalin Marinas To: Isaac Manjarres Cc: Linus Torvalds , Arnd Bergmann , Christoph Hellwig , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Andrew Morton , Herbert Xu , Ard Biesheuvel , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Robin Murphy , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Petr Tesarik Subject: Re: [PATCH v3 00/13] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8 Message-ID: References: <20221106220143.2129263-1-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_101951_605533_B8CBD293 X-CRM114-Status: GOOD ( 22.78 ) 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 15, 2023 at 12:09:12PM -0700, Isaac Manjarres wrote: > On Wed, Apr 19, 2023 at 05:06:04PM +0100, Catalin Marinas wrote: > > I rebased it locally but the last stumbling block is sorting out the > > iommu bouncing. I was hoping Robin Murphy can lend a hand but he's been > > busy with other bits. I'll repost the series at 6.4-rc1. > Hey Catalin, just following up on this. I think it might be worthwhile > to split this series into two series: > > Series 1: Decouple ARCH_KMALLOC_MINALIGN from ARCH_DMA_MINALIGN, > and use the cacheline size to determine the minimum kmalloc > alignment. > > Series 2: Lower the minimum kmalloc alignment to 8 bytes by adding > support for using SWIOTLB to bounce unaligned kmalloc buffers for DMA > transactions. > > Dividing the patches as such has the advantage of lowering the minimum > kmalloc alignment to 64 bytes on many ARM64 systems while the work for > lowering the minimum alignment to 8 bytes proceeds. This provides a > noticeable decrease in the slab memory footprint (e.g. I observed a 15 > MB decrease in slab usage on a device I was using). I attempted "series 1" some time ago and the discussion led to the combined approach (i.e. don't bother with limiting kmalloc minimum alignment to cache_line_size() but instead bounce those small buffers). In my series, I still have this fallback in case there's no swiotlb buffer. I'll post a new series this week (including DMA bouncing) but I'll try to move the bouncing towards the end of the series in case there are more discussions around this, at least the first part could be picked up. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel