Article View: linux.kernel.netdev
Article #15186Re: [PATCH 04/11] dma-contiguous: pass the NUMA node to dma_alloc_contiguous()
From: Robin Murphy
Date: Thu, 12 Nov 2026 13:28
Date: Thu, 12 Nov 2026 13:28
47 lines
10287 bytes
10287 bytes
On 2026-11-12 9:53 am, Paolo Abeni wrote: > On 11/6/26 19:44, Jakub Kicinski wrote: >> --- a/kernel/dma/mapping.c >> +++ b/kernel/dma/mapping.c >> @@ -642,6 +642,13 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask); >> * Same as dma_alloc_attrs() but places the memory on @node rather >> than on the >> * node of @dev. Like with kmalloc_node() the node is only a >> preference, >> * the page allocator may fall back to other nodes if @node is out >> of memory. >> + * The contiguous memory allocator (CMA) does not: only the CMA area >> of @node >> + * and the global CMA area are tried. The allocation may fail even >> though the >> + * CMA area of another node, e.g. that of @dev, still has free space. >> + * >> + * Allocations served from per-device or global coherent pools, per- >> device CMA >> + * areas, restricted or atomic pools, arch_dma_alloc() or dma_map_ops >> + * implementations do not take @node into account. > I'm possibly over-thinking here, but AFAICS there are a bunch of > dma_map_ops that > are using dev_to_node(): > > dma_iommu_alloc_coherent() in arch/powerpc/kernel/dma-iommu.c > vio_dma_iommu_alloc_coherent() in arch/powerpc/platforms/pseries/vio.c > gart_alloc_coherent() in arch/x86/kernel/amd_gart_64.c > > With this series they will stop using the driver provided numa node. > Probably not a blocker but possibly worth to call out? Nothing "stops" - this series adds a *new* interface by which drivers can now indicate a specific preferred node, but DMA API backends are still free to ignore the caller-provided hint and continue doing whatever they want. This is already called out all over the series in commit messages, documentation and comments including the one above. If anyone does want to do the additional work to wire this up through dma_map_ops for powerpc's benefit (I doubt the rest of the legacy/embedded architectures will ever care), they will be welcome to do so. But as-is, all that happens is that the driver changes here have no effect on those systems and will keep working just as they did before. Thanks, Robin.
Technical Details
Message-ID:
<d00d3435-fcce-4c0f-8ed5-a672b5b85dfb@arm.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361861-linux-kernel-netdev=dewy.ruReferences:
<20261106184433.761422-1-kuba@kernel.org> <20261106184433.761422-5-kuba@kernel.org> <c83426a5-d21c-4f0d-b13e-099b6f96df6f@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361861-linux-kernel-netdev=dewy.ru From: robin.murphy@arm.com (Robin Murphy) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH 04/11] dma-contiguous: pass the NUMA node to dma_alloc_contiguous() Date: Thu, 12 Nov 2026 13:28:53 +0000 Organization: Usenet Network Message-ID: <d00d3435-fcce-4c0f-8ed5-a672b5b85dfb@arm.com> References: <20261106184433.761422-1-kuba@kernel.org> <20261106184433.761422-5-kuba@kernel.org> <c83426a5-d21c-4f0d-b13e-099b6f96df6f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1100072"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:nMbIZ5ZMf9nMAlaVRowz+2+/XPo= sha256:RVeDQFycT2tfk78jWbc81Wny2ha08OGfcecwV55jaUM= sha1:zUEqKRggvxCBZY5EVlMQZbA17KY= sha256:SPOVstrCWktTCNX0jiRRoEbWpWN5ZP+qS1rV4A4H4FM= Content-Language: en-GB List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id A7360114275; Thu, 12 Nov 2026 16:54:50 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.751 X-Spam-Status: No, score=-2.751 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=neutral reason="invalid (public key: DNS error: query timed out)" header.d=arm.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aIAW3NZovJlV; Thu, 12 Nov 2026 16:54:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-361861-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=arm.com X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 73F55114272; Thu, 12 Nov 2026 16:54:23 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id C93ABC2E4F; Thu, 12 Nov 2026 13:29:11 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794490144; b=1G/xrQa/yx9uQY+Co/FFplhPCBst8bGeb4TfoE/MWh5KXEdJwiI6//eu552a0/kgnkrj GxvJV6WLFwsxmPa6eUzhRtzecp/5lMalvRFbENJW+Fc6KJGifR32Ugbqb+NODlK/v2NDD FISIhxl/guj0ndmk6VufZpA0ShzNQM7ZBAJlAr7vkkVNFNBd/f5PykgFbcbQGISijqufN EPPbzj4HsmZVMoDKxY5t+ukzzro1HPosjj7GenjYCfvxWfnrG940YfI59X9doeYORhfYX aFrQMoL5KVlvqkL5jX4UQC+dQrnUhf1gSymcTf0Rao6wDoyqvg1y0jhb45FXXLF0MVw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794490144; h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature: Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: User-Agent:Subject:To:Cc:References:From:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=gy/PKz1d5ixzrcpFIizQmpzhOaryY3xxJM1z73yskEg=; b=Z5DK1j5UMZbbBMeQYx0rTefHsNPjQ6Rv7vKIXjzJEGE6Br1SOeTS8gqPXyUK7Orej7SK QaW8uE4aUv121AqNmtIqsKLvdY5u5uv96XNT36wYwXhjeNGeNiRyS1NJVdbqQ0clf5viW twlwDO5HsUZumgojNUD32ejAnys2TIaIW3ALNYxCkD+9Ye5WoNg+r5bDU2Tf68nbv03rl hGSWEmUjq9y0EkLi3KChd/B15CCG0n60lpslkfSNo0ZVdaL34xV0EVO/9HCJz44YEjQc0 UOMXsFg80fOblm5cOl7kg3fY/I+lH4bbNctc03UOThBDGuF9fCCMm0e7vSFzUDCOStg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=KJFlzHPo; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8271606A88E; Thu, 12 Nov 2026 13:29:04 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=KJFlzHPo X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794490143; b=ZWQDoeYvKoei/KIyhPIi2nyR461Fu8HmXsQwKckkcGt6KPczsY1QWVbIqW5iaLVOOqu5 lXq2+0+fs/CkrjYJkUTMrNcn+28CQQ1TdZJ5Xrhgw4fehEjdYPD2K/3LwLv8omE9fuyiq ayoWDP0h5S7j0jG09psT8h7OZdLkrSt2p7iIhnlYV20FgfKWYu954gT1RMPhm4cHsPbA1 S1/K/UGnU/1AVP1XA2aNJzzwVfqwUOdUIL+6p2iWIdPMnk70CXZ4maGJjCfGZOlHtCmaJ fjFXAMYFobWsZIFdS04Tboxl646iqcbGR0yZNLE8gn2Nh+kEr86a1FHvl/P+X0BDIiQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794490143; h=DMARC-Filter:Received:Received:DKIM-Signature:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:From: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=gy/PKz1d5ixzrcpFIizQmpzhOaryY3xxJM1z73yskEg=; b=yNah+MP/2SwWg7Dkv2lDlhI+VhnSdJYVw6biIOk/fFgiFtMBNcasqOLKNNaEKY/6qmX8 ObAoGiN0En0koP9YUfeI94b5WFvsElpLh5fP1ssbnSQmLf9Nm9lvchvIQT8ev9bbdpFUV hWcyIyY5+1QHv+sPIEB+sQsgXuRenUDeoBSdOmG9kWV70AG7nFZZGQregCMQqLFKkcEJ+ kJWkmR5hoMa2cS81k4i3Qtcol8/lRnODsc0R8SzLt+TaxqACc/6ESocnAV3fBA4+GkR9M 2wbcqiSzGZde/OGa/MYVqD158YHSrdGqzEE8aP1GnlQ4Kcwk7ZEhsaPxcUt7c0qOJHQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=KJFlzHPo; arc=none smtp.remote-ip=217.140.110.172 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70760606A886 for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 13:29:03 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 70760606A886 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com X-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 C8BB11477; Thu, 12 Nov 2026 05:28:59 -0800 (PST) X-Received: from [10.57.89.53] (unknown [10.57.89.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7FCBE3F632; Thu, 12 Nov 2026 05:29:01 -0800 (PST) X-DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1794490142; bh=PsO/9ilVImQiMNmG3gCp6rdWfB3zLayHl7GRSKsuGos=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KJFlzHPovRGZbmWSNCjPwJ/WawxTcWt8qQg/Q8Qf/oMZRh4qcXiPJQyg/sZQJILZJ HRNuW2kEyrQre5oCEckwkwHKYusPG6WPWdb+TUQqBPBtkLE2g9751Sysb8QC7Y6OzY dnPxZe5aetEC5e+0qUgYA052moUGkYYf5MZr7X5s= X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird X-Cc: netdev@vger.kernel.org, iommu@lists.linux.dev, joro@8bytes.org, will@kernel.org, Björn Töpel <bjorn@kernel.org> X-In-Reply-To: <c83426a5-d21c-4f0d-b13e-099b6f96df6f@redhat.com>