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 7D5CCC43461 for ; Tue, 11 May 2021 14:11:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EF0C661480 for ; Tue, 11 May 2021 14:11:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF0C661480 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EEB086B0070; Tue, 11 May 2021 10:11:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9AC66B0072; Tue, 11 May 2021 10:11:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA0526B0073; Tue, 11 May 2021 10:11:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id A909E6B0070 for ; Tue, 11 May 2021 10:11:21 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6CE7B6D86 for ; Tue, 11 May 2021 14:11:21 +0000 (UTC) X-FDA: 78129137562.21.FE5344A Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by imf09.hostedemail.com (Postfix) with ESMTP id CBAAB600010A for ; Tue, 11 May 2021 14:11:09 +0000 (UTC) Received: by mail-ej1-f44.google.com with SMTP id gx5so29946897ejb.11 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=RRQLevFZkMOUH5/PCR0oJ4Q4AjAb5t9h33oC/wAuiLXIMbvw16hVAQpUtM/snPaDSJ 0/LyRsQTcjVt7pdD5RrKXx6mVtCir8EsT/C9/Cqq/me3vGeZ71bFOEFOVZRWLKz/t8Qv vcrgX7yloZs5EeTxkN8gr1z6zIkRxNnFod/Bo9Sr6IXHqJimXBy3BTLbc4UJaX3DmUK5 yJcRirz7Ht3CZSXFZiaI2bHBxAZuv3scvNBkPDjUWVNR3kET/NCnZcfTA1PAsShXiiSs zxKIY+9YBI4BKoc92ifJlC4w5xQ+vMf3EoOcMd143y6zzYDD9VNMrt1TS4Ns8bun7Ms+ eVYg== X-Gm-Message-State: AOAM533YbImi8qPXlG58+wrTCcm47Lf8kg3BEEznQXiVwPv5VJ7Z6oPi m9veisuBKzQ8qo/NG6cSg9zcog== 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: X-Rspamd-Queue-Id: CBAAB600010A Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=nBT0KcVB; spf=pass (imf09.hostedemail.com: domain of ilias.apalodimas@linaro.org designates 209.85.218.44 as permitted sender) smtp.mailfrom=ilias.apalodimas@linaro.org; dmarc=pass (policy=none) header.from=linaro.org X-Rspamd-Server: rspam04 X-Stat-Signature: jo4eqptmgx45ikex7dsimzb6no9jizot Received-SPF: none (linaro.org>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=mail-ej1-f44.google.com; client-ip=209.85.218.44 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620742269-678631 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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