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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79832C433ED for ; Tue, 11 May 2021 14:26:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 568E761376 for ; Tue, 11 May 2021 14:26:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231848AbhEKO1Z (ORCPT ); Tue, 11 May 2021 10:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231713AbhEKO1T (ORCPT ); Tue, 11 May 2021 10:27:19 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DCADC061760 for ; Tue, 11 May 2021 07:26:13 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id i4so26565729ybe.2 for ; Tue, 11 May 2021 07:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CEaJC4cb5Y4A+8IsZZEeBM2QdsYN5Y7DFCllFllvi+8=; b=zHX1LMvKjHtyR4sV+y0aqvfoFcsp0EjIHx5Pt5zG+iVHvcxKYTo3vrUGTaAWwd8n54 Sfqn8OV7GElBxhfBXlUssjujJWtAC4qSGRQRUdjhpxxfIF/QhMZuc4qpQhRqMR2wxO35 PUJFZ124qF2EtUdMTmUBpVLFUQUtq2V0+5HEOB02MRwMRFtF2H0ypRhbY9hAsMcY5VaX NMWRowJcerYr/hEpfCDq56QNJVhvrpZzyFRgGaLU7Od2GT34GNf6kMsyWrhX+phrvlrk he7jEFsGAUZVNd7E0mAorNTJN4vbw3juF/pR8H2tEAQ/4MVq5x3yPsBcSeKS4v/uiUHB uX1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CEaJC4cb5Y4A+8IsZZEeBM2QdsYN5Y7DFCllFllvi+8=; b=UMHbKzBFQsdah5B/5KG9lSinV0wI2I6IyJvq1pSRur4xN+3thUtmKueBWOpJuDwEq5 kfTYebpOXtSzJbqIojaG3lbF1v+wGOMEd7dcOgBFbR9QLKtTXhnf+jmgpdhlE32NZVOc F3Lw1bY7g8jUEUGfX/8+7INw6d5zKPiFM3xcERX+en1PLeHgGRAY5Nn7jUEInFkcv/LG XHBLRle1JPDxJ9zjdDoTGo8sFNG9qgYMxc9pQajA34Esy0u1TsZ/d1bqaDd2WRzwVQD/ pbILCUaFVEepaFDMQTN1JI8MfFlU4md5LW04v+DtVP2C1czBVhwcA+BtGGIschg3nhND 7yJA== X-Gm-Message-State: AOAM530CEndczRz9Vwm/tjU74oBuql8rfm8BeqabXzR7yP6K5DpAC8EN IpdLI6dTUJhtVd0KD0/J297sMelJGEi+3FIua0gCEw== X-Google-Smtp-Source: ABdhPJzh4VjKqBeHWbxCHf0TChJFitLGXDaA/GUpbzyFXfVL/53v7XHycwNEzDPWQyzljYzsrL3I6khv5C0KKCJRTSQ= X-Received: by 2002:a25:d0cb:: with SMTP id h194mr28426645ybg.408.1620743172546; Tue, 11 May 2021 07:26:12 -0700 (PDT) MIME-Version: 1.0 References: <20210511133118.15012-1-mcroce@linux.microsoft.com> <20210511133118.15012-2-mcroce@linux.microsoft.com> In-Reply-To: From: Ilias Apalodimas Date: Tue, 11 May 2021 17:25:36 +0300 Message-ID: Subject: Re: [PATCH net-next v4 1/4] mm: add a signature in struct page To: Matthew Wilcox Cc: Matteo Croce , Networking , 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 , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Yunsheng Lin , Guillaume Nault , open list , linux-rdma@vger.kernel.org, bpf , Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni , Sven Auhagen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 May 2021 at 17:19, Matthew Wilcox wrote: > > 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]; > > ? Nope not at all, either would work. we'll switch to that