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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EF44C3DA71 for ; Fri, 16 Dec 2022 12:53:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230261AbiLPMxI (ORCPT ); Fri, 16 Dec 2022 07:53:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbiLPMxD (ORCPT ); Fri, 16 Dec 2022 07:53:03 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D463724979 for ; Fri, 16 Dec 2022 04:53:02 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 112861042; Fri, 16 Dec 2022 04:53:43 -0800 (PST) Received: from [10.57.88.234] (unknown [10.57.88.234]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 44FBC3F5A1; Fri, 16 Dec 2022 04:53:01 -0800 (PST) Message-ID: Date: Fri, 16 Dec 2022 12:52:56 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [6.2][regression] after commit ffcb754584603adf7039d7972564fbf6febdc542 all sound devices disappeared (due BUG at mm/page_alloc.c:3592!) Content-Language: en-GB To: Christoph Hellwig Cc: Mikhail Gavrilov , Takashi Iwai , alsa-devel@alsa-project.org, m.szyprowski@samsung.com, Linux List Kernel Mailing , iommu@lists.linux.dev References: <20221216064645.GA24446@lst.de> <20221216121519.GA5710@lst.de> From: Robin Murphy In-Reply-To: <20221216121519.GA5710@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-12-16 12:15, Christoph Hellwig wrote: > On Fri, Dec 16, 2022 at 11:40:57AM +0000, Robin Murphy wrote: >> On 2022-12-16 06:46, Christoph Hellwig wrote: >>> Ok, it seems like the sound noncontig alloc code that I already >>> commented on as potentially bogus GFP_GOMP mapping trips this. I think >>> for now the right thing would be to revert the hunk in dma-iommu.c >>> (see patch below). The other thing to try would be to remove both >>> uses GFP_COMP in sound/core/memalloc.c, which should have the same >>> effect. >> >> Or we explicitly strip the flag in dma_alloc_noncontiguous() (and maybe >> dma_alloc_pages() as well) for consistency with dma_alloc_attrs(). That >> seems like it might be the most robust option. > > In the long run warning there and returning an error seems like the > right thing to do, yes. I'm just a little worried doing this right now > after the merge window. Fair point, I guess nobody else actually implements dma_alloc_noncontiguous(), and dma_alloc_pages() seems a bit of a grey area since it is more of an explicit page allocator. So yeah, just restoring iommu-dma (perhaps with a mild VM_WARN_ON?) seems like a sufficiently safe and sensible fix for the short term. You can have my pre-emptive ack for that. Cheers, Robin. 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 98A89C4332F for ; Fri, 16 Dec 2022 12:54:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 647771726; Fri, 16 Dec 2022 13:53:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 647771726 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1671195241; bh=HXicrpVGSs45QjFCn3qWCjtAq4jw9KOqWgvsOhJgeOA=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=pDveyqvaXUruquLYkoBLTNcHYrzx20pVSQugAU7IFt2d44VRiem6BQe4c7p0L0wQc QuCcZlyDY88awjCxAN9v0aWLZb6f/trESTt1oK/o9aRn9vZkhEdVYII5WiYvGtrULz ABwTPZhyoAm7FzN1jHxHVqMOFcvU81DzZuQa9D5s= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 108EEF804E0; Fri, 16 Dec 2022 13:53:11 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EA4D7F804E2; Fri, 16 Dec 2022 13:53:09 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by alsa1.perex.cz (Postfix) with ESMTP id 31265F804D7 for ; Fri, 16 Dec 2022 13:53:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31265F804D7 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 112861042; Fri, 16 Dec 2022 04:53:43 -0800 (PST) Received: from [10.57.88.234] (unknown [10.57.88.234]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 44FBC3F5A1; Fri, 16 Dec 2022 04:53:01 -0800 (PST) Message-ID: Date: Fri, 16 Dec 2022 12:52:56 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [6.2][regression] after commit ffcb754584603adf7039d7972564fbf6febdc542 all sound devices disappeared (due BUG at mm/page_alloc.c:3592!) Content-Language: en-GB To: Christoph Hellwig References: <20221216064645.GA24446@lst.de> <20221216121519.GA5710@lst.de> From: Robin Murphy In-Reply-To: <20221216121519.GA5710@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Takashi Iwai , Linux List Kernel Mailing , iommu@lists.linux.dev, Mikhail Gavrilov , m.szyprowski@samsung.com Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 2022-12-16 12:15, Christoph Hellwig wrote: > On Fri, Dec 16, 2022 at 11:40:57AM +0000, Robin Murphy wrote: >> On 2022-12-16 06:46, Christoph Hellwig wrote: >>> Ok, it seems like the sound noncontig alloc code that I already >>> commented on as potentially bogus GFP_GOMP mapping trips this. I think >>> for now the right thing would be to revert the hunk in dma-iommu.c >>> (see patch below). The other thing to try would be to remove both >>> uses GFP_COMP in sound/core/memalloc.c, which should have the same >>> effect. >> >> Or we explicitly strip the flag in dma_alloc_noncontiguous() (and maybe >> dma_alloc_pages() as well) for consistency with dma_alloc_attrs(). That >> seems like it might be the most robust option. > > In the long run warning there and returning an error seems like the > right thing to do, yes. I'm just a little worried doing this right now > after the merge window. Fair point, I guess nobody else actually implements dma_alloc_noncontiguous(), and dma_alloc_pages() seems a bit of a grey area since it is more of an explicit page allocator. So yeah, just restoring iommu-dma (perhaps with a mild VM_WARN_ON?) seems like a sufficiently safe and sensible fix for the short term. You can have my pre-emptive ack for that. Cheers, Robin.