Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1842705rwi; Tue, 11 Oct 2022 00:47:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66tkF2Bo2QtALTgOCHQWq/NUZaxVEuqhJXsQ3d0Gpa6mOkZNogMBD803Ndb7LGrGmllotK X-Received: by 2002:a17:907:72d2:b0:78d:4c16:a68d with SMTP id du18-20020a17090772d200b0078d4c16a68dmr17876754ejc.401.1665474441108; Tue, 11 Oct 2022 00:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665474441; cv=none; d=google.com; s=arc-20160816; b=aEimJYKwzKSirypfxOnY5M36NcZEBM2+MTt8kYP6+EmKA5XAEWXRIy1UZIVSz1wrxA LYQUP62FKCv/VHg928vAwKISXaZJEbzgE4HBLEwGogFPBPs6kS2s9wtQrBMw8p/zGCXh 7bh+gvVaZkbPb+QZPylTRMP9lT2RTZDsk5qaRgPJcD4OqhFonfUjtPAJF+jln/T747Sq brguMDyxn3XDZ0fmMiItFk9xuZiug+XlbBnDzVMhn5T/I3AtDiUoE51dBpKUwYVKyzUX QzCEXUTTW0/rvRrAp/pJiTjVP9VjFgzuBQTjfdjMFkQ11Z0aJJeuFIcleGKqAmYjVXFI /Aqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YDvaSGB4gDllmSABGnkJgQ2jrqJW/arYGJijuFgBQSM=; b=Ra0U7ES9yty4gU76z2eULJpPZKTvZziQEtaAmu1pdVkt6Uk315PHaaYGOwoLNGzNza 8EaA+y5aujDmLuAihDkdD9xfX29u7t0hUAhVcAq7Y4Zb0lO+AChvnXeQoE4oKH9kGVzL Im1qqmbtOF38srIlYLQv45gdtxOWhhVAMzJcJJW5XlJ8kJb5fVxjn9H3Nyvmusfs8xdg ydJkEbdYmJXXx7y+TDZ4HLFlh1iBapMlyw1VODHszGQy1mtc5aEWPvsqE4LHd55Yg1pi xeIABejtccWHzedHo2FHt8hDonLE1Kbz5NkdssGy9mmlsLbAfN69tIvUA1IhjzrTbF6G 1FxA== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs13-20020a1709072d0d00b00783c42d2da2si15022055ejc.415.2022.10.11.00.46.55; Tue, 11 Oct 2022 00:47:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbiJKGkY (ORCPT + 99 others); Tue, 11 Oct 2022 02:40:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbiJKGkS (ORCPT ); Tue, 11 Oct 2022 02:40:18 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E63C13E8F for ; Mon, 10 Oct 2022 23:40:14 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id EC98A67373; Tue, 11 Oct 2022 08:40:10 +0200 (CEST) Date: Tue, 11 Oct 2022 08:40:10 +0200 From: Christoph Hellwig To: Jerry Snitselaar Cc: Christoph Hellwig , Robin Murphy , Joerg Roedel , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: Issue seen since commit f5ff79fddf0e ("dma-mapping: remove CONFIG_DMA_REMAP") Message-ID: <20221011064010.GA3646@lst.de> References: <20221010185739.vgw27m7fpmftly3q@cantor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221010185739.vgw27m7fpmftly3q@cantor> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham 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 Mon, Oct 10, 2022 at 11:57:39AM -0700, Jerry Snitselaar wrote: > I still need to grab a system and try to see what it is doing on the > subsequent shutdowns, because it seems to me that any time > bnx2fc_free_session_resc() is called it will end up there, unless the > allocs are not coming from vmalloc() in the later boots. Between the > comments in dma_free_attrs(), and preempt.h, dma_free_coherent() > shouldn't be called under a spin_lock_bh(), yes? It shouldn't. And you would have seen the same BUG_ON on many non-x86 architectures even beforethe commit.. > I think the comments > in dma_free_attrs() might be out of date with commit f5ff79fddf0e > ("dma-mapping: remove CONFIG_DMA_REMAP") in place since now it is more > general that you can land in vunmap(). Yes, the comment has always been a bit too specific, and is even more so now. > Also, should that WARN_ON() in > dma_free_attrs() trigger as well for the BH disabled case? Probably. And we should probably early return in that case to "just" leak the memory instead of crashing the kernel when called from a buggy driver.