Article View: linux.kernel.netdev
Article #15282Re: [PATCH 04/11] dma-contiguous: pass the NUMA node to dma_alloc_contiguous()
From: Robin Murphy
Date: Thu, 12 Nov 2026 16:21
Date: Thu, 12 Nov 2026 16:21
57 lines
10957 bytes
10957 bytes
On 2026-11-12 3:43 pm, Paolo Abeni wrote: > On 11/12/26 14:28, Robin Murphy wrote: >> 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. > I mean: the series also replaces the old hacks with the new APIs usage > in a few drivers, and in the above cases there could be actual regressions. > > But I guess we could handle them if and when they will surface. Ah, sorry, I was confused by the comment being made in the context of this patch - what you mean is that in patches 6-11, the new API isn't guaranteed to give the same result as the set_dev_node() hacks being removed? To be fair, the new API itself still does not change any behaviour, removing the hacks changes the behaviour ;) I guess it could be worth a note in those commit messages if we think there's a chance that anyone is using these NICs on POWER systems that might conceivably observe a performance blip. Cheers, Robin.
Technical Details
Message-ID:
<ca3d6077-651c-4882-af5b-15fa01242c35@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-362003-linux-kernel-netdev=dewy.ruReferences:
<20261106184433.761422-1-kuba@kernel.org> <20261106184433.761422-5-kuba@kernel.org> <c83426a5-d21c-4f0d-b13e-099b6f96df6f@redhat.com> <d00d3435-fcce-4c0f-8ed5-a672b5b85dfb@arm.com> <c014414f-fdd2-4a79-b133-44671c0e4475@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-362003-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 16:21:49 +0000 Organization: Usenet Network Message-ID: <ca3d6077-651c-4882-af5b-15fa01242c35@arm.com> References: <20261106184433.761422-1-kuba@kernel.org> <20261106184433.761422-5-kuba@kernel.org> <c83426a5-d21c-4f0d-b13e-099b6f96df6f@redhat.com> <d00d3435-fcce-4c0f-8ed5-a672b5b85dfb@arm.com> <c014414f-fdd2-4a79-b133-44671c0e4475@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="1125781"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:hIaZ/FoKvXk38xVQ54GU6yMHov8= sha256:4LrAAhXC6i/TrS/g+syI5rI5NR3Y1RBFZ/91w6Nnm7w= sha1:9ffP+mn9J4lzun8SEkOg0tiqJ5Q= sha256:ToGebXtAcV83hlAtSlcZhDCrHkf/xW620PbYcq7vR5o= 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 347741142EE; Thu, 12 Nov 2026 19:33:27 +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 DaVU0RoOIoaz; Thu, 12 Nov 2026 19:33:15 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-362003-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 389FE1142A1; Thu, 12 Nov 2026 19:33:00 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 14F28147867; Thu, 12 Nov 2026 16:22:07 +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=1794500515; b=28q1reWRhs5lHhOPEjlwK6Vsq9XxHD0am2zpwZFNwDbNILTFRbVDJGBcQkCUu3USpVTE ZyXi3eMZWImT8R2Td2Ag95R+ZPT7os2Wk5MhSI4mFdqIIQ6nEDmlPDbUVxvjv2UZcNZGO ufBHix2sp05TGjEpA9KYW+6qLnlIg96OhRwJrUElRheNHmG9Gj0g+aSsZD02bJUEpZLWm rGJM2CffB1kn/esNr8Fpb1snIRbNhaLMtfhI40PbiUVsTRRSLvRVJ10U3XpGrKPJ0lNIV uHm9cAr43fxyVnoj96TxQ6B5w4bEu91Z5IIGOObU9v/x7v5Sl3ke/mO1z7A/cifIqAw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794500515; 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=MThHrrAgO+4uPmzlybRs1Z4U0Fzgwcz7pOBq89o/DUE=; b=dvB6xpVkzJEEkFm3gA8kt4kx3gmq7KHfUW5Yws9CGo+MkIum7shj1AhHhllXumQ2BnpC BNrD+VvPh/sPg1RZ//q9z8Z0ast+EfXQtP0vRUXHlIncmrtahLN+i9Cy1rQMJd//VVEz0 h6ep+dI4fFdnSYD59d4Eby/3BhW88ooARUR51RPk26WrJ7mjVZ4r0oNTtFz/EbQW4ZE6P t52PbbsMYOno4+ReQC4CvUh++GIozm8Ehg4PiJDRM258ySk2eHpOoEpVeN+TmVToyB9Ac R5dyVU4dlDGMX1BJIS3xXwSTPKrRJajX5e1v46GbfDMg9z0aHVz06J6K8rlmP4BnLoQ== 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=MomroVmx; 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 788F7606A880; Thu, 12 Nov 2026 16:21:55 +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=MomroVmx 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=1794500514; b=U9fUowXH2WPzgS711ewTalOsdRn3yuQWW01Xif1/2wRiEKDg+ZthR+LfT29eWAnBWAwI n6eWuuq3rl7+tAcVrZ4aJqGGkZQjpJkXcvPKForUvNdsKe+wgVcMyAQPDtvpShxEHHtdm B9n9Z0J68Ob5aJ95G5UIFx+exscqyOkJryeZeFe3K+uIutqR9ZkbeA/OFYHx2jtUtqIMe DFTUWxbLlyOQ3V02VY7jj64vhIDOx61+EaHFOY7cAvsTBxWQwmy7GCZe+jYpZvYAc9Ypv L/p32NHS0ybtKKWVrcpcZHDMa1id0s2HY3Zei8Rj7KeviscJ3rtZZaG/AcxlgbOArOA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794500514; 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=MThHrrAgO+4uPmzlybRs1Z4U0Fzgwcz7pOBq89o/DUE=; b=hlfWXLzbGGb1lYoFrkUuJN64BEOPg0JpXRn+PTDm9WOMM+9tHQhM7mhmls613PbB3r5O gwk2nqv6aIdZnN+G/zY/esKXL2yXF9ChY8oO+e0+ABY+RnYly1XPrRZIuL8g3GLgpOSIk 6tEJy0hvS/zyK2RvFiBrjfxUmaaVs/Q7iD9yCbetYH/m5NFPB0yFZ1sBh4audlHWYelR+ Bl24lZMtqIAB4MiRIPp892UUZV6JxgZPQrDhPPzCl7wrEe9/ATVCNZVkvzoXfk4g9OUcP fO0hPkAytNwcj8ik8rKTSjvN515TtpBkPKZcTzoSqjQL/Qdh8MHz3HwYu89aZ//ADmg== 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=MomroVmx; 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 3458B606A323 for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 16:21:54 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3458B606A323 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 4C4FE339; Thu, 12 Nov 2026 08:21:50 -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 18A6B3F959; Thu, 12 Nov 2026 08:21:51 -0800 (PST) X-DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1794500513; bh=jedXPPvr7jZuVhdrhq32oHINCmvOzuYPpr5X/Ba4uXE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MomroVmxYPw12QBT+rgCGPZ3lttH/nPhsgCEMyYJ/gtn+dAH250P+mP+4Cm5pZJb9 uaEF2O/7Lqogifa/0OkPooXeRmSM173RFZNowVYGh5RtZtb1c1DR60ozD0RVqVLWfJ dbsJsDkgTGmp7taZz7dZsWT8WvTniKgxPANxrjhQ= 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: <c014414f-fdd2-4a79-b133-44671c0e4475@redhat.com>