From patchwork Thu Dec 28 08:57:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13505697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95A05C3DA6E for ; Thu, 28 Dec 2023 08:58:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E5728D000B; Thu, 28 Dec 2023 03:58:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 16E8F8D0009; Thu, 28 Dec 2023 03:58:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDC428D000B; Thu, 28 Dec 2023 03:58:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D51F08D0009 for ; Thu, 28 Dec 2023 03:58:00 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id AEC661A036A for ; Thu, 28 Dec 2023 08:58:00 +0000 (UTC) X-FDA: 81615624720.27.2FD6C7B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 32581140007 for ; Thu, 28 Dec 2023 08:57:58 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=atnA6Jze; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703753879; a=rsa-sha256; cv=none; b=ItokanlXTw5ux+iVVfzPuHb1A7CCFCBeSftWi9kmREWHqdzRkK7DLxZGI/z/ox0XcUcDL1 Nzx7YvJEvzrkPKA8dDLAF8KHmOUtYgaZ+FRQn0C5MOym5IIDRbH5pkzqLZzUrrtaqZO6Af OlO+1bkWBwyz8lKv+PLqQ8yGfGKaxzw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=atnA6Jze; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703753879; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=izNfNhi/wWzSr29l/x5G5azK4k/L2vVr44OyXHMo9wI=; b=pNrCcwj2DM5TdpwpQl/Dfj2jkLlx8i+0ey+v15FwTxkckVIZzw36wtYwbqe+KrjMWx+XwU +nJXjnfJAVriz8B/7UZ3p286ydIDGfgqcDJOaGAI/jkc+2PrYSfUpoPeL0SaXCrPg9dEHK qxA04FC3BZQG/xJzQ+dRngBiiS5S1O4= 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=izNfNhi/wWzSr29l/x5G5azK4k/L2vVr44OyXHMo9wI=; b=atnA6JzeZ0jF/QjyE1EzJFubw4 iY1qCsjLPuo31p72kZgS9Tymcg3o51CplLadBkAEB212yD6u3kP4j8kvff6dNZmPDAsn0dOPuubQm +O+NTJsg24jN5v5CmwVAwLau/8BsaGwK4jHjgc9cOxX7DOZkXyHPPHTdL0YBRUG8EYX2hcoIIWFpE ALvHEJk6/JUaZyPyDHhtmY+VvHIdkKWL0oTOk/HOAiAATAlQPrPAkrLVm6Mz98fq33dsdJL4nYUmx YhPSPX0B0113SfWeb0WiJfAYlAasqBbAN2X5Gf1StGoJS9kikazwGPH1NlVyLISpf1vq5d8+WQxP/ Zs/pVPiA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rImD8-004XzA-0F; Thu, 28 Dec 2023 08:57:50 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Johannes Weiner , Vlastimil Babka , Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [PATCH v2 0/6] Remove some lruvec page accounting functions Date: Thu, 28 Dec 2023 08:57:42 +0000 Message-Id: <20231228085748.1083901-1-willy@infradead.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 32581140007 X-Stat-Signature: bzmbafss8mm96ux1gbpedipubunz9ust X-Rspam-User: X-HE-Tag: 1703753878-121632 X-HE-Meta: U2FsdGVkX1+fFHDOgQi0pyTTrQk4Kx8wYVXdJU+eK4Cv1tcQJHQtfhHyHme9M5tKtftaDhOMGivnxbh1XO+Ch7TughI44M1xMAX/iBELMz93aZNhfJXwaxcsPUVNfK+Wqc7aNXFCjhMrI3AnLu0Qii9vCEz+L8wsxD8yWt05QOHamzjbWPjS7h7mdP/i0weJ529nWbURJgDcxPYTl3SOrzVpu5365HHStKhL0gs/LKErHtTD3+5IKB2njtREMA38m1tn/S6I1mJC9fp72FyVSQanq/rjNM64Cs/82i8g/w7gBPOcG9nuXT7CZoLIPBzzChnhbb3nlI+XNd7nywgQH+Oo/i3GLDvDRHXljNxTcRIbkNU+CxuYqhooAbUIZgG0jREMirkyNATYwgtZ+NIFJHeJfMivvSpJRmjzIJlBPxGPmMEcJfKEZ0iwdOjTx98lssrqk+wWVBbVX/p0i+MShP3t7OT1OQLP0NQUyAaHZWNsdX6pVFJKKNxLLY/QUy1Hyaa2Q2pZ4W/zNxBt7ZVvCUMkEVYCUOhLUdMOFwYZTMNh+9i1OFSY0pjUbJ6kz8FMGUrPdfCybDFK3FuNSbffeaU1ix9mZA5ZhhNBfV/cwVP2A1S3ymSILMzzmIM+djUQWFxP8AFizwHPIuG/LNBCUSHZzQijDcdOJuqrjY3OnWpod91A6USc66AvN3hUfTS8T6Rzq/0gkt/fXD7jsZi4DXnay6bpgdV1aitcRc34qsWD3jnKD7+8nt+oLYVG6C+jCxvONGRuPp3tWRj46ZvzAErhLy3fX6smBp3NU5BgBdsQcEQT2+C8Hd7sBhnfvquy7RSeS2siZ7qycnEHYyHFTX/fZsQEJh6Tdsvn4ySGRAImznPm0Ej7XdFTubjpBjW/+5l7RloYUNEb08rqi5wtagpXrl1XQ/mRggB9djrOZo04T2UTU3o5QHRnxfRsH800W/52Iqlo7oTNz+u97YY WkazGdfk UotvLDHyAlhj2/AvjUCgqaX0DqMFTGem97tUUB40UcWQ4XAznMueXYbY1IOQv7IjMChIUua9MJ/BHX+lbwXBP4NBvoIy0F2d2YTNKLcQeeqH+Y2AgGl6+tUKPHaHgPFnSMIxwThw8XHJV2rpOFezuS+5FpDHbicyInelpPOXx5IegYvF16SUXs9XgZc+RRJPqqOQt 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: List-Subscribe: List-Unsubscribe: Some functions are now unused; remove them. Make __mod_lruvec_page_state() unused and then remove it. Based on next-20231222. Boot tested only (as next-20231222 has some infelicities with regard to my testing setup) v2: Redo the slub conversion. Avoid using folio_alloc(), but do cast the struct page pointer that we get back from alloc_pages() to a folio pointer. Since we know it's a head page, this all works marvellously, and will continue to work until we can actually split folios, slabs and pages apart, at which time it will have to be redone. I tried a few different ways to make slab ignorant of folios and it's quite hard to do right now. Look for a patch series to make that possible soon. I wasn't expecting the previous version to make the next merge window, but since Andrew decided he wanted it, here's what I'm currently thinking ... Matthew Wilcox (Oracle) (6): mm: Remove inc/dec lruvec page state functions slub: Use alloc_pages_node() in alloc_slab_page() slub: Use folio APIs in free_large_kmalloc() slub: Use a folio in __kmalloc_large_node mm/khugepaged: Use a folio more in collapse_file() mm/memcontrol: Remove __mod_lruvec_page_state() include/linux/vmstat.h | 60 +++++++++++++----------------------------- mm/khugepaged.c | 16 +++++------ mm/memcontrol.c | 9 +++---- mm/slub.c | 20 ++++++-------- 4 files changed, 38 insertions(+), 67 deletions(-)