Article View: linux.kernel.netdev
Article #7999Re: [RFC 07/11] eth: ixgbe: use dma_alloc_coherent_node()
From: Jakub Kicinski
Date: Tue, 27 Oct 2026 18:20
Date: Tue, 27 Oct 2026 18:20
52 lines
9829 bytes
9829 bytes
On Tue, 27 Oct 2026 17:06:44 +0100 Björn Töpel wrote: > Jakub Kicinski <kuba@kernel.org> writes: > > On Tue, 27 Oct 2026 10:06:03 +0100 Björn Töpel wrote: > >> Not really this series, but the fallback here is odd, no? I thought the > >> allocator already did cross-zone fallback? > > > > Fair, I was too lazy to check. I'll remove the fallbacks in the same > > patch. Seems obvious enough. LMK if you prefer separate. > > Hmm. Seems like dma_alloc_contiguous() doesn't spill over to other > nodes. It only tries the per-NUMA CMA... so keeping it is bit more > robust. (Then again, I dunno...) > > I'd say keep it. Or we fold the retry into the helper? I tried to write the kdoc: /** * dma_alloc_attrs_node - allocate coherent memory on a given NUMA node * @dev: device to allocate the memory for * @size: size of the allocation * @dma_handle: returns the DMA address of the allocation * @flag: GFP flags for the allocation * @attrs: DMA_ATTR_* flags for the allocation * @node: NUMA node to allocate the memory on, NUMA_NO_NODE for no preference * * 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 coherent pools or CMA areas, restricted * or atomic pools, or by dma_map_ops implementations do not take @node into * account. * * Return: the CPU address of the allocation, or NULL on failure. */ This feels like too much explaining of the internals for a commonly used APIs. If we retry in the helper all we have to say is basically "acts like kmalloc_node()". WDYT?
Technical Details
Message-ID:
<20261027112003.330bbded@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352579-linux-kernel-netdev=dewy.ruReferences:
<20261027022528.633359-1-kuba@kernel.org> <20261027022528.633359-8-kuba@kernel.org> <87ecdb5x8k.fsf@all.your.base.are.belong.to.us> <20261027085133.2832f2f5@kernel.org> <87wlr33z6z.fsf@all.your.base.are.belong.to.us>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352579-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [RFC 07/11] eth: ixgbe: use dma_alloc_coherent_node() Date: Tue, 27 Oct 2026 11:20:03 -0700 Organization: Usenet Network Message-ID: <20261027112003.330bbded@kernel.org> References: <20261027022528.633359-1-kuba@kernel.org> <20261027022528.633359-8-kuba@kernel.org> <87ecdb5x8k.fsf@all.your.base.are.belong.to.us> <20261027085133.2832f2f5@kernel.org> <87wlr33z6z.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="1603599"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ZiV1HZ7sHTWlXLDpVfHKxkKy3+Q= sha256:CR2mZmBh2YAZY8ELnyj1s93j8WheEAhZEv4iDxU7ihk= sha1:FyH0CUiGGdH8E8Z9uGWgmsa3AGg= sha256:ZtbK3N7NQJwP9fBPB3rM8GcJo/93MVY6IF80erDzDkc= 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 AF50E125C0E; Tue, 27 Oct 2026 21:20:22 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=pass (2048-bit key) header.d=kernel.org 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 yjWTbj0fP1Mo; Tue, 27 Oct 2026 21:20:19 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-352579-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id C0B9D125C0D; Tue, 27 Oct 2026 21:20:09 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id CAF96603BDE; Tue, 27 Oct 2026 18:20: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=1793125206; b=ziYi0d2Cr6H8X7AmE62e7i+CU9kEpQZDjLMUnzeYDOmRKB70ieHGFCflzoMvj4j9klS3 tpP/3u1QCc+VBtwsiD3oX3cPT7u2RByQioBMluKvtz7CSznAp+fmTtzaHk3x1Kr/mGHyw A0z6wAIUrKSdOMC/6w5YSEOOve5lnc3LBPVXI8C+h8Ouos5Icm4zHCUJzRtMZHTBgmiTi IKtFFXecoE682PFC8Rf/UZPtJOpk90VLfdnwm/HXKej+VWu+7qLc38pPaZ8lzyfr/ybOn lBfNNFLCgWUqEvjNaSfPGDuoYoXyAoMs6jT70ChP051EsnGEybnGMD/SeTT+luMYoVA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793125206; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=gAl89fyJdbv1sAJU0zLFzuIBO7vcKyX3qqqs2bLWiPM=; b=WO9YMvciEi1c2KDsNaF4ljd3yDGTLShdBdJ/FlrinLeezauiLwehiuGaCDhensjb3FKZ 5qppdfexCoer2Qnp9CP32hVZaCP6grMMGXrbdRNrqOn7cvRG7RfulOp8mEmgT5KTBpFv1 gu/zGwpy/KdujLFFVQdvvxLNn2jOlnTPDjMEXlSW5PtpwH7VZmvr6/RHWRnWrxaf9XAFC 7GxuM5mj3hW8j4Y4GmzQaVMAu8rVwicMlWvAMt7UTfeOlR8aj+Eng8rU1oPdhwc0neWvR MhWONPfN28UP4iz4WatGkLMWp9UWMgd4jJKapGjb2VNYmbAMC/KzEf3CS/GYDGgAh7A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gjPcTOJd; 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 F3EB2606A324; Tue, 27 Oct 2026 18:20:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gjPcTOJd X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793125205; b=wCklMLZwNTsajZzFfLi9FV54CmsgRAtN1E1PE4ZkOXzXMnsid9xGWuvK2SCawbohSft8 HM8UtkTGlooFFQ5Gy30n6QNNxG0RzwzaIoK+YHveUtOKlvwigKN44ulqS0pvKZ4o0nQVs 3e6iwkD4WW/N57W+fG8YvwyXXhqLuaF3w4xveHXyEJ5yyAtFvc5vi/12mbkhgyEdtnlyh f1KuCEsaMx626+PWYW3HVlHrAH2QTxiOONYC3yXA4cocn63e84cBEkg8ZvKUSz37VCgUw KhrtOJqU2nvvCDoacZPMt6LDEIAeWdk8Cs8MUxrs9TiJ3V68RBn2T4FCNrE3jJfxSRg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793125205; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=gAl89fyJdbv1sAJU0zLFzuIBO7vcKyX3qqqs2bLWiPM=; b=E8rnzcH3aYBJ7/awY38yquffP8avvxIpBfLR5q7BG7oXtzrYgJxAzS29VleQAHmnTCrA OhikKkWurl9bp61qBcerBMcK9WJDXI/nxILbCtsO56Mjfmcr9y02c2ov6hz3oNwuHm9UM SLCBlLhUY9v1toZ2/syqluiaTiCXuggFp0X95RHFNbNKhHpDiUsitPPOlLcM4iItyxAkt C+K1VpzqoA5L7IL5YRgu7DRLQOGRLYKC7aKD4OUuhuLrlH+ToWhKiUUlr9GX+1e86nNFm en1qvF/N3sh4o1wlxcMRiwwaUTXGcgdLl/uLYZLJrHzbJvAJEYx4mRwxIDy0UJ4Zsmw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gjPcTOJd; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0EAB606A31A; Tue, 27 Oct 2026 18:20:04 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 046441F01828; Tue, 27 Oct 2026 18:20:03 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793125204; bh=gAl89fyJdbv1sAJU0zLFzuIBO7vcKyX3qqqs2bLWiPM=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=gjPcTOJdnz/kwIbD7O08J5pbG/jBpJ1E5nKawunXt/p8zb/KyS1c44NWDYKrWstgW 15MZ5ceFNZJL+S0yGkmhIw9v2IvWfmj9OzUMX/nBWBuaEBNGI+RqeQPmspGZvaWRL0 vlTzc52BL5WtDqwnLBro55rrNFU16U9auxIUUYZplS1G+6H94hy+nRYxvaS3xSdnYH bBRD1xHiZWb9IQO045KnZY68e3YYQ0Y7Uuwep0sBfXya8SQUkVhwgdt/an1fTX4JTs UkxIJDr55VMRMcMOBVVEdPRc74LZK4xcAsuX0WtoPXVnqCZ8oJ42Nz9WksF7ZaADV9 PSAgm0nITmhIQ== X-Cc: robin.murphy@arm.com, m.szyprowski@samsung.com, tglx@kernel.org, dave.hansen@linux.intel.com, x86@kernel.org, joro@8bytes.org, will@kernel.org, leon@kernel.org, mbloch@nvidia.com, iommu@lists.linux.dev, netdev@vger.kernel.org X-In-Reply-To: <87wlr33z6z.fsf@all.your.base.are.belong.to.us> 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