From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90DA7ECA; Sun, 9 Jul 2023 03:27:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 836CCC433C7; Sun, 9 Jul 2023 03:27:17 +0000 (UTC) Date: Sun, 9 Jul 2023 04:27:16 +0100 From: Catalin Marinas To: Amit Pundir Cc: Andrew Morton , Linus Torvalds , Christoph Hellwig , Robin Murphy , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Herbert Xu , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Jonathan Cameron , Vlastimil Babka , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Linux regressions mailing list Subject: Re: [PATCH v7 00/17] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8 Message-ID: References: <20230612153201.554742-1-catalin.marinas@arm.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Amit, On Wed, Jul 05, 2023 at 07:10:02PM +0530, Amit Pundir wrote: > On Wed, 5 Jul 2023 at 18:17, Catalin Marinas wrote: > > That's v7 of the series reducing the kmalloc() minimum alignment on > > arm64 to 8 (from 128). There's no new/different functionality, mostly > > cosmetic changes and acks/tested-bys. > > > > Andrew, if there are no further comments or objections to this version, > > are you ok to take the series through the mm tree? The arm64 changes are > > fairly small. Alternatively, I can push it into linux-next now to give > > it some wider exposure and decide whether to upstream it when the > > merging window opens. Thanks. > > This patch series broke Dragonboard 845c (SDM845) running AOSP. > With this series I run into random oops at __kmem_cache_alloc_node(). > Here is one such boot log https://bugs.linaro.org/attachment.cgi?id=1146 > > Reverting "arm64: Enable ARCH_WANT_KMALLOC_DMA_BOUNCE for arm64" > fixes it for the time being. I'm on holiday until the 24th, away from my computer and I don't have much time to dig into this. Are the DMA-capable devices on this platform non-coherent? We'd need to check whether the bouncing logic somehow overflows and corrupts adjacent memory. If the devices are coherent, maybe the DMA spills over the kmalloc() boundaries, now that we allocate buffers smaller than a cacheline even for DMA (no bouncing if the DMA is coherent). Also, are these devices behind an IOMMU? Yet another possibility is a not fully transparent system level cache with a line size larger than what's reported by the CTR_EL0.CWG. If you boot the platform with "swiotlb=noforce", do you still see issues? Or there's no swiotlb buffer allocated anyway. In addition to what Isaac suggests on slab debugging, it may be worth enabling DMA debugging as well (I don't remember the config name). -- Catalin 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 B8FB0EB64DD for ; Sun, 9 Jul 2023 03:28:03 +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=KHxtR92E5MrtjfZkMaPCEjfQ2mdVLDVFPyJb4Fd0s5k=; b=bHwnsOcwve2JWG zYqDp3GUozA3inPMizRvYeZ8KoNa+glI3U/rQa4R3INWsbslfCPEbTlBEfuZNCIme/Pi5SdzjZOsh lUoXLVa/rxT72SIzlXuSAkAf1/hH6kKKLhnnx8hmydJv3JW3ne2qioC/jf8ZhSd184YhCVTOD1WKE melZEfgW2bP1fNvZm2k3V0TzOyQQHkgg8X0QttrHoHFvAqmyhMBYU5AxYQmJhAnH+gpPzRp4xCqut 7rcMmuJdnzm9T9oXsKGRgLB5a6EMWnEED219P+wajCH1u+1PfFKlTnPfsc+PzviDQqY5iDDOuPTII HKmn7hr6KH42wZRe6qEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qIL56-008F3B-1Z; Sun, 09 Jul 2023 03:27:28 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qIL52-008F1e-0U for linux-arm-kernel@lists.infradead.org; Sun, 09 Jul 2023 03:27:27 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A8E5160010; Sun, 9 Jul 2023 03:27:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 836CCC433C7; Sun, 9 Jul 2023 03:27:17 +0000 (UTC) Date: Sun, 9 Jul 2023 04:27:16 +0100 From: Catalin Marinas To: Amit Pundir Cc: Andrew Morton , Linus Torvalds , Christoph Hellwig , Robin Murphy , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Herbert Xu , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Jonathan Cameron , Vlastimil Babka , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Linux regressions mailing list Subject: Re: [PATCH v7 00/17] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8 Message-ID: References: <20230612153201.554742-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-20230708_202724_254612_6DC2F106 X-CRM114-Status: GOOD ( 22.85 ) 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 Hi Amit, On Wed, Jul 05, 2023 at 07:10:02PM +0530, Amit Pundir wrote: > On Wed, 5 Jul 2023 at 18:17, Catalin Marinas wrote: > > That's v7 of the series reducing the kmalloc() minimum alignment on > > arm64 to 8 (from 128). There's no new/different functionality, mostly > > cosmetic changes and acks/tested-bys. > > > > Andrew, if there are no further comments or objections to this version, > > are you ok to take the series through the mm tree? The arm64 changes are > > fairly small. Alternatively, I can push it into linux-next now to give > > it some wider exposure and decide whether to upstream it when the > > merging window opens. Thanks. > > This patch series broke Dragonboard 845c (SDM845) running AOSP. > With this series I run into random oops at __kmem_cache_alloc_node(). > Here is one such boot log https://bugs.linaro.org/attachment.cgi?id=1146 > > Reverting "arm64: Enable ARCH_WANT_KMALLOC_DMA_BOUNCE for arm64" > fixes it for the time being. I'm on holiday until the 24th, away from my computer and I don't have much time to dig into this. Are the DMA-capable devices on this platform non-coherent? We'd need to check whether the bouncing logic somehow overflows and corrupts adjacent memory. If the devices are coherent, maybe the DMA spills over the kmalloc() boundaries, now that we allocate buffers smaller than a cacheline even for DMA (no bouncing if the DMA is coherent). Also, are these devices behind an IOMMU? Yet another possibility is a not fully transparent system level cache with a line size larger than what's reported by the CTR_EL0.CWG. If you boot the platform with "swiotlb=noforce", do you still see issues? Or there's no swiotlb buffer allocated anyway. In addition to what Isaac suggests on slab debugging, it may be worth enabling DMA debugging as well (I don't remember the config name). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel