From patchwork Fri Apr 16 23:15:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12209283 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=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 BA813C433ED for ; Fri, 16 Apr 2021 23:15:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 49B84610CD for ; Fri, 16 Apr 2021 23:15:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49B84610CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A39E06B006C; Fri, 16 Apr 2021 19:15:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E9CF6B006E; Fri, 16 Apr 2021 19:15:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B19E6B0070; Fri, 16 Apr 2021 19:15:58 -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 6C0E76B006C for ; Fri, 16 Apr 2021 19:15:58 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2A6192A87 for ; Fri, 16 Apr 2021 23:15:58 +0000 (UTC) X-FDA: 78039789996.37.60CD077 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id F249A130 for ; Fri, 16 Apr 2021 23:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=nwUWUH98s+1WN159z74VpGNQ2eihncUQHO8O/S2I9OI=; b=uIlnfxHrnXGnNjvoqqw7j1Unf5 lQlvtWGC71jnFtTqwAbv4DUBBEju4/d6JdSWLEva7QoWbXXlvGY3IM8T/GhTSNQtXlQtRZ+hdewKk xPEVBH90bm2howGqpuQVaHxZMxA9E1kKxuF8UAeH90vevC0H0GLFDw/+is1Yq33mXOqCuqk8Crt/D NCi7IVu3c8hQK8OTHf7lhh9Y678s2kEa/01ddY4YFDVupkNaZKv3puQKKQi+oY99LUzdWEoNe8bwc nlh7RStmiJHmRITNO7ImPYxxCxdSHVKoDDYmQQ6aVA568lcecTeb9IjHVamnxP2d39srUNNDKZsL1 NPHJyV4w==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lXXgU-00AZwI-AP; Fri, 16 Apr 2021 23:15:38 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , Andrew Morton , linux-kernel@vger.kernel.org Subject: [RESEND][PATCH 0/6] Constify struct page arguments Date: Sat, 17 Apr 2021 00:15:25 +0100 Message-Id: <20210416231531.2521383-1-willy@infradead.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: F249A130 X-Stat-Signature: tt3gbzhksexgydmtm7uyzyw7w15ib13y X-Rspamd-Server: rspam02 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618614955-807951 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: [I'm told that patches 2-6 did not make it to the list; resending and cc'ing lkml this time] While working on various solutions to the 32-bit struct page size regression, one of the problems I found was the networking stack expects to be able to pass const struct page pointers around, and the mm doesn't provide a lot of const-friendly functions to call. The root tangle of problems is that a lot of functions call VM_BUG_ON_PAGE(), which calls dump_page(), which calls a lot of functions which don't take a const struct page (but could be const). I have other things I need to work on, but I offer these patches as a few steps towards being able to make dump_page() take a const page pointer. Matthew Wilcox (Oracle) (6): mm: Make __dump_page static mm/debug: Factor PagePoisoned out of __dump_page mm/page_owner: Constify dump_page_owner mm: Make compound_head const-preserving mm: Constify get_pfnblock_flags_mask and get_pfnblock_migratetype mm: Constify page_count and page_ref_count include/linux/mmdebug.h | 3 +-- include/linux/page-flags.h | 10 +++++----- include/linux/page_owner.h | 6 +++--- include/linux/page_ref.h | 4 ++-- include/linux/pageblock-flags.h | 2 +- mm/debug.c | 25 +++++++------------------ mm/page_alloc.c | 16 ++++++++-------- mm/page_owner.c | 2 +- 8 files changed, 28 insertions(+), 40 deletions(-) Reviewed-by: William Kucharski