Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp136648pxa; Thu, 13 Aug 2020 22:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdsgdJaohhmSVIBTesu3ybxUYdlvA1lWhtZL0LxGVe3OgRR4l80Zor/Wsh32F2gYz/lBcg X-Received: by 2002:a17:906:98c1:: with SMTP id zd1mr962482ejb.410.1597384083945; Thu, 13 Aug 2020 22:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597384083; cv=none; d=google.com; s=arc-20160816; b=05s2JpnaXtZSL7IiRxzhyWPIiAuI3LTo5TOCp0JC4psXkdR7YE4pq+FzB2e7NjSlZo m96n251+RKmQLwBoNjXNBg4x3Ndbx1lKg9P07T05fyfcCr5aDUbbxshc1aG28LhtP3EH ye7k5CWUMrhDDlzKFDVx1Ayv26WXRk1RVZdQWDGLHV1MwXlwTHnPvQ+OqaBmotJ12ERV 9xfdENyYRnjw7zHfrJRYP/tQ+jY/ZsYm8cTAKBYfTdX44bXMIHnyY1Gy+ZeV6JCO+7sL EtnPFfBAHqhputLFJguBSKT6x6zABmqpgX3YXbI9jzuqeH8bVmTCdBd8vS5sllYU4Qys eJ1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zyxIDKldttU332Yzic3idEGx2ZsayQ9gcfQhRTMUUUw=; b=F7rvKpsvDs5KHVIzuDxHwRGspMxuTsbj9UAw0th9yH26tKjBxSS3/hu8FT9Y25SXie zCJlhVx0xf4k0RADhUj7oc1OVL3J98SPKZMUHCvvLgwAzJvR3NAJ7GPrEdJttAUlsL5N JU8FMcHokjcC0GhNWsRPEMQSLmLZv8ORXuts3nzeVI3iyn335fUziA93ybll0b0zNITD l/jwFlX3cwlWDylcoiyPfaRPVkzygZ2NOwicD+wSwu7F4FjNiNmZC3LUiC+GJEuDwDg0 5myoSCeZJhOCjwzOJQft+jmkoeLOhWFsVLwC2HKR9DC9B0IUY6KxYjKL1nkXqUuYALo/ DCjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si4935454edu.248.2020.08.13.22.47.40; Thu, 13 Aug 2020 22:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgHNFmr (ORCPT + 99 others); Fri, 14 Aug 2020 01:42:47 -0400 Received: from verein.lst.de ([213.95.11.211]:48371 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgHNFmq (ORCPT ); Fri, 14 Aug 2020 01:42:46 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 58BF068C7B; Fri, 14 Aug 2020 07:42:42 +0200 (CEST) Date: Fri, 14 Aug 2020 07:42:41 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: Hugh Dickins , Christoph Hellwig , Andrew Morton , Dan Williams , Eric Dumazet , iommu , Linux Kernel Mailing List , Linux-MM Subject: Re: [PATCH] dma-debug: fix debug_dma_assert_idle(), use rcu_read_lock() Message-ID: <20200814054241.GA719@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2020 at 12:02:41PM -0700, Linus Torvalds wrote: > Yeah, that's ridiculously expensive, and serializes things for no good reason. > > Your patch looks obviously correct to me (Christoph?), It also looks correct to me. > but it also > makes me go "why are we doing this in the first place"? > > Because it looks to me like > (a) the debug check is wrong > (b) this is left-over from early debugging > > In particular, I don't see why we couldn't do a COW on a page that is > under writeback at the same time. We're not changing the page that is > doing DMA. Yes. We don't need to check for a DMA to the device, but a DMA from the device while under DMA obviously is bogus. But then again you'd need to try really hard to do that. > In fact, the whole "COW with DMA" makes me feel like the real bug may > have been due that whole "ambiguous COW" thing, which was fixed in > 17839856fd58 ("gup: document and work around "COW can break either > way" issue") > > That debug thing goes back almost 7 years, and I don't think it has > caught anything in those seven years, but I could be wrong. > > The commit that adds it does talk about a bug, but that code was > removed entirely eventually. And google shows no hits for > debug_dma_assert_idle() since - until your email. > > So my gut feel is that we should remove the check entirely, although > your patch does seem like a big improvement. > > Christoph? The whole thing predates my involvement with the code, but I defintively think the patch from Hugh is a major improvement. But I would also have no problem with just removing it entirely.