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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01401C4332F for ; Tue, 31 Oct 2023 09:13:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D73896B02C1; Tue, 31 Oct 2023 05:13:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D24176B02C4; Tue, 31 Oct 2023 05:13:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BEB2E6B02C6; Tue, 31 Oct 2023 05:13:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AC1046B02C1 for ; Tue, 31 Oct 2023 05:13:52 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 88C7240D03 for ; Tue, 31 Oct 2023 09:13:52 +0000 (UTC) X-FDA: 81405194304.29.E0E679A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 3B6CF14000E for ; Tue, 31 Oct 2023 09:13:50 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=G9ZNY+DA; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698743631; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YApjqNuY/pq2MHNZwmUHJN8pF6DxZ+rCEU+vQbGIA8M=; b=wXN+eLUP+0b3eiWsVJhr31oLGOzOe8ByWmrLNKQzCaTvdQJFPXFKm5N/Oauhs1zvUeQSrl Y3tZQ6zjGjY5uien+W3w8O0uvsFSPDUhAp7uFDv0UZEzBkvAzPXogfgP1ixlnFQYNd2Dpo bTW/UPQTJmApyi//iqfc+ysIGUaMo6s= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=G9ZNY+DA; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698743631; a=rsa-sha256; cv=none; b=ksfXZXabaqTPCTH2nqGPwPhIge7YvI2EY+9k8IcS/Ddf37Ct8NlpwRjQFjUNoBuAo914nM /cOHlv5i1T/OTTAgeyKkor27KFCzVtM5r5B7o4Tal7XwAUJESxRyNTcnmk06VeqfNIhCh+ xkDLNSk5XRldPumg3mcF4Dpt2y4HPA4= 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=YApjqNuY/pq2MHNZwmUHJN8pF6DxZ+rCEU+vQbGIA8M=; b=G9ZNY+DAmo8332MzV9l/PQQwmC o7o5SsvLHyzxa8USmMigjOAkK37lkMQroCjd3qqlmLF1oSU5Yr6BM6YJu26qzpHp3CABAL5iiK3ss xogWruUgt+Q3DwWBhwYMtTCB9PMR+BqU9438Ws90S18eu3SkBLlqHZJgxiezZ9xMx/usvGnJP5oOb lJ+U4W6JvrNOY5WE80pkrIUdTmw/Pd0OqlS6UwU9XilyxbnqGLtVLva6NNGim5wh1Ujz+wQbeuqSP OL9eoTlSeq16878IMP2aCNiOssibh9H2iIsMNuQBDUFWYEu4b5JgN7YrVKr3jZUXNYEsgd3tddeCT itqCmHuQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qxkoi-009IZB-5G; Tue, 31 Oct 2023 09:13:44 +0000 Date: Tue, 31 Oct 2023 09:13:44 +0000 From: Matthew Wilcox To: Gregory Price Cc: Gregory Price , linux-mm@kvack.org, akpm@linux-foundation.org, david@redhat.com, vbabka@suse.cz, naoya.horiguchi@linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kpageflags: respect folio head-page flag placement Message-ID: References: <20231030180005.2046-1-gregory.price@memverge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 3B6CF14000E X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: diq1rcybhm3dhgbr39xkmmeqe3yo6npn X-HE-Tag: 1698743630-796485 X-HE-Meta: U2FsdGVkX1+d4Vwt1HHBiM2gQ0XBnYMFk4nVOpDEqOmNeFmium74xxw2MoQm+I8vrWlXaPeaoxakwkACitapZV+YWEte8jq6W3ZJ7Qb3XyPxr4/ldh7xmqS4s82f563nSS9Zobcsa07U3xntPZOQpZluJ3NvwYmPhFFJo/MCACZuIaDYmfsybsrhftlgsM4H+MHZ8dsLFASrNuDrELPBqCPKti2Do1qicL8h6RJjednyylIxU+ZAob+hTfxYKttDoTpW9P8KyNhVhjQvUqHNbPFG2rEu2Af9waAnYdYYouVHrsR862L7mH/0tQhSWA0/FZJxRZs4FjGl5mhKWjn9JkOVhaKxRREecygnP1vicJIDOYZycb7l0kzGrHoltc0nobgK5q40m3602vYsq0dDwo+lsqhtGshVec7/cquRzlw1ao5sYu8Qn4w116HH1K5br1lURFHSH67pALfKyOPglu9jUbvZgVzmOhYv0W2+kVFo8cyk6e6xkSUperoduJgutdJa5J++m2x3INFkuiPBQnVugSsWBBKjTCGxBTr+h1GcZNAahsj1Iw4ftWR4/bL29V7LlgsQV0cWuV5WVC/9CbmRkcbDZW3l0iw30i2YLDLtEOG25urj0W4c/VZpWzR5sPP2VqzPW5x15L1RBf/jmkRI07G2KFM7Fvh96uBQDnvKXT1H6dkhovZksx5MburuXLzOWnzAu/DBXNxuQxC0ct/hajkG7jdskr3xidkfG+k5vwU9yePOi5tS6d6BOHg4kwmfDSlQkvp/IZh+isbzWBBHn6oZc49mDAqjnEgqev4Pg5wPzrLUhDzzCV3t1YVcek3oaxJQGTzUM0WtmcmObvRQOQZoN0A6icAwrEssR0XvD9B+KMEL7DR8WkWSGLdQZcKZIVrlsmbjIbJaOxtC+Cga7f/ji/AsDvD4PVs1eBkS92tqWAhOgPETfyeaE8OAAJ5ePxro9g3butIE6fx biKBQu4f 7NpT2l3OUoZvZlb5r9JSU33PtvYMtijfmlTkEyNcG2zVRUailYjZUItkXYsRxIJfSKDTLuiCbZEeAqev77W4h/DgHEmZWVCpzaGrevkhgQuou4pzAH9LpGVKJfD4Ip8JqZsR3Ap481Ygqw5zJPHboHBjkNf8jjRWYL0vJnJrFnEWHRTwuxSrivPbAdJesSacrX6kVcL84iRGp5dY= 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: On Mon, Oct 30, 2023 at 07:41:23PM -0400, Gregory Price wrote: > On Mon, Oct 30, 2023 at 11:22:18PM +0000, Matthew Wilcox wrote: > > On Mon, Oct 30, 2023 at 02:00:05PM -0400, Gregory Price wrote: > > > kpageflags reads page-flags directly from the page, even when the > > > respective flag is only updated on the headpage of a folio. > > > > > > Update bitchecks to use PAGEFLAG() interfaces to check folio for the > > > referenced, dirty, lru, active, and unevictable bits. > > > > But uptodate, writeback and reclaim (amongst others) are also defined > > only on the head page. > > > > Ah yes i was only looking at the things defined w/ PAGEFLAG defines in > page-flags.h. I'll give it full once over can collect them all, my bad. > > (also i forgot to update my commit message) > > Quick question here since i have your attention: any recommendation on > what to do for ONLY_HEAD flags? If the provided page is not the head, > should the flag report 0... or whatever the head says? Thinking about it some more, really almost all flags are per-folio, not per-page. The only exceptions are HWPoison and AnonExclusive. So probably the right way to do this is to make k = folio->flags, and then just change a few places rather than changing all the places that test 'k'.