From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11C3CC3DA4D for ; Thu, 17 Aug 2023 16:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353254AbjHQQQa (ORCPT ); Thu, 17 Aug 2023 12:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353586AbjHQQP5 (ORCPT ); Thu, 17 Aug 2023 12:15:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D39094 for ; Thu, 17 Aug 2023 09:15:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E344E63330 for ; Thu, 17 Aug 2023 16:15:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7AB8C433C7; Thu, 17 Aug 2023 16:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692288955; bh=wpB7s0BF7i2OV8MyqoB+YeaFdQRuC0uvNlxwgDY03ok=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U1gL9SuP01FjuS909LIqqQAHr+SG562qyJb2E46PZ5cCj9a0DY2Teag4z21HaWVPT qLwyaE9YLhHJ8QQrY7sAvPrJ64TipjUKUxaey6T0DFeIeL0ext/sdJFTkBqaDLcWtb 0XKnSYuJ2vjRMmgWtQGV18dfPW+cEjNrxToDctFgBNh/GxqONtp/PLHS3HP2nxV9fQ fMPG5rlBWtPhioOQAocRZaaNLDFohYfDnVYB/DRfv6pNEuXfG+EMWlEJwE4x9eHdUi bkZrPAaUao0TP+QOeKbngU/wF/gZ4uwinHYAAq9Dg9eHqLKLfOoqSN3xRNQvrnsbiT 6LZbE0/PdvW+Q== Date: Thu, 17 Aug 2023 09:15:54 -0700 From: Jakub Kicinski To: Ilias Apalodimas , Mina Almasry Cc: Yunsheng Lin , davem@davemloft.net, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Bianconi , Alexander Duyck , Liang Chen , Alexander Lobakin , Saeed Mahameed , Leon Romanovsky , Eric Dumazet , Jesper Dangaard Brouer Subject: Re: [PATCH net-next v7 1/6] page_pool: frag API support for 32-bit arch with 64-bit DMA Message-ID: <20230817091554.31bb3600@kernel.org> In-Reply-To: References: <20230816100113.41034-1-linyunsheng@huawei.com> <20230816100113.41034-2-linyunsheng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Aug 2023 16:57:16 +0300 Ilias Apalodimas wrote: > Why should we care about this? Even an architecture that's 32-bit and > has a 64bit DMA should be allowed to split the pages internally if it > decides to do so. The trick that drivers usually do is elevate the > page refcnt and deal with that internally. Can we assume the DMA mapping of page pool is page aligned? We should be, right? That means we're storing 12 bits of 0 at the lower end. So even with 32b of space we can easily store addresses for 32b+12b => 16TB of memory. "Ought to be enough" to paraphrase Bill G, and the problem is only in our heads? Before we go that way - Mina, are the dma-buf "chunks" you're working with going to be fragment-able? Or rather can driver and/or core take multiple references on a single buffer?