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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8A75C25B48 for ; Thu, 26 Oct 2023 20:00:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231532AbjJZUAZ (ORCPT ); Thu, 26 Oct 2023 16:00:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjJZUAW (ORCPT ); Thu, 26 Oct 2023 16:00:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30900B9 for ; Thu, 26 Oct 2023 13:00:20 -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=RvOXwandeVYtdokqifAIU5QghzlMJsS3czqYn7Psq7E=; b=kRfJ/TcxIaEyeZwdVqfX4UvqrI aY2pRl9eiyXEJrUSsDRRXOn2/hlT7BCsqe/TLrJjdQPqdBafYpuuPJupOgHXFH341YSRFk7j072K1 6zFUdJwNjVCMZiYM+gYrsqMq2K1ukBOiz9ddpwwpI8g+oQ7g9H2HC62bi1bobZctV8YqZfkLzx58R wdJbaeGZAcx2MRd4Hhy2ClAHNIyRoUM5+j7G1QuYmOX0u5DPDeKJ9DubQl+lYHEwsDjy40bt8JJvC 5nPJ22TU/FNOR1xCxGoYKY0vzpahOetj5K68dWUe3qFpip3B3bRJX34JS2+B/KladbvQSwcLngDz6 lK917kEA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qw6WX-00GtAR-D5; Thu, 26 Oct 2023 20:00:09 +0000 Date: Thu, 26 Oct 2023 21:00:09 +0100 From: Matthew Wilcox To: Gregory Price Cc: linux-mm@kvack.org, akpm@linux-foundation.org, david@redhat.com, vbabka@suse.cz, naoya.horiguchi@linux.dev, linux-kernel@vger.kernel.org, Gregory Price Subject: Re: [PATCH] kpageflags: respect folio head-page flag placement Message-ID: References: <20231025201237.948993-1-gregory.price@memverge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231025201237.948993-1-gregory.price@memverge.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 25, 2023 at 04:12:37PM -0400, Gregory Price wrote: > +++ b/fs/proc/page.c > @@ -188,20 +188,31 @@ u64 stable_page_flags(struct page *page) > u |= 1 << KPF_SLAB; > > u |= kpf_copy_bit(k, KPF_ERROR, PG_error); > - u |= kpf_copy_bit(k, KPF_DIRTY, PG_dirty); > + > + if (PageDirty(page)) > + u |= 1 << KPF_DIRTY; This is not the way to do it. At the beginning of the function, add: struct folio *folio = page_folio(page); Then use folio_test_XXX istead of PageXXX().