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 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 D858FC43462 for ; Tue, 11 May 2021 14:11:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4F8661480 for ; Tue, 11 May 2021 14:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231488AbhEKOM3 (ORCPT ); Tue, 11 May 2021 10:12:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbhEKOM2 (ORCPT ); Tue, 11 May 2021 10:12:28 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED485C06174A for ; Tue, 11 May 2021 07:11:20 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id f24so29987294ejc.6 for ; Tue, 11 May 2021 07:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=h+QS57uiDcNTSUqHWnANazOKg81NGt/aGf/q6ieH1nA=; b=nBT0KcVBFdLuioxxcGs1zFZbBCuEmIA5PEK7t++BbscRfg1vcTUhh3lSqa+QW55LI7 s7FBc50qHrBEbDhdSygfrqqf4/IwC9UhdDBTzufvA5dHY/Qkya3JV6QTnB+krBEsdXE0 9CJ/4ylMQSbN8nUrHFXh+FlybG4pvnlxenZwPdv/79v5kJ5iopwKJJVQxrKwa21Bnqdt JTFKwEqHDhitRoFZqq/OnsDXPJD+Cqai3kHhcSJYo2ZgRWMNnd9TqKkb30UnIfDm6+r6 6ERYqfNvRAll4JfCrnrPGUOBmDdO0bXGvWHPsrF8jpXkVLv81EZ4d63Y1HGf0QPxWI1x 1/Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=h+QS57uiDcNTSUqHWnANazOKg81NGt/aGf/q6ieH1nA=; b=Jh6xs1rTEFDCT33UR9BQmpf6LYKyEy4RWudkCvKJYHT5byJcz+Yu5klVF4+eLjDwfG HgZBABSAr6b7vbr0FNiBul9Q8BUsXo/kS6CKMiTPIGUopqLt3ITzAPGJWmKQTI+LtM/M TnlocGvA3/d9gt5wljEsfB4yuuVLlgVIya9tJ0rlRCeEIG2qk2B+1f85Yt/dfx35eqgH cCtrHpce1JOyhlufBZgVrXYpSJEBeqxRZxRFUXfVze+hvFvKoHxeXXw1Z9BITemHsYOM 23dHtqwz/xkf+mnzPzx6fUDrtomCVn7zeHo4ZyQflp6AHKlbdUkyJI18cnpGV5wTLEMV kcIA== X-Gm-Message-State: AOAM531HR2S2cVGipqSVfVrTTnNaFVRz1Rb0V5jQuJoOkUC1iaLhY1ug K87Mt9Uh0ejAte1FLmcWNg2KAA== X-Google-Smtp-Source: ABdhPJyde4XpzdeyCjbJoxHs1iN8giKGPqKQdQE8vE7bc3fW9JukYGeNAo8nJr9s6SFzEog6CVswzA== X-Received: by 2002:a17:906:594c:: with SMTP id g12mr3983010ejr.267.1620742279612; Tue, 11 May 2021 07:11:19 -0700 (PDT) Received: from apalos.home ([94.69.77.156]) by smtp.gmail.com with ESMTPSA id v12sm15108949edb.81.2021.05.11.07.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 07:11:19 -0700 (PDT) Date: Tue, 11 May 2021 17:11:13 +0300 From: Ilias Apalodimas To: Matthew Wilcox 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: bpf@vger.kernel.org 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? Thanks /Ilias