Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4759187imu; Tue, 8 Jan 2019 05:57:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN7OVN1rdNgdaEySeAnThAJ3gEfp4DE9kePbh8EHBxPditApkQypH3BrHvNUgOX4zkGTkhgZ X-Received: by 2002:a17:902:3181:: with SMTP id x1mr1879933plb.58.1546955863955; Tue, 08 Jan 2019 05:57:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546955863; cv=none; d=google.com; s=arc-20160816; b=HGB66jqAKq3PfuGX1/xs0ZTfeD+KeNG/xXtWhydKahAWnefuWJuxmm22CDKqJcOhzX xBWM2LYc2JrUOH+9gMh2Yi6jOy0WUpgINneVaE/1tg+vj5/lp+bjw+LSRpM9GrAeb0cF taWSo075OecqlpS5V3/GN6uGUJMDwHJ1XCTwFCoKVxSJxbAofib7/aoNuYzLYZwshlsX kLPFpcZeC68pJOLaGgJRkvRkkGBbjSfvzaDcTwSUuCJbRxIf1lIAYbZBKS5QwzXu7i8w FstKGwGN63q9nWwPa1fZbJ5MLo5elM4eVfEe8geqNL2uLWu5BvyEafqD+5GQ9MJNMEaQ VFQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=FkyRymF6ncDOmQ3PFSoGOg/ZEchWkujiYesMvJIQtlE=; b=mAivin/OWILrWU+qeEdT9mzohIX1YYwM2H7k+LvzrFKD1PMvQPhva26wlL1+QR9uyQ rP20LqIY/38Dbc5C8KYpweKPb5jvg8qMsCRhMSIDwHKXznyIuPzC6YiSwtDhUIK+HShg EDIBgVIzxQFhOf/D6fHY0bbr+V9pRNzWREZMVLeAZ3s21TMAbTOBYjK0QoZDQiYgDJkL VKdaBTlG4W34mmowufOhdeXOnQQBkq1WhRAKSBSj+0qMNc58v2G/iZCvjNigX/kw7/IS YDHiquvx2lJNKZpuWLx5OmmwHlRV0HkiYgbqu5VDg3Xi4TNJG0LOtyXtmhBM31x979+w xuwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si18189379plo.184.2019.01.08.05.57.27; Tue, 08 Jan 2019 05:57:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728385AbfAHN4K (ORCPT + 99 others); Tue, 8 Jan 2019 08:56:10 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:61107 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727662AbfAHN4K (ORCPT ); Tue, 8 Jan 2019 08:56:10 -0500 X-IronPort-AV: E=Sophos;i="5.56,454,1539640800"; d="scan'208";a="291152796" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2019 14:55:44 +0100 Date: Tue, 8 Jan 2019 14:55:42 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Christoph Hellwig cc: Linus Torvalds , Luis Chamberlain , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: remove dma_zalloc_coherent In-Reply-To: <20190108130701.14161-1-hch@lst.de> Message-ID: References: <20190108130701.14161-1-hch@lst.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Jan 2019, Christoph Hellwig wrote: > Hi Linus and world, > > We've always had a weird situation around dma_zalloc_coherent. To > safely support mapping the allocations to userspace major architectures > like x86 and arm have always zeroed allocations from dma_alloc_coherent, > but a couple other architectures were missing that zeroing either always > or in corner cases. Then later we grew anothe dma_zalloc_coherent > interface to explicitly request zeroing, but that just added __GFP_ZERO > to the allocation flags, which for some allocators that didn't end > up using the page allocator ended up being a no-op and still not > zeroing the allocations. > > So for this merge window I fixed up all remaining architectures to zero > the memory in dma_alloc_coherent, and made dma_zalloc_coherent a no-op > wrapper around dma_alloc_coherent, which fixes all of the above issues. > > dma_zalloc_coherent is now pointless and can go away, and Luis helped > me writing a cocchinelle script and patch series to kill it, which I > think we should apply now just after -rc1 to finally settle these > issue. > > The script that generated the first patch is included here: > > @ replace_dma_zalloc_coherent @ > expression dev, size, data, handle, flags; > @@ > > -dma_zalloc_coherent(dev, size, handle, flags) > +dma_alloc_coherent(dev, size, handle, flags) Great. We should also update api/alloc/zalloc-simple.cocci. The message could just say that the z version is no longer needed. julia