From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D70B329B8E1; Sat, 8 Nov 2025 02:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762568718; cv=none; b=DwcvMuodTdbybpLCYXb+tVkuTr1U8Own1lP7/cojwMq+L3ZvCst8B/WsQY+ksIwCDLXSMMCcZKtaPHNnKpyWFPxKfm/3v30DUg3bcwDeruubkpIF124ivrGovH+d5pF1DfxgCMWAMJPr1Pa5p2aP1NdcWJBjSSZm+FkT1fEUZ5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762568718; c=relaxed/simple; bh=IbQzBuHgPKJgX8xgAJOM4Osw65EhhRg43Vwus9DHxHU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jPJzlJIG2Nl7/M5X9LYCB4QmfJGUknty8p7Z2rd/fhp3Y14Gg2wEwu7qKKPaocg+7J2ipxRSHcIk0O58oROf6tgecuW9/SOTaRhecmTDdpilA6IhWyklDwObLwBIgzY0QgbaE4k2YCQ8vAgSTRGR6HDhod1NRw2RcEmgYTGVC3c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-c2dff70000001609-94-690eaa002d8e Date: Sat, 8 Nov 2025 11:24:58 +0900 From: Byungchul Park To: Jakub Kicinski Cc: linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel_team@skhynix.com, harry.yoo@oracle.com, ast@kernel.org, daniel@iogearbox.net, davem@davemloft.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com, mbloch@nvidia.com, andrew+netdev@lunn.ch, edumazet@google.com, pabeni@redhat.com, akpm@linux-foundation.org, david@redhat.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, horms@kernel.org, jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com, ilias.apalodimas@linaro.org, willy@infradead.org, brauner@kernel.org, kas@kernel.org, yuzhao@google.com, usamaarif642@gmail.com, baolin.wang@linux.alibaba.com, almasrymina@google.com, toke@redhat.com, asml.silence@gmail.com, bpf@vger.kernel.org, linux-rdma@vger.kernel.org, sfr@canb.auug.org.au, dw@davidwei.uk, ap420073@gmail.com, dtatulea@nvidia.com Subject: Re: [RFC mm v5 1/2] page_pool: check nmdesc->pp to see its usage as page pool for net_iov not page-backed Message-ID: <20251108022458.GA65163@system.software.com> References: <20251103075108.26437-1-byungchul@sk.com> <20251103075108.26437-2-byungchul@sk.com> <20251106173320.2f8e683a@kernel.org> <20251107015902.GA3021@system.software.com> <20251106180810.6b06f71a@kernel.org> <20251107044708.GA54407@system.software.com> <20251107174129.62a3f39c@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251107174129.62a3f39c@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUxTZxTH99zn9rmXjuptB9vjS2JS3ZYQxWk0OSbTYEzMo9HExMwPM8us cpUboGCBWlzMyiRzI4IvgCmlmyVGwIoB2403i1HAIqgZwUhuJy/KqsYpLwElQI3I1Rj99sv/ nPz+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:47:08 +0900 Byungchul Park wrote: > > The offset of page_type in struct page cannot be used in struct net_iov > > for the same purpose, since the offset in struct net_iov is for storing > > (struct net_iov_area *)owner. > > owner does not have to be at a fixed offset. Can we not move owner > to _pp_mapping_pad ? Or reorder it with type, enum net_iov_type > only has 2 values we can smoosh it with page_type easily. I'm still confused. I think you probably understand what this work is for. (I've explained several times with related links.) Or am I missing something from your questions? I've answered your question directly since you asked, but the point is that, struct net_iov will no longer overlay on struct page. Instead, struct netmem_desc will be responsible for keeping the pp fields while struct page will lay down the resonsibility, once the pp fields will be removed from struct page like: (the current form is:) struct page { memdesc_flags_t flags; union { ... struct { unsigned long pp_magic; struct page_pool *pp; unsigned long _pp_mapping_pad; unsigned long dma_addr; atomic_long_t pp_ref_count; }; ... }; unsigned int page_type; ... }; struct net_iov { union { struct netmem_desc desc; struct { unsigned long _flags; unsigned long pp_magic; struct page_pool *pp; unsigned long _pp_mapping_pad; unsigned long dma_addr; atomic_long_t pp_ref_count; }; }; struct net_iov_area *owner; enum net_iov_type type; }; (the final form should be, just around the corner:) struct page { memdesc_flags_t flags; union { ... /* pp fields are gone. */ ... }; unsigned int page_type; ... }; struct net_iov { struct netmem_desc desc; struct net_iov_area *owner; enum net_iov_type type; }; After that, struct page and struct net_iov(or struct netmem_desc) will not share any fields with each other, probably they will be connected e.i. through some ways between struct page and netmem_desc tho. Byungchul > > Yeah, you can tell 'why don't we add the field, page_type, to struct > > net_iov (or struct netmem_desc)' so as to be like: > > > > struct net_iov { > > union { > > struct netmem_desc desc; > > struct > > { > > unsigned long _flags; > > unsigned long pp_magic; > > struct page_pool *pp; > > unsigned long _pp_mapping_pad; > > unsigned long dma_addr; > > atomic_long_t pp_ref_count; > > + unsigned int page_type; // add this field newly > > }; > > }; > > struct net_iov_area *owner; // the same offet of page_type > > enum net_iov_type type; > > }; > > > > I think we can make it anyway but it makes less sense to add page_type > > to struct net_iov, only for PGTY_netpp. > > > > It'd be better to use netmem_desc->pp for that purpose, IMO.