Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1404191pxb; Sun, 11 Apr 2021 18:49:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAoTMnes8VLzQzxpyPj3xi0Cyk9djt9s5p2Bm5/MBD+Jq60LVa033pH3WrAyzdMdLF7Z98 X-Received: by 2002:a17:90b:1e10:: with SMTP id pg16mr16952815pjb.30.1618192171896; Sun, 11 Apr 2021 18:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618192171; cv=none; d=google.com; s=arc-20160816; b=ewdt9DLin89D6cauYxFwEV+qd54lZhK4ZfgoPR37wHnck01HLFJlEBGXhoopACMiIX xIoP3zlEWFEfCsqc3omlbU4WzvWbOHikd86pA2LwMg30FoYDwrV2J6sbp6IyPAU14jga saxVr8AD9tV7X/xRqipq4CtiGxLGhJRwGXfGD4v6tFZMYiZeqQIxVpTDrZGsBmtvOYTr xLxtba+0mV1FcKFedMYaVVXhw1wWZpuBKKFDTuUn3Bhr3EDzNNAU96Bt/R+urB+ehTJM wcqvww9vHxlLnQyYyT22l5fnO4dSkwRkd8ELCCSaEaLAgEjaAcGHYSMHw5VyZgXoVEMu pxWQ== 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=T0Zq9EStO1wC7R34W+g3UOBErmBYCTh0458TpX7pzAM=; b=gdlw+UIsF6NhbK9WjBC9CERnf5qKvU0B3yZHgAfsB3UJo2tn73+a2j6UREvdsb8JLo hs0MNUyZ7/wyBxZ22ICX9BmctXksivmTjLkxmpsiZQWLVQT98X1Qap55Fu4M3vaLLSKb 8fL2UISvyTHG+ZslBwxH8bNoMSbSE8glbwMkdRdf5zXlp8gpEREzYpbmtCSYZWJHVK9v AWALZiqmEpWkudKKGPOalPn0z/BNLw1W8gWQ59hSeimrRZhdsw1jAAykEQxThefmrCZo KKOIY2+C97bsBzW8WzxBg9CUj9XIKKRYvfMeD9YP69gbmik8hPtBDgBOBmF6u1fAApz4 NqGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=sJNR212k; 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 u12si9245826pfk.29.2021.04.11.18.49.20; Sun, 11 Apr 2021 18:49:31 -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=sJNR212k; 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 S236411AbhDLBQT (ORCPT + 99 others); Sun, 11 Apr 2021 21:16:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235835AbhDLBQT (ORCPT ); Sun, 11 Apr 2021 21:16:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B43FC061574; Sun, 11 Apr 2021 18:16:02 -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=T0Zq9EStO1wC7R34W+g3UOBErmBYCTh0458TpX7pzAM=; b=sJNR212kfJE88C8nTxg0l1UoXm Cbal0fqU992DQHm3N5P+Ml/9N9Nv8acJ4+M9c61cLDw5tVx1vo3l6fZZROGO3u3JvlmQVNt4MgFBF g/LmZnGbLw61COtglVjylsbOp2kznKGio6cRT0PAyvdOG++3HcY0Qj2N4YAZR7/Ongh3aFzuLqR8m XpLj86Ky06EguyRTY9VLPmpIBLI0SVSSf/qM7da3I6iIUxLPkRa6HQGofx88BF7zq2UCvMpdlkUh2 BFDTkwUVNukJv24on8dSKLRot4g8EsOusTp5QhTE7Rt9RCw1g68fuBAJPJZZ1YyczV5CDfiii3KiL qrpu7ngQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lVlAq-003fOL-Tu; Mon, 12 Apr 2021 01:15:34 +0000 Date: Mon, 12 Apr 2021 02:15:32 +0100 From: Matthew Wilcox To: Jesper Dangaard Brouer Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Ilias Apalodimas , Matteo Croce , Ivan Khoronzhuk , Grygorii Strashko , Arnd Bergmann , Christoph Hellwig Subject: Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems Message-ID: <20210412011532.GG2531743@casper.infradead.org> References: <20210410205246.507048-1-willy@infradead.org> <20210410205246.507048-2-willy@infradead.org> <20210411114307.5087f958@carbon> <20210411103318.GC2531743@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210411103318.GC2531743@casper.infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 11, 2021 at 11:33:18AM +0100, Matthew Wilcox wrote: > Basically, we have three aligned dwords here. We can either alias with > @flags and the first word of @lru, or the second word of @lru and @mapping, > or @index and @private. @flags is a non-starter. If we use @mapping, > then you have to set it to NULL before you free it, and I'm not sure > how easy that will be for you. If that's trivial, then we could use > the layout: > > unsigned long _pp_flags; > unsigned long pp_magic; > union { > dma_addr_t dma_addr; /* might be one or two words */ > unsigned long _pp_align[2]; > }; > unsigned long pp_pfmemalloc; > unsigned long xmi; I forgot about the munmap path. That calls zap_page_range() which calls set_page_dirty() which calls page_mapping(). If we use page->mapping, that's going to get interpreted as an address_space pointer. *sigh*. Foiled at every turn. I'm kind of inclined towards using two (or more) bits for PageSlab as we discussed here: https://lore.kernel.org/linux-mm/01000163efe179fe-d6270c58-eaba-482f-a6bd-334667250ef7-000000@email.amazonses.com/ so we have PageKAlloc that's true for PageSlab, PagePool, PageDMAPool, PageVMalloc, PageFrag and maybe a few other kernel-internal allocations. (see also here:) https://lore.kernel.org/linux-mm/20180518194519.3820-18-willy@infradead.org/