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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 76CC6C49EA5 for ; Thu, 24 Jun 2021 17:56:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD42F613C7 for ; Thu, 24 Jun 2021 17:56:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD42F613C7 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 AB9646B0036; Thu, 24 Jun 2021 13:56:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A42D66B005D; Thu, 24 Jun 2021 13:56:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BBDE6B006C; Thu, 24 Jun 2021 13:56:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 455016B0036 for ; Thu, 24 Jun 2021 13:56:13 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 67C161F343 for ; Thu, 24 Jun 2021 17:56:13 +0000 (UTC) X-FDA: 78289371426.29.EE06BB3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 7A04FE000251 for ; Thu, 24 Jun 2021 17:56:12 +0000 (UTC) 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=+lCWAzHT0zMddatwrqDn8e1lQqfHJedYY57ABfGlHwc=; b=pvK2anu38wzGGJsCrk+UBnBOv3 Cl7PZXe5/ulT2lrl2M4kwSDp13WuLYtoucaCzdDzZhpV7a3KIwfy3qVEykV9+mrj945DQvGayJXWo oA5f0LS78tJ7Q1JsoagwTGyi81ASVgfPyOjhL4KHsXcdFFaa5SzfXU/fVS1jcqNbqfpXz2tWOK3iK FMy0vBVLUhWEQ34w98V1q078Q5d539maXwd4qkKifnEr6yzr6eL5+x8OQ7NZeyObdUrfJLP7cTU3+ kbEyVsyTNCXRKLFS+0LzJxIKtHmwEE9NB2FEiG6EJqZH4Nza6sMYO3KoYhoVuBFDutLENi7hqVFmB ACRrptxg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwTZi-00GqIQ-AO; Thu, 24 Jun 2021 17:55:44 +0000 Date: Thu, 24 Jun 2021 18:55:38 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 19/46] mm/migrate: Add folio_migrate_flags() Message-ID: References: <20210622121551.3398730-1-willy@infradead.org> <20210622121551.3398730-20-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pvK2anu3; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Stat-Signature: jpotazk6w6ic6kcx19umshnt96nu5swd X-Rspamd-Queue-Id: 7A04FE000251 X-Rspamd-Server: rspam06 X-HE-Tag: 1624557372-703510 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: On Wed, Jun 23, 2021 at 10:28:52AM +0200, Christoph Hellwig wrote: > > /* > > * Please do not reorder this without considering how mm/ksm.c's > > * get_ksm_page() depends upon ksm_migrate_page() and PageSwapCache(). > > */ > > - if (PageSwapCache(page)) > > - ClearPageSwapCache(page); > > - ClearPagePrivate(page); > > - set_page_private(page, 0); > > + if (folio_swapcache(folio)) > > + folio_clear_swapcache_flag(folio); > > + folio_clear_private_flag(folio); > > + > > + /* page->private contains hugetlb specific flags */ > > + if (!folio_hugetlb(folio)) > > + folio->private = NULL; > > Ymmm. Dosn't the ->private handling change now? Given that you > added a comment it seems intentional, but I do not understand why > it changes as part of the conversion. Oooh. I was based on linux-next, and Linus asked me to stop doing that. So I rebased on -rc4 (ish), but I inadvertently brought back some of the changes which are currently in mmotm. This one is from: mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page which contains: - set_page_private(page, 0); + + /* page->private contains hugetlb specific flags */ + if (!PageHuge(page)) + set_page_private(page, 0); So, good catch, glad you're reviewing it so closely. I'll fix this up as part of rebasing this patch set on top of 14-rc1. Obviously this second patch set isn't for merging during this merge window, but I do hope it can go into 5.15's merge window. The only API change I intentionally brought back was: mm: memcontrol: remove the pgdata parameter of mem_cgroup_page_lruvec You'll notice that my patches have: +static inline struct lruvec *mem_cgroup_folio_lruvec(struct folio *folio) +{ + return mem_cgroup_page_lruvec(&folio->page, folio_pgdat(folio)); +} where mmotm has: -static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page, - struct pglist_data *pgdat) +static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page) { + pg_data_t *pgdat = page_pgdat(page); Probably I should have cherry-picked those prereq patches into my tree to ease the rebasing (like I did our changes to set_page_dirty), but I'm not 100% confident I'll get all their prereq patches.