Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp973454pxb; Sun, 11 Apr 2021 03:31:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1+rrrDyz06189rFRixfFMani7DsckqEduapLZVRx+54meUzs6eqYRrJYl8Fvg7gEDLaBn X-Received: by 2002:a17:90b:1281:: with SMTP id fw1mr23296246pjb.217.1618137073556; Sun, 11 Apr 2021 03:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618137073; cv=none; d=google.com; s=arc-20160816; b=xVrJYRgdCqz48uYR45SrakYRHRC+zWyH/Uaq3VhVEHFTt5xZgu0/LX45mw/FuPsjlB IZBTsaJahOfhFoOw3tN+iQ/GqtrgGnHG+b3g4OTIH4UMRuxCrlmm/UcQ9BfaBmEhyC8l HC0k00rrXjQiKSa2RWK6JoJ/mJT0BpjEdibFgtKMwaav3A6vcf4X0Lto4GwEK8zz2TiA F5+/hW+AEyCdGfi5ym0EnPnHykrmbXLMEo9Iq1u9PDknrcbKmsuS91WHZKxQHr3dXzwA ED+XOmPXw3aoKmU+vHk0lL4DajGN7oIv0uD/TTwbgVfVvgtX2z4INDeJfYdjyekp/n3B iHnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=MhHr3Cd5ZDKM5bg6lUgtgpxP7s+VM/Oo10g+H6b6Os0=; b=ZYPwDDLKzb4RRFwNMwqtleMs3eiQCeHp+pu3+JS5XlS+bH/7jlnAGmXLIEn1PQ51GR m0c7u1q80JyEMbsPwRt03g+5+Na1evzVNkK5RuqBx2TlFMEA/oOBw+hJazEP/AiPS5pc ObdkshCgjOg2e+zrfYsARLxUkGhbgTsufiYvEZ9TbVuCdUyc8TlP3g6IxWvRfJ50EsFz CqTS1rToeQw6og8e+xeshoQUFEpKEJBsg+xzwbH8L87UHfirPjxe9NbFykdRxmhiJBpw WIVJ1lljBlPeYs6nTRtyj2nE69GXUFpB18B5b9ZcjUrvO/nVHuztS/ZZbDQ2ahidiumy ncZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a+3sPGmt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j35si9486424pgm.487.2021.04.11.03.30.59; Sun, 11 Apr 2021 03:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a+3sPGmt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235353AbhDKKGH (ORCPT + 99 others); Sun, 11 Apr 2021 06:06:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43674 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235366AbhDKKGH (ORCPT ); Sun, 11 Apr 2021 06:06:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618135551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MhHr3Cd5ZDKM5bg6lUgtgpxP7s+VM/Oo10g+H6b6Os0=; b=a+3sPGmtIOxLyeOPh9KSnp53+MynC9DSKW8Ri/0ZDifr5XfR3lLeN5mzXTBJOFKZ8ywQeu qtbApmq4+z+phofJrIRoQYDDoHnTMj2AUHpIRkpnacEg8E2YxAP+8TojFPcIHl3JOyACa6 WrcVb0tDl0jKOmQT8uPTLfvM+Iwyyhc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-6klkBEv5OCOBZMidoXHS7A-1; Sun, 11 Apr 2021 06:05:48 -0400 X-MC-Unique: 6klkBEv5OCOBZMidoXHS7A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 415DD10053EC; Sun, 11 Apr 2021 10:05:41 +0000 (UTC) Received: from carbon (unknown [10.36.110.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 957FD14106; Sun, 11 Apr 2021 10:05:18 +0000 (UTC) Date: Sun, 11 Apr 2021 12:05:17 +0200 From: Jesper Dangaard Brouer To: Matthew Wilcox Cc: brouer@redhat.com, Ilias Apalodimas , Shakeel Butt , Matteo Croce , netdev , Linux MM , Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , "David S. Miller" , Jakub Kicinski , Thomas Petazzoni , Marcin Wojtas , Russell King , Mirko Lindner , Stephen Hemminger , Tariq Toukan , Jesper Dangaard Brouer , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Boris Pismenny , Arnd Bergmann , Andrew Morton , "Peter Zijlstra (Intel)" , Vlastimil Babka , Yu Zhao , Will Deacon , Michel Lespinasse , Fenghua Yu , Roman Gushchin , Hugh Dickins , Peter Xu , Jason Gunthorpe , Guoqing Jiang , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Aleksandr Nogikh , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Yunsheng Lin , Guillaume Nault , LKML , linux-rdma@vger.kernel.org, bpf , Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni Subject: Re: [PATCH net-next v3 2/5] mm: add a signature in struct page Message-ID: <20210411120500.73c1cadb@carbon> In-Reply-To: <20210410193955.GA2531743@casper.infradead.org> References: <20210409223801.104657-1-mcroce@linux.microsoft.com> <20210409223801.104657-3-mcroce@linux.microsoft.com> <20210410154824.GZ2531743@casper.infradead.org> <20210410193955.GA2531743@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 10 Apr 2021 20:39:55 +0100 Matthew Wilcox wrote: > On Sat, Apr 10, 2021 at 09:27:31PM +0300, Ilias Apalodimas wrote: > > > Can this page_pool be used for TCP RX zerocopy? If yes then PageType > > > can not be used. > > > > Yes it can, since it's going to be used as your default allocator for > > payloads, which might end up on an SKB. > > So we have to keep the extra added field on struct page for our mark. > > Matthew had an intersting idea. He suggested keeping it, but changing the > > magic number, so it can't be a kernel address, but I'll let him follow > > up on the details. > > Sure! So, given the misalignment problem I discovered yesterday [1], > we probably want a page_pool page to look like: > > unsigned long flags; > unsigned long pp_magic; > unsigned long xmi; > unsigned long _pp_mapping_pad; > dma_addr_t dma_addr; /* might be one or two words */ > > The only real restriction here is that pp_magic should not be a valid > pointer, and it must have the bottom bit clear. I'd recommend something > like: > > #define PP_MAGIC (0x20 + POISON_POINTER_DELTA) > > This leaves page->mapping as NULL, so you don't have to worry about > clearing it before free. > > [1] https://lore.kernel.org/linux-mm/20210410024313.GX2531743@casper.infradead.org/ I didn't see this, before asking[2] for explaining your intent. I still worry about page->index, see [2]. [2] https://lore.kernel.org/netdev/20210411114307.5087f958@carbon/ -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer