Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3568486pxj; Tue, 11 May 2021 07:21:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF1nkMkZ2QHfsgGMnWzhyU20YJJN6tgO1QciBPzA0DpRc3ouyxOGvdvI0sE5+X0EJG10Yz X-Received: by 2002:a5d:5989:: with SMTP id n9mr37951684wri.60.1620742872140; Tue, 11 May 2021 07:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620742872; cv=none; d=google.com; s=arc-20160816; b=WaB8euTQC3PTFHv2amUs81QoDW41SUncDGvapo12FMoThZmMnN8tcwQ6Ypy61DG/WW Vp+SMzIab759sMKF2jOJ/534aUDg7vmOI2gbWOwGSJgi97/gS4t/BlKOK2lQg1FQCVoP J5YF3WXFnQyUmLfBiYD0az5pA0AH+aPRx9fJ2ue5KbXe+voXBTK0lV9yopbCKV40N4yu 7mIhmMdTmja/cwbq3aiCWA2az3rNB9IKOfRT/npH71UlG2mO29NPrIGz0aMzqUuevQ6Y 1q7w8AnjbfcStcrAmwrVYGmlSRg5LdXN8nGbQoUQVq543FLVdLNCZd50nosy+RSfpU7T 9/IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vXY92xiVcSCoihG0TT6zFgFAzGF0aHK+j0EPAjfDpt4=; b=XWkBkGvCHmwT8edVNUiExO2hJCsBlExn1rfB6u7U3AsnWhK9qQdZD7Q5wqsdgz+h6a 9Jnf3O2RaCQ/dih0bTz9FbuSIlcn8ai+59yg53F2fhC3UExY+6LVgOg9U36m84F9Ku3n LVy7GH/zf44hYS4xxtz198ezgKXzMKeFFeflwTgUVvOZ1I2qjuQlmgLqnKBMU7P670Rf vDybOex/amd8tD0H/oZbTNHBXC19nY2tNnzXeLHZbqE+IUycmqSCnFTiohZ2UgjgONsx 7FNXI82tH3vSf8ZvOlOReNR5FbwubiqOgUq2+mFUtqWJnqk3QvIlZV8gVdYlyPr18qYe N0Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=GMAgJT78; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si84757edb.415.2021.05.11.07.20.48; Tue, 11 May 2021 07:21:12 -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=@infradead.org header.s=casper.20170209 header.b=GMAgJT78; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231703AbhEKOUk (ORCPT + 99 others); Tue, 11 May 2021 10:20:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbhEKOUi (ORCPT ); Tue, 11 May 2021 10:20:38 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB87C061574; Tue, 11 May 2021 07:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vXY92xiVcSCoihG0TT6zFgFAzGF0aHK+j0EPAjfDpt4=; b=GMAgJT78CAXSRvHzqCyBh72c44 yKnOTdDeHdG8MpUntZdbv433uwQHd5/RqHWIbL6HmnYEwz3QL2KB8QuTc1gEegMHPB22ANVAU1B1f flJ5JdHESdxoJTK+gdCHe0f8B65Y7XohT+lruo0VVuHPIo5JYEp2Pz7mMNCu6O4573R1j9grt5KNM 0wnFsoyIDcNw+1betYYDi7JkSvSq7pqnIWz66UzWFXWnQrk3QIs0x6I3vCh0XDFvi0IvCoan7dwyt fEYmYsFekF+oqKr+5rANQZlGBFzvFBpd1tWHNl0S5rqeaAgumymOuP4ixa6eYpfV15tjeLh7R2HWo Wo6RbevA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lgTDP-007LsX-8r; Tue, 11 May 2021 14:18:38 +0000 Date: Tue, 11 May 2021 15:18:27 +0100 From: Matthew Wilcox To: Ilias Apalodimas Cc: Matteo Croce , netdev@vger.kernel.org, linux-mm@kvack.org, 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 , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Yunsheng Lin , Guillaume Nault , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni , Sven Auhagen Subject: Re: [PATCH net-next v4 1/4] mm: add a signature in struct page Message-ID: References: <20210511133118.15012-1-mcroce@linux.microsoft.com> <20210511133118.15012-2-mcroce@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 05:11:13PM +0300, Ilias Apalodimas wrote: > Hi Matthew, > > On Tue, May 11, 2021 at 02:45:32PM +0100, Matthew Wilcox wrote: > > On Tue, May 11, 2021 at 03:31:15PM +0200, Matteo Croce wrote: > > > @@ -101,6 +101,7 @@ struct page { > > > * 32-bit architectures. > > > */ > > > unsigned long dma_addr[2]; > > > + unsigned long signature; > > > }; > > > struct { /* slab, slob and slub */ > > > union { > > > > No. Signature now aliases with page->mapping, which is going to go > > badly wrong for drivers which map this page into userspace. > > > > I had this as: > > > > + unsigned long pp_magic; > > + unsigned long xmi; > > + unsigned long _pp_mapping_pad; > > unsigned long dma_addr[2]; > > > > and pp_magic needs to be set to something with bits 0&1 clear and > > clearly isn't a pointer. I went with POISON_POINTER_DELTA + 0x40. > > Regardless to the changes required, there's another thing we'd like your > opinion on. > There was a change wrt to the previous patchset. We used to store the > struct xdp_mem_info into page->private. On the new version we store the > page_pool ptr address in page->private (there's an explanation why on the > mail thread, but the tl;dr is that we can get some more speed and keeping > xdp_mem_info is not that crucial). So since we can just store the page_pool > address directly, should we keep using page->private or it's better to > do: > > + unsigned long pp_magic; > + unsigned long pp_ptr; > + unsigned long _pp_mapping_pad; > unsigned long dma_addr[2]; > and use pp_ptr? I'd rather you didn't use page_private ... Any reason not to use: unsigned long pp_magic; struct page_pool *pp; unsigned long _pp_mapping_pad; unsigned long dma_addr[2]; ?