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 C3C88C4332F for ; Mon, 30 Oct 2023 23:22:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230499AbjJ3XWg (ORCPT ); Mon, 30 Oct 2023 19:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjJ3XWe (ORCPT ); Mon, 30 Oct 2023 19:22:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2311EFC for ; Mon, 30 Oct 2023 16:22:32 -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=vgtwIpOv7aynDs/c0Cteoh8B8jUiQYzWQhTbABw5QcA=; b=QFHqbbyRP7IuQ01xPhrltBwja/ wGRj5o0MMuBo1SVwbo3Id+jGqP5JjzAGevnCCM7dqgNQshaYbCYpxvekqm/SuXvTEcDBALcxC2XlU bedNmzolHcFiKC3RW5jIUdr94BkrB60btm8Gr+o1UuYqmj2JUJd1CdVpRTUSh+3prLQ/mCgwgXCYk /0wAuhiN7DSPP1SaQAny8pEQVWWjTG5UlurnS0MerTNx9UZITxxrsZIRYHCX7fR2J+43udgqowujI OzILe30wwaH0NxueJNBfyskdx43rVw9DBn+1EkNKWomkCI3s7V1ro2BooPL0DBV37SQSD7OyuVy8y pmRq6oTg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qxbaM-006ren-HB; Mon, 30 Oct 2023 23:22:18 +0000 Date: Mon, 30 Oct 2023 23:22:18 +0000 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 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: <20231030180005.2046-1-gregory.price@memverge.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > u |= kpf_copy_bit(k, KPF_UPTODATE, PG_uptodate); > u |= kpf_copy_bit(k, KPF_WRITEBACK, PG_writeback); > > u |= kpf_copy_bit(k, KPF_RECLAIM, PG_reclaim); > > if (PageSwapCache(page)) > u |= 1 << KPF_SWAPCACHE; > u |= kpf_copy_bit(k, KPF_SWAPBACKED, PG_swapbacked); > > u |= kpf_copy_bit(k, KPF_MLOCKED, PG_mlocked);