Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp808307pxb; Fri, 16 Apr 2021 20:21:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6sATkHHWyedMyn8ABsm82bTbNRi2r5CKFYLULwrBnfQ6ctbAvdLaJqkKK+Gltnj/loSPD X-Received: by 2002:a17:906:cf86:: with SMTP id um6mr2145946ejb.549.1618629675506; Fri, 16 Apr 2021 20:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618629675; cv=none; d=google.com; s=arc-20160816; b=GoNfa/7EGudt9HTdAJqhJu6NpVTpOVZs65wAg2fi3I7lIbHI8xY1+ZqaWaFqH+m3KT lvpzFzhf1VzR+CXxEdss437mCapffG+jU18db2ihrbUof2BoFhUQVCIH4EBNAORvHVhw JZxr3kFb1Ou5nppXdet9ZpwS24gkycDPPbvHuj2XU6OcwjZc1jntM1Z8dH4DkyrLntM+ UD8nErpWTSPpdJFyjqQ+df4h5lqG0Szz7dtHsI8fEaMIOpUhnAxK4zeu2CMpn/glSptX RXLyfyu8lMcBzgg4qu0FPh3JoIIN9h7Bvv/N37uezfwdpcl40ke+3VbM1VlmK532sV1N GaGQ== 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=GyfHo5X+9TYxXDQBPsebhce873z4IO94hxWr4yFJsxk=; b=lEOMWq+9xueGrASmIHBNxMVXDHMqw/IFHVJ2VquLRSYOKUatd2xE7f0OdmJo9E2A8s MuPbGJtBzYS/oU3XibQ1uyiJKKUQb3JjFodMfzPdqgPgDZUBxTBxOPDmsWW75v0Sp1+H qe91R8QFv8jHjhWb2Se2I3WUGkCUNS9dY4J4RjQyXLP+NROyiRM0lBmBs0DdcoypHGb9 aK/g3Vcm5dcHLjRqAuRrI8oJ70/m3pvEPZeS0DaCZhsX+7wcrc+ppXdIpYe8uGEZ7u05 I2j1Su4r/JfgzaoHDREnoXHvJtDearL6w+jddWAKk+uzB1G4Fw8hM17l5eoeW3MAhSzr djjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eLkRpqM9; 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 l17si6264203eda.91.2021.04.16.20.20.51; Fri, 16 Apr 2021 20:21:15 -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=eLkRpqM9; 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 S233892AbhDQDUX (ORCPT + 99 others); Fri, 16 Apr 2021 23:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233847AbhDQDUP (ORCPT ); Fri, 16 Apr 2021 23:20:15 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E3A7C061574; Fri, 16 Apr 2021 20:19:18 -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=GyfHo5X+9TYxXDQBPsebhce873z4IO94hxWr4yFJsxk=; b=eLkRpqM9nVcIRoyRLRDTRb+BGw 8Awo1hTN6pG0fPX4ENPtHTgJ48U/u51Nl9T7MLyFIioyj8ndHPm3xgvLjM9WDUKO5myVwtcj1L/tA vxyewxTVxm2oJidWu97Sn26XMpfCR94JhZaH1KmJvz8URVQ+vtrELkUHkUpY25zznz8ZZsxrr1F4C jZFWtzr1IDbg8asen9M5hZEr8pqF5z+i2kZWHrwxjbtCtUXLIA2GHxtapiozrml/Zzh4A0tEnLKFb ZThBj+SmcItxXjZ5LILeRy9iqYUuhHuFH2RjpdGU724ns0j//tKwz/QkauIH43rk3hZw41DH66Nr6 qRM5Tlkw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lXbUA-00AmRw-8N; Sat, 17 Apr 2021 03:19:10 +0000 Date: Sat, 17 Apr 2021 04:19:06 +0100 From: Matthew Wilcox To: Jesper Dangaard Brouer Cc: David Laight , "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 , Grygorii Strashko , Arnd Bergmann , Christoph Hellwig Subject: Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems Message-ID: <20210417031906.GQ2531743@casper.infradead.org> References: <20210411103318.GC2531743@casper.infradead.org> <20210412011532.GG2531743@casper.infradead.org> <20210414101044.19da09df@carbon> <20210414115052.GS2531743@casper.infradead.org> <20210414211322.3799afd4@carbon> <20210414213556.GY2531743@casper.infradead.org> <20210415200832.32796445@carbon> <20210416152755.GL2531743@casper.infradead.org> <20210416190823.3b3aace0@carbon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416190823.3b3aace0@carbon> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 07:08:23PM +0200, Jesper Dangaard Brouer wrote: > On Fri, 16 Apr 2021 16:27:55 +0100 > Matthew Wilcox wrote: > > > On Thu, Apr 15, 2021 at 08:08:32PM +0200, Jesper Dangaard Brouer wrote: > > > See below patch. Where I swap32 the dma address to satisfy > > > page->compound having bit zero cleared. (It is the simplest fix I could > > > come up with). > > > > I think this is slightly simpler, and as a bonus code that assumes the > > old layout won't compile. > > This is clever, I like it! When reading the code one just have to > remember 'unsigned long' size difference between 64-bit vs 32-bit. > And I assume compiler can optimize the sizeof check out then doable. I checked before/after with the replacement patch that doesn't have compiler warnings. On x86, there is zero codegen difference (objdump -dr before/after matches exactly) for both x86-32 with 32-bit dma_addr_t and x86-64. For x86-32 with 64-bit dma_addr_t, the compiler makes some different inlining decisions in page_pool_empty_ring(), page_pool_put_page() and page_pool_put_page_bulk(), but it's not clear to me that they're wrong. Function old new delta page_pool_empty_ring 387 307 -80 page_pool_put_page 604 516 -88 page_pool_put_page_bulk 690 517 -173