From patchwork Wed Jan 18 23:22:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13107186 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 55B2DC38147 for ; Wed, 18 Jan 2023 23:22:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 934516B0073; Wed, 18 Jan 2023 18:22:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 86CDE6B0074; Wed, 18 Jan 2023 18:22:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7340A6B0075; Wed, 18 Jan 2023 18:22:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 66E776B0073 for ; Wed, 18 Jan 2023 18:22:26 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3FEEC4011D for ; Wed, 18 Jan 2023 23:22:26 +0000 (UTC) X-FDA: 80369495892.02.A94E76A Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf02.hostedemail.com (Postfix) with ESMTP id 9C2E080014 for ; Wed, 18 Jan 2023 23:22:24 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eTYkEu4Q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674084144; 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:in-reply-to:references:references:dkim-signature; bh=1khdYzxT7PMCcz7jBx9VZXJLxnPij2EE71ujrUVxn1A=; b=eqOkCPml5kLy9MKs0eQqeveAA7JccbMMg/0hsuzzSIWCE+C1n64Y1tMNf3CmYed7YigGhO oGJ6RgM6bGPRv6ytk1ZVQ+FNG+3414+gUrOk0WnnLWebh+YiIxvMEbzZakZ93Z8EvHz56d TqZBICiUXaBHxetH9bBAe4I8R8ig2rs= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eTYkEu4Q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674084144; a=rsa-sha256; cv=none; b=m0g7UommH9z9IITnBncdoafqxJAKR6rtnbddR/EGMt0iJH4PLGd2EDVuKwpVODCXq9WJBF Ydwbk0ua+Dni5GVTJ14F7HehvKGhj6FOSUFjTTTsf0XWNaB6d4R9HvoKWF8xiIbVZKuPBf K0VXnvweQ5riuWQVjtBU+Gm1dDA+PVo= Received: by mail-pj1-f44.google.com with SMTP id s13-20020a17090a6e4d00b0022900843652so4107969pjm.1 for ; Wed, 18 Jan 2023 15:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1khdYzxT7PMCcz7jBx9VZXJLxnPij2EE71ujrUVxn1A=; b=eTYkEu4QWiTBpQ5PZ5ETHC6H9jjOL0AHY/mzZ+lFwdXVq1tuyLj8P3E8ewR+ImEgsN 2TKG+AYru0iFaf87vE/NcBHoRFaodj4Cq/jO5AHvjoFqicU95rVV+VCC4PEuK3cHjvzh GjJUtXwEbNPzRonxhAuHRRefgnS3GM3lnAbWbhZ0bjiRhRr1StSYxWesqcLL3iyignAo xGR7WE0QCGspcGOhpDXTO5lEolH12G/ONF8MoJTL+ZgQYmk/leR/bKANIOXBEaVBQt4W PiCDTuIL4Pqm+pTmwGQHbdrrM88Tmo/SToVqmP6+kV/l6w5fewFqt4VNShrV0AO2A3XS TJlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1khdYzxT7PMCcz7jBx9VZXJLxnPij2EE71ujrUVxn1A=; b=KoEDps7zP4hm3ClGf7Zo5FyroZn7FM7o8rMrwyg5vztofJ9gjey0d4xQV4BRhb8TBG sm13tLlIVwzmvuS6YGeo+599zf2AOLmz81YIvvgcWHuaoaV8U49RKbw9+TsmYa2U1mC3 UZ7yqFJiEWUxdmQHPrm3DKRVIUyAk1c7fPBPT33vtwHlBe75Zl2IQXYGI8OtrCTLaHyD bHwI//1QuxSFGFvYCJkTeHO0IyWdEgEnqr2jvCkrLyLma2XlhJ5CPLITTwOU8YAmUBok TQPccjbdGyYirHWZmRvA1BfSO8NHAzK5bNNL/WTeJzdn3RHRXxpvu+4oz1KfUAyYlVRb zRug== X-Gm-Message-State: AFqh2kpCHUE/xXfoDgrFyMY/6xkfBIsfn0gIjhrxiXdcGcg+7+UdruMh P4smf4MjDx+cGbnEaL1ofXzgZQUvdGI= X-Google-Smtp-Source: AMrXdXtOVaWZzLBo+o2TAej0yzsAKCSW+StQtUR8ucQfseE7GI7WjiYyBcPXOLDxSbj/hQ/ZHy51tQ== X-Received: by 2002:a17:90a:d188:b0:227:e22:4a85 with SMTP id fu8-20020a17090ad18800b002270e224a85mr9314629pjb.9.1674084143365; Wed, 18 Jan 2023 15:22:23 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::4e4b]) by smtp.googlemail.com with ESMTPSA id k1-20020a17090a7f0100b00223f495dc28sm1862265pjl.14.2023.01.18.15.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 15:22:23 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH mm-unstable 1/5] mm/mempolicy: Convert queue_pages_pmd() to queue_folios_pmd() Date: Wed, 18 Jan 2023 15:22:15 -0800 Message-Id: <20230118232219.27038-2-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230118232219.27038-1-vishal.moola@gmail.com> References: <20230118232219.27038-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9C2E080014 X-Stat-Signature: oztpx167f4k39z94acejgjxd49uddop4 X-HE-Tag: 1674084144-238947 X-HE-Meta: U2FsdGVkX19yqtMWbSSt8rpAEDNlXpVDG1ZNo84H2woYYmZc7Zt7hsdQw3M9E2lmZab3Q4rgIBFyN5l7PZkI8HT5F/Q67amphUc1fLZr0J5k0Gt13qWE7eOdv6vCpdYwogHefw1IQ/GfpAIBzuvQLlj3A6+epkdXze+x0hacbBi34JUSe0NWjYZkY3zSZinYKt6CuBojY/jEX0O3EIYtPh6eXMEwkvkxUmoBbhGnFgl7Bs4MIJ5qRiBLSe4407/0LMDfxaEToQoEzt0LBOYSvRALVCXDHhraE/KJDYwEBn6xXjbanGo6bnhKUyvDAEI0ecniK9Echd0G3pXS7csYbi4F5JDIQMEpJlUSiB2RQDSyKXPUZjgVz0jubuS0omTcEGnbH95/6atpM8ziKOubyr/ZsxeZeqo9R/uuY2Pji15zDo6fNY6jY0pSOaWyzMDFV+du/kCLyxaXMgmMfVX8PiG30h/wcO7x3Nb9uL9gQnCYRSeXmiSRUFGjNwL2eClnRkP9Ff6IK9QNmdvdHoimJuvbd77XWbWlh9HI70nQfAo/a6fiwfgUz80qeP8aO5eJySxyQC+rBtaTPYzowd5Lg/n+swbd2j1echu7nTq6VpE8FY2ZcDD766PsER1CuRP8dR0JYOVAIjd8PGTPNoDgMqfA1tsHIj5oMXT3ig7uUE1lNuWtZ8K/Fnk6KpXOz9gvLdnBm3gfhZouuEqNrlinLFEQlvmv0Q1HxiYlwr2V2WWJr6Yv30RzyS487jc6XtObT6vEOwqkPh//AnRXsm2mQGM7Y8qH0rHFpjLivOvrmDrNWj3xjwKmygHl37rJ+4FdKwBCtQNys221GMAkIqfa4eM7ajDsVxvw09F8nkpa2j/i82eXt4FvtgzNo4XtO/OuGahtCCCqe2KSmMl6rWLUjywHLR7F/RteOZRvwter4xWPwJPqgg0TVECZaA5aqE2BqmPW6P5im5IAENSPPCY qC3Y6tep +MgH2fYyfXkyv04zmmR1cPoe5xEaYzJDF4XHN1y4raga98CY2oE1hcNdqTIsFqu9jdJwNsiO1Hu1/6Dyv6jWla2grVSyd69PfHnaj1tfS89qvuD6ighx+Ar6gItk+rtmI+OQKEPp6L2vXLLH6OVEswGd99plMxmmIIWwN+a+pp0pdXyFO2TgqeO5DBHhPQhIfAPtq82IGa6n/4IomvAKpl7jF07Amto+r5eX6xD23FswcOJNKRkliLtkHFPE6foT7985PX7MTJI284TD8wvxpxRv0Sw== 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: The function now operates on a folio instead of the page associated with a pmd. This change is in preparation for the conversion of queue_pages_required() to queue_folio_required() and migrate_page_add() to migrate_folio_add(). Signed-off-by: Vishal Moola (Oracle) --- mm/mempolicy.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index fd99d303e34f..00fffa93adae 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -442,21 +442,21 @@ static inline bool queue_pages_required(struct page *page, } /* - * queue_pages_pmd() has three possible return values: - * 0 - pages are placed on the right node or queued successfully, or + * queue_folios_pmd() has three possible return values: + * 0 - folios are placed on the right node or queued successfully, or * special page is met, i.e. huge zero page. - * 1 - there is unmovable page, and MPOL_MF_MOVE* & MPOL_MF_STRICT were + * 1 - there is unmovable folio, and MPOL_MF_MOVE* & MPOL_MF_STRICT were * specified. * -EIO - is migration entry or only MPOL_MF_STRICT was specified and an - * existing page was already on a node that does not follow the + * existing folio was already on a node that does not follow the * policy. */ -static int queue_pages_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr, +static int queue_folios_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr, unsigned long end, struct mm_walk *walk) __releases(ptl) { int ret = 0; - struct page *page; + struct folio *folio; struct queue_pages *qp = walk->private; unsigned long flags; @@ -464,19 +464,19 @@ static int queue_pages_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr, ret = -EIO; goto unlock; } - page = pmd_page(*pmd); - if (is_huge_zero_page(page)) { + folio = pfn_folio(pmd_pfn(*pmd)); + if (is_huge_zero_page(&folio->page)) { walk->action = ACTION_CONTINUE; goto unlock; } - if (!queue_pages_required(page, qp)) + if (!queue_pages_required(&folio->page, qp)) goto unlock; flags = qp->flags; - /* go to thp migration */ + /* go to folio migration */ if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { if (!vma_migratable(walk->vma) || - migrate_page_add(page, qp->pagelist, flags)) { + migrate_page_add(&folio->page, qp->pagelist, flags)) { ret = 1; goto unlock; } @@ -512,7 +512,7 @@ static int queue_pages_pte_range(pmd_t *pmd, unsigned long addr, ptl = pmd_trans_huge_lock(pmd, vma); if (ptl) - return queue_pages_pmd(pmd, ptl, addr, end, walk); + return queue_folios_pmd(pmd, ptl, addr, end, walk); if (pmd_trans_unstable(pmd)) return 0; From patchwork Wed Jan 18 23:22:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13107187 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 430E5C677F1 for ; Wed, 18 Jan 2023 23:22:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CDB696B0078; Wed, 18 Jan 2023 18:22:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C63FC6B007B; Wed, 18 Jan 2023 18:22:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADE836B007E; Wed, 18 Jan 2023 18:22:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 973376B007B for ; Wed, 18 Jan 2023 18:22:28 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6ADC9C017C for ; Wed, 18 Jan 2023 23:22:28 +0000 (UTC) X-FDA: 80369495976.22.1D92157 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf01.hostedemail.com (Postfix) with ESMTP id BEAB840015 for ; Wed, 18 Jan 2023 23:22:25 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=plLzrfqu; spf=pass (imf01.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674084145; a=rsa-sha256; cv=none; b=I417ciixKSelxbeeizqDszEnq8M3rdMeHDL9FHOr0owWCzLg9C8BemHI9YxiVfZ6mWW9pe pcx34JinLm98tQQlivosjL4yAjcAZE4vOF9wis1oSkRISZdN9Yv1B24cmgrFz6aCMT2AvZ wOtKavh1sy2L7e0sBfdLNFEhjertr1w= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=plLzrfqu; spf=pass (imf01.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674084145; 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:in-reply-to:references:references:dkim-signature; bh=8vZic6jN1vVBvksvwJz1xQpCGfyGjrm+SSW90x/iIgk=; b=U8AI5gqx7ICpEKY6QbBQDbgy8XV8VUaKW7OptEPeLEzpnfbpVOSodvUgT+7+S7wj3sBgmE fnyTN+9884F6GC0OnCnN4Jv+Pl1OSikupTwueuD/UmsMMabfbQY41DVUB1xF84poRuqq02 bYgAAJfbH2+2a6hEWbmpjEUUwDsGGMQ= Received: by mail-pl1-f173.google.com with SMTP id p24so616083plw.11 for ; Wed, 18 Jan 2023 15:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8vZic6jN1vVBvksvwJz1xQpCGfyGjrm+SSW90x/iIgk=; b=plLzrfqug0qycgZKzYJ6RHpBxvkpRXgY6TLreuwWkAlzfkSQlhcW8SQF4rL8+JBxTE 4W7xSaKb6YDytsbat4R3kDWOJnP7jL6b0O2dLvzFim8Csq+j+fa+RieFjmkR5514FIFM n/++JQD/VGUUrwitWCDh6Jkj0razxFRTPNaYbd4hLxUTRmYk2Qi8OzhBq2HxrFAJffT0 HIPUzvNZXNQHj/gGr7gtVk4DfzG3EHegoOQRgqwm6udpoYGhF+IshP70rfO8DoS+uYPx XYsr8em2yN/N62hb7RydrBF04dPqVuP04femkqre4+xnKeH8L7MNyIFeShxXS3a2R7Y5 X35Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8vZic6jN1vVBvksvwJz1xQpCGfyGjrm+SSW90x/iIgk=; b=2bn0riRkCslXJpaIO7a62iBCoIgXuIPJ1aZS9t3At/sSJFXMroUE1oV5xqff5yhlXh wFHQDrf65ndATQKOeL741OU/8uRzPv3PQGdsmBmlr5jz2GkxmQt/Lo4nGcUg5HwLFQma agdq/YAacMLsFeZ5hnEZJOicgE9TnmUJX4UVTO+1OOM9blHTB3Ru/yd96Yo0oeLwPTyW OQuerkFz94/lf9jC1ulSH2q22Tq+MP2pXHQZE1gILDB6To4uUerNAhYtsv9KwNbXPXDv 4Ubv3u8aPlMn4t7Za2sibJ6Bpi3zgyfGBcl3fS66fvoQg7cZM2m/iMm3mGmlOPGe9skO JzBg== X-Gm-Message-State: AFqh2konMvqMy5uTBzaLbyKorljBmUGTh9p11CtWz7I9GOhwZ/JDIuP/ ga2t1lGD+9n0j0xnF3p0ykxXqPI0DeM= X-Google-Smtp-Source: AMrXdXvEjyCVC/4TVwOh1+YdAemnNYpOML8teEekvwuoZvNygTzqcIdTkYbXe+Ux0NiePnfI3ZFfNw== X-Received: by 2002:a17:90a:f606:b0:228:f6cc:dc4f with SMTP id bw6-20020a17090af60600b00228f6ccdc4fmr9191489pjb.10.1674084144399; Wed, 18 Jan 2023 15:22:24 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::4e4b]) by smtp.googlemail.com with ESMTPSA id k1-20020a17090a7f0100b00223f495dc28sm1862265pjl.14.2023.01.18.15.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 15:22:24 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH mm-unstable 2/5] mm/mempolicy: Convert queue_pages_pte_range() to queue_folios_pte_range() Date: Wed, 18 Jan 2023 15:22:16 -0800 Message-Id: <20230118232219.27038-3-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230118232219.27038-1-vishal.moola@gmail.com> References: <20230118232219.27038-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: BEAB840015 X-Rspamd-Server: rspam01 X-Stat-Signature: t46ibhr6jmyhdh96ey7g358nwih7e7t3 X-HE-Tag: 1674084145-317853 X-HE-Meta: U2FsdGVkX1+RwfnINOU+GB2mdQQpL3UJRrGZIUnE1ZjuP31/I74xBlT9N7buKWLoObGMEhm16wzOBv6iqv/E0lxjdXJmvmLl2Ou1Mexp7lQGG/T8Sx099w7j030FyVcFw2xfUKpq8//fijxV8S8mMiIlzWq0NURxVEpk72SICgCQBN9Egxb3vsgQa6EM3syMKphEQYPsVHUlBcRpmLyqRhrNOl2IceHAih97Szt8wXeUzju9mshmO2gHScwppjXfu5QVLlT4l30A83ZSjwloJ5OPkg0O0a/NO5UonCWvoSRqjRtCsGlzaVp4UchLRlrQTEjGIopaNwzpkB0VyI9wXI2otgHTeg5BCr8PxgQ7eqj1Rp1aut5X+Xl7QQqAS/ztUroFYDLsxnlQ2nya/GjtAxSiLManqsWNqFwp63s38E7IY0i2hSgp23wPeLowaapezIoYJ4tgi8/N8g0VJ2M0YHhuK0v982MXe9/7mXr+XE9skvNlAYM+ekfInN20hBzFV3AfYkGuc1VctiMpeEBpg+MsWPcPu2+DkcnKYhYcXm+Uy58KmDzB6rWtNQo3ycsYr/+stvTN12MufIXily6lXttPL4HHJYVxoBXrb6KW810qPvKxSxLmGMnVkIXbxik4Db/VCI6l7z1GvM9nQ5SdxgytOBTGgHjmzzno77Opbf1rIWWdnDdVEyLJIk7gsfgJiFT+PhtzA1ykNvyIZg6mmBPLcJcTiAlreq2ID1UiRXtjE2hjFFm9RX4JHGbyb7k7U78H+2xIV4A3RYos9gnQV1wKUcQFlFsLUA4p4RwhTHgkipjPa1t1oNZ6noxQ7JewbaZfHsGw9T/Mlq+0x5czv8xMzopWWRKg7p3AYOo2AC2AVPubLgbJb3O2l0HQS9vIUnOcfCGPkhwC++Go4wV43NWOKUebqPiTtzCYZpuixHceTeOGSPbsV+1886DD8YwcEgHPvV+0PX8ZVi4kxZp 5Q7FpG6R e4Ysd/rZbLjIzCaSi07Hu+/2m3Haa23li55QiShJE+AOnSHcTvwPnkCl5FNdDOz7K3qJ3n0Ips3bN2XpmosTn6sDrFEEstS90hUmuimdn8wUFi/LTwK1i2mCgzhnp7zibw/WOYYxvvItj4uaj1TAdjiKRjraiM9naSvDq3OhSMI4plCFaYg1MuASjCSO/0a5pSLsHZ1y/onzNbeC8BZJGChkBiGYEFREl239Hi6YoZXODxipuDK2CdSDzCLslwDO+BlYNss+oVESEByD9mcs4UhFvTw== 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: This function now operates on folios associated with ptes instead of pages. This change is in preparation for the conversion of queue_pages_required() to queue_folio_required() and migrate_page_add() to migrate_folio_add(). Signed-off-by: Vishal Moola (Oracle) --- mm/mempolicy.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 00fffa93adae..ae9d16124f45 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -491,19 +491,19 @@ static int queue_folios_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr, * Scan through pages checking if pages follow certain conditions, * and move them to the pagelist if they do. * - * queue_pages_pte_range() has three possible return values: - * 0 - pages are placed on the right node or queued successfully, or + * queue_folios_pte_range() has three possible return values: + * 0 - folios are placed on the right node or queued successfully, or * special page is met, i.e. zero page. - * 1 - there is unmovable page, and MPOL_MF_MOVE* & MPOL_MF_STRICT were + * 1 - there is unmovable folio, and MPOL_MF_MOVE* & MPOL_MF_STRICT were * specified. - * -EIO - only MPOL_MF_STRICT was specified and an existing page was already + * -EIO - only MPOL_MF_STRICT was specified and an existing folio was already * on a node that does not follow the policy. */ -static int queue_pages_pte_range(pmd_t *pmd, unsigned long addr, +static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { struct vm_area_struct *vma = walk->vma; - struct page *page; + struct folio *folio; struct queue_pages *qp = walk->private; unsigned long flags = qp->flags; bool has_unmovable = false; @@ -521,16 +521,16 @@ static int queue_pages_pte_range(pmd_t *pmd, unsigned long addr, for (; addr != end; pte++, addr += PAGE_SIZE) { if (!pte_present(*pte)) continue; - page = vm_normal_page(vma, addr, *pte); - if (!page || is_zone_device_page(page)) + folio = vm_normal_folio(vma, addr, *pte); + if (!folio || folio_is_zone_device(folio)) continue; /* - * vm_normal_page() filters out zero pages, but there might - * still be PageReserved pages to skip, perhaps in a VDSO. + * vm_normal_folio() filters out zero pages, but there might + * still be reserved folios to skip, perhaps in a VDSO. */ - if (PageReserved(page)) + if (folio_test_reserved(folio)) continue; - if (!queue_pages_required(page, qp)) + if (!queue_pages_required(&folio->page, qp)) continue; if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { /* MPOL_MF_STRICT must be specified if we get here */ @@ -544,7 +544,7 @@ static int queue_pages_pte_range(pmd_t *pmd, unsigned long addr, * temporary off LRU pages in the range. Still * need migrate other LRU pages. */ - if (migrate_page_add(page, qp->pagelist, flags)) + if (migrate_page_add(&folio->page, qp->pagelist, flags)) has_unmovable = true; } else break; @@ -703,7 +703,7 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end, static const struct mm_walk_ops queue_pages_walk_ops = { .hugetlb_entry = queue_pages_hugetlb, - .pmd_entry = queue_pages_pte_range, + .pmd_entry = queue_folios_pte_range, .test_walk = queue_pages_test_walk, }; From patchwork Wed Jan 18 23:22:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13107188 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 B0F33C32793 for ; Wed, 18 Jan 2023 23:22:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F37CD6B007B; Wed, 18 Jan 2023 18:22:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EB03F6B0080; Wed, 18 Jan 2023 18:22:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7A606B007D; Wed, 18 Jan 2023 18:22:28 -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 8B6726B0078 for ; Wed, 18 Jan 2023 18:22:28 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4D82E1601E5 for ; Wed, 18 Jan 2023 23:22:28 +0000 (UTC) X-FDA: 80369495976.14.D79595E Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf07.hostedemail.com (Postfix) with ESMTP id 9D0CD40021 for ; Wed, 18 Jan 2023 23:22:26 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VLVGj2Me; spf=pass (imf07.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674084146; 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:in-reply-to:references:references:dkim-signature; bh=sR1JcCUA9O2Vny3R+G4SUtwxLVo8Eke3dTYifmkKbTA=; b=x6ZHM7Dz1ei2SF8RWNrU44BiLMXpWISBzoe6nfKmzzWd2j3iY9Ht5KNtjSSHG3wKCLlUdc 5bOgt5YRrEGqwHUgwwRRqk1nAHCcm4PuUpCBFbY5QBS5xKMxkb2u48bDPomdgF4kwyi7kD 7udCVfenpLS0nLF+QZ1b7QUkiMB0ZbQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VLVGj2Me; spf=pass (imf07.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674084146; a=rsa-sha256; cv=none; b=O+WLAb93olh5rhW8/YsjBnfqsqUK11p+zZUlapnyegwDcY6boGAZInfPfT9GzVXn38A2e5 rQOU0PAOk4qO+5AkiOlQYoyjzycakJjGBk0r5H42lK5fSMGb+eNTcP2rAEXZ/+Mg35u0ac zYmQ1davaYjmqV3uu59/oODC71PIQPw= Received: by mail-pl1-f178.google.com with SMTP id z13so643135plg.6 for ; Wed, 18 Jan 2023 15:22:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sR1JcCUA9O2Vny3R+G4SUtwxLVo8Eke3dTYifmkKbTA=; b=VLVGj2MeNhV4dG8tqMCOaUdWWZUjRbL/wzXS2nrU9rMdcdiWoHupAjfnkS2LZ1UIzY EIrqU/eNtw167F98QPa+DlF0ttEz6P6jzss97ZHeMD+Mnp+0o17cR9id+VKeOvQQTo3U yCYIeFH96KTFdJyLdWHN+Y55hcNZwYOVh0olOR9/ydyvrvK3SrD7Ds/NSW1Z0mk/pf2m RhJSpm+Ca0ZYRz9opt+TrOTf+OIbRsYV0dxpzVQLYDESUfHLZoFpRJy20nXvMeS7rqRO tTccJ45EBAGYT0CVJTr0FvUCBeU7cNfdMTbnxr39qIXoSZB1IxqhH3nzHofdm80Ce5K8 EJsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sR1JcCUA9O2Vny3R+G4SUtwxLVo8Eke3dTYifmkKbTA=; b=YENwxsNzV3juzkL/jBN0ck3ei4sUHUizDmrmBMb6jkd19c11F83BtYDvbLQhZYlTjX eBjjSFfjMrRTHz6d81KjDhlHOYKmjEqUmPFF4NSw+1QfOw6m0j5EjUTHdRpbKEcI2xyt KI/tJ6hA9+gemeCYdL6tCI8uJJTibCKOrljKwRxfM2kCCIOPr3xLvAgBUqWi6tEorggI JppGIJhCTy6TyCMUVaWSao3AvOreEL3R3g0b+uGFhqTheGzWVJmHYt2tLsO2EhP2PlAE B22ZSX9S+BcPp8MGfzDoKHtjT2J5OaP+OdDwCzbThcLK0Kv33aO1sO9QmT1RLUPpiOIF 4dag== X-Gm-Message-State: AFqh2ko+TFS27a73X0hClnubc0g9MdfWqfj4jL79iZJk4F7+MG1QV8Nq yhRQIw9Rg2jJmHacIJypu3HAO7pkITY= X-Google-Smtp-Source: AMrXdXt0ENl5WIQO0+QtroAVNydcvggXodDzKiNp1GCI+BCD3n+pIqAhLtX5Ca38kf6D0ROrCrVurA== X-Received: by 2002:a17:90a:2dce:b0:229:4a04:65eb with SMTP id q14-20020a17090a2dce00b002294a0465ebmr9156656pjm.31.1674084145299; Wed, 18 Jan 2023 15:22:25 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::4e4b]) by smtp.googlemail.com with ESMTPSA id k1-20020a17090a7f0100b00223f495dc28sm1862265pjl.14.2023.01.18.15.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 15:22:25 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH mm-unstable 3/5] mm/mempolicy: Convert queue_pages_hugetlb() to queue_folios_hugetlb() Date: Wed, 18 Jan 2023 15:22:17 -0800 Message-Id: <20230118232219.27038-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230118232219.27038-1-vishal.moola@gmail.com> References: <20230118232219.27038-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9D0CD40021 X-Stat-Signature: 44pij6iuonb4f7ejy3sto9rhs6pw3bw4 X-Rspam-User: X-HE-Tag: 1674084146-197815 X-HE-Meta: U2FsdGVkX19VPBwNpD6YtVTC/O9f4Mis2zxhUCPHkcDeL3UGgDnlWmBj3vcELBN9LLTpRVMqkl+JoiST4xtlg1aEn9w8fu2l0x7CRWDTFweq1dIGZFvGMopDmtB7gpNtIB4v+xwtqZExy6/lHAfsV+vYy/M928OdU9T5U0nTsENoX6OEPOtAKGDTQeHK7TRad5sc5PIiakcw7cjXlXEUX04w7B9mEAaTAgbjJQqJX1kmcv2Ztb/E1+pc+L3LKMt+mv85/17uV77XyY3O+/WqzlpgUpejRarlxKGHMSN8uS64qzKATYOpq7nARz99hvwObcP8zbTQzC2HwfkUNtcYdm/juVVCWEI+ZD4SxeccmQsvNvznIVvIR1UplkOeULmy5fvq2x4uFPsFwdjjV18tHXTrBlcARQpYhlgQdYJobOxOXmWXY+UB/QujnegiMsfLPgsqFrFbQrFEf+utu3fPuKcwXFHVu7CYjKB7wLJLfvglqSoxyyl8/CdlfycGFiGNxarns2DjeO2tYUdvueNeTGa7Wp2Snml7OJ3BAJDMNg47mpBqrz/dIqvOLXH/VaqhmD7rvfhbb44Y4FbWNJugYtkMj2vc273UvMhOoVPU5Kg36GKoq+53tIIcz1q+STliBPB3ssTAOhT/TxHAeqft6TqusnHPRL8oZsK/KhXgZXQ/dwBzHMM+j8Xr+l1M6qxEhvUhMumvMY8olefeINhjenbT0+BeP1ctM93zW0FlF+fhDk7OFhCMhxqzJE70ANxnEHuPRRddG5tUtjaDxsDbWFtoNnEtSkANRwRpDNH3me743EwNlGIkjP1TQAOXQS81fhjQJ83MPaGlCpJdy4Eh6eAqY24El4KeugvSGyPvwTr6udKOl+CC8e1YCTFAFy6CvRd+uIMyBTucg6lfnsG2utQfx7v+z0YqR3HmgSW6W5tQbfZkzEaSHr6qAIiL7eyNc3KmwM0BvQJZJGcX33A jc+Yo8KL t1LNCNGkNSVQeOxtT3Sl+8uUd8mUNTHfDBy497JNcQCo8KqQkNRBdA8k0ubPgh+qYuiPNAYQZrAYAYkmljtrsbUmdZXI2uNcDKPYim1jySd8LZ6EkV1pwvn7IfRPgnXwZB1xv4vExe9tmMAGBdi5m3M99JPz09+aQNHgC0q9IboVfDkjrebJN1Tp0XfkpmAIHZrsR6P9f8YVoO4Qesd3bTLe9mVJX8hQfmdInKdabOXJRcpd4pFD7iQMdAouJwlfACOPh/9lRVGs2gvY64sKR6/113Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This change is in preparation for the conversion of queue_pages_required() to queue_folio_required() and migrate_page_add() to migrate_folio_add(). Signed-off-by: Vishal Moola (Oracle) --- mm/mempolicy.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index ae9d16124f45..0b82f8159541 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -558,7 +558,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr, return addr != end ? -EIO : 0; } -static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, +static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask, unsigned long addr, unsigned long end, struct mm_walk *walk) { @@ -566,7 +566,7 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, #ifdef CONFIG_HUGETLB_PAGE struct queue_pages *qp = walk->private; unsigned long flags = (qp->flags & MPOL_MF_VALID); - struct page *page; + struct folio *folio; spinlock_t *ptl; pte_t entry; @@ -574,13 +574,13 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, entry = huge_ptep_get(pte); if (!pte_present(entry)) goto unlock; - page = pte_page(entry); - if (!queue_pages_required(page, qp)) + folio = pfn_folio(pte_pfn(entry)); + if (!queue_pages_required(&folio->page, qp)) goto unlock; if (flags == MPOL_MF_STRICT) { /* - * STRICT alone means only detecting misplaced page and no + * STRICT alone means only detecting misplaced folio and no * need to further check other vma. */ ret = -EIO; @@ -591,7 +591,7 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, /* * Must be STRICT with MOVE*, otherwise .test_walk() have * stopped walking current vma. - * Detecting misplaced page but allow migrating pages which + * Detecting misplaced folio but allow migrating folios which * have been queued. */ ret = 1; @@ -600,11 +600,11 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, /* With MPOL_MF_MOVE, we migrate only unshared hugepage. */ if (flags & (MPOL_MF_MOVE_ALL) || - (flags & MPOL_MF_MOVE && page_mapcount(page) == 1)) { - if (isolate_hugetlb(page_folio(page), qp->pagelist) && + (flags & MPOL_MF_MOVE && folio_mapcount(folio) == 1)) { + if (isolate_hugetlb(folio, qp->pagelist) && (flags & MPOL_MF_STRICT)) /* - * Failed to isolate page but allow migrating pages + * Failed to isolate folio but allow migrating folios * which have been queued. */ ret = 1; @@ -702,7 +702,7 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end, } static const struct mm_walk_ops queue_pages_walk_ops = { - .hugetlb_entry = queue_pages_hugetlb, + .hugetlb_entry = queue_folios_hugetlb, .pmd_entry = queue_folios_pte_range, .test_walk = queue_pages_test_walk, }; From patchwork Wed Jan 18 23:22:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13107189 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 778D3C38159 for ; Wed, 18 Jan 2023 23:22:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B07D46B007D; Wed, 18 Jan 2023 18:22:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A913D6B007E; Wed, 18 Jan 2023 18:22:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BAD26B0080; Wed, 18 Jan 2023 18:22:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6D8256B007D for ; Wed, 18 Jan 2023 18:22:29 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4435E160C9C for ; Wed, 18 Jan 2023 23:22:29 +0000 (UTC) X-FDA: 80369496018.12.EB0361F Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf19.hostedemail.com (Postfix) with ESMTP id 9788A1A0006 for ; Wed, 18 Jan 2023 23:22:27 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OpFvnNuB; spf=pass (imf19.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674084147; 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:in-reply-to:references:references:dkim-signature; bh=au6G63hab9343OwjwQffrlqu0KPUTVvJhczlUez6ZjA=; b=gcOv3XscMzMad1LBFEuIMpZVlKziOxhdrN7iUJ6LALj7FSkWEMosRECKjFgI95TTaSYQfl oTh0SRnoMpGrXTFnfer7GAJpOcHYDRBHzFUQiszXxiuIVPBnDwk7+r33Va/RA3f3AC6xIu lZELa3h6DsWuefrVJ0Ym/GCGvSksKK4= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OpFvnNuB; spf=pass (imf19.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674084147; a=rsa-sha256; cv=none; b=lFR/YQQCJH26s/yD2y22HbkyLPd5CsF/A2Hz5ha3ee4/ZjBNVu8H9h3Ik/3eINXqgsrWVN t3cIfcJXtL/1yCY/fe8CHh5oWHbCqd36hMEc6KDgi8CauWi1tTfq0b3brYdk15Ty3sSLQS N+X89l8KA3fHa2mtvY7LAneSebaYFu0= Received: by mail-pj1-f53.google.com with SMTP id z9-20020a17090a468900b00226b6e7aeeaso142767pjf.1 for ; Wed, 18 Jan 2023 15:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=au6G63hab9343OwjwQffrlqu0KPUTVvJhczlUez6ZjA=; b=OpFvnNuBiURxuCLUuAX8gclebbcqS8tU6zG6zpK3Jg1ecyC6h3uLBzssNc1S9jHDHd 1KSwYCTy5G+mPdu5exzax5tjqlvSskyGaPQSz2bLj5cGgUwau+nGTJtUhKx3c49NjoQy 6GUqiA5ZMVqONluZBos2f4nk1GfO3iyRvN2BF6x2yt/bmDXB0HwztZcRcSZyiOq5rUtD hKmIpBI6UMGAta00Do7k5jjp5fbulHwkyARQBQXZlvhSh89iQcmRKh/lII9hc2hT7cQH YLp5ofBrxBLqctMsPDWQSaIABWdHl3KtCfopPF77zlY8V5mGSpD2ZgaD5AduVb1iIvjd tM+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=au6G63hab9343OwjwQffrlqu0KPUTVvJhczlUez6ZjA=; b=FM362kJjof0eGgGmbUxx2N237Oec8vBQLfHzZAYO8TEpuAnzOW50sV+skN7QLfcvwg CO2Sio1OrzFFllamWGxf+cDb90yd4QDNFXd5y2zNGZCYXSQNGg+4/9oOJ3ksU0js6UY1 c041r2Jnqu2wXqZdPaQjEloonaoKTxwlWTi2PBPHq4fjxSLT1zfyEHWiiLgVAUrLiu+c SQYS15tJ5X0q6Xc8Fk7Y4aHrRteYBt4W0EC7BrZ9it0RYKLsZ3HywZoyMOJm7AH5TB4g ETDECv+G4qhODNYEr3Wyw3Onq3qgWtJFsYc8nwIG7O/PZWU+pddpyITJRz2X/Q0VQk+H 3r0g== X-Gm-Message-State: AFqh2kqxD9n4of0/dDYVV0V83ACut8MO9dbwyKQrSup6PAhn01u/T8/V EpV80M9GIUGNa/j5ytzevcpLnkqet28= X-Google-Smtp-Source: AMrXdXtYJDKTLcIyyRdhdUAe0qzWWeGZAf+3g+OYbwB8HsvEU4ytSVpzypPZ2UghsoSvMOCw1+1M+Q== X-Received: by 2002:a17:90a:e647:b0:229:5b13:d850 with SMTP id ep7-20020a17090ae64700b002295b13d850mr8776893pjb.5.1674084146362; Wed, 18 Jan 2023 15:22:26 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::4e4b]) by smtp.googlemail.com with ESMTPSA id k1-20020a17090a7f0100b00223f495dc28sm1862265pjl.14.2023.01.18.15.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 15:22:26 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH mm-unstable 4/5] mm/mempolicy: Convert queue_pages_required() to queue_folio_required() Date: Wed, 18 Jan 2023 15:22:18 -0800 Message-Id: <20230118232219.27038-5-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230118232219.27038-1-vishal.moola@gmail.com> References: <20230118232219.27038-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9788A1A0006 X-Stat-Signature: ih58u9qn6uhji66ubrsaxjpc6gyma7zh X-HE-Tag: 1674084147-529689 X-HE-Meta: U2FsdGVkX1+1wk3FXQW5XOcE1omptb+3mcz5IpOou3Ecz/DKz6t1ltlyHPLp7AI3sfqM86tGxIYrqA6CxQIbAhmhU5Gt9pPKPWtXXeJdep/PlLj/A0ZmfQBysDhV09bWpT8cU5JEtevMWJvDFXwHpMLsjFjpu6pcUL2aGw2vTuI8wYLKp8sJAW2XkGNHnzmAR4tN8smeefk42q1hzhNdmM+Yx6YE8KCh5dXVMsVtOM63QbD7C2HRgoVh22Rt6GD2AU8dtAzFNhduKGaEUYI+k+CQI1wQM7OAdziXsx0r+e32komCIeNiovhLXrudUl0opdFVD1gH/UEl+F2u1C2C1EUjR6JjLx0lyM8jPTYp6CRUNpAKfcjyP3EaJSB/qDIXtWzRMNu4EV0tHO+MEdeud0h2eDJ7ww5WqONV4xSXGhmQYnwJRc/UuTfDOctlyrhsAvfSkU2L8Nk5c4DsYESN0pnpid2N5uHsseFHRrKHB6lyW+gb+xvoYFmKNbdKqC89iqlkn/5AFq0T6Ev+hto8sESsFXYDZcR/31Zvn6UyQ42T8tNPqWqZuAJzPg+gsq5fRyrwWOebgRxWBJ5peS37tSp5MY7G6msxYfVr5YjA0J+x1TJYitca46Wb+IWlR+s9oj2RoS1P2WDPoD9DWcG0pEXfxsbae5PnIExKBgAd8tsVvtdrn7Y0bvivPJHWr1i6hEDPC4nDspAqV17ZgTsVaQq6VukAjTNK+EOQXIfb7xSCjLgtX61SoSMm+4TKtuGTUgqy+0mwzYIBbYMgF/gKa66MdeZNfuxU0oozrn665gmQwf4CNVwikq9xf1zUTwOQUrnEKepH3pqgZgUSFrsyF5SI/+T0BFeuIImASwZdUbWueIb6JXoUvdoYs33pRFqY+kR3vh/NgRvUco9KhMXqBVVh77C3LoE/xN67HNFNlKjsh14tjvbUP/zXiZSwb1l0gXkFIJ42UmE3+Dcl9Sz yXB18YdS 2GhKxSQefJh2ujN62NEoUX0Izw3OO4tc3RkdZxnNCHu43+2AVvXbXlq/1snAKeIKVlpmZbqV30GCjQBWG3VdCt3UcsmpUbdmJNM5DSTW7tpnrik08by0prgRweyxqYozVf2a7Yvo1RKD8Q/jqbaYd6vpiEDZGIyB2BMPUMc6ePULwzBqcaNmM+FACrYdgj9GUcgXNtz4+Q69fiWSYFgVIp4IRKGnSTLaP36/ph+4y1jXjMF+lCC0mk030AsNkssullZZOoeDhSgbsTk9Z2hdTT3HAOA== 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: Replace queue_pages_required() with queue_folio_required(). queue_folio_required() does the same as queue_pages_required(), except takes in a folio instead of a page. Signed-off-by: Vishal Moola (Oracle) --- mm/mempolicy.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 0b82f8159541..0a3690ecab7d 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -427,15 +427,15 @@ struct queue_pages { }; /* - * Check if the page's nid is in qp->nmask. + * Check if the folio's nid is in qp->nmask. * * If MPOL_MF_INVERT is set in qp->flags, check if the nid is * in the invert of qp->nmask. */ -static inline bool queue_pages_required(struct page *page, +static inline bool queue_folio_required(struct folio *folio, struct queue_pages *qp) { - int nid = page_to_nid(page); + int nid = folio_nid(folio); unsigned long flags = qp->flags; return node_isset(nid, *qp->nmask) == !(flags & MPOL_MF_INVERT); @@ -469,7 +469,7 @@ static int queue_folios_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr, walk->action = ACTION_CONTINUE; goto unlock; } - if (!queue_pages_required(&folio->page, qp)) + if (!queue_folio_required(folio, qp)) goto unlock; flags = qp->flags; @@ -530,7 +530,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr, */ if (folio_test_reserved(folio)) continue; - if (!queue_pages_required(&folio->page, qp)) + if (!queue_folio_required(folio, qp)) continue; if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { /* MPOL_MF_STRICT must be specified if we get here */ @@ -575,7 +575,7 @@ static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask, if (!pte_present(entry)) goto unlock; folio = pfn_folio(pte_pfn(entry)); - if (!queue_pages_required(&folio->page, qp)) + if (!queue_folio_required(folio, qp)) goto unlock; if (flags == MPOL_MF_STRICT) { From patchwork Wed Jan 18 23:22:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13107190 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 0A86AC32793 for ; Wed, 18 Jan 2023 23:22:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EDA366B007E; Wed, 18 Jan 2023 18:22:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E63396B0080; Wed, 18 Jan 2023 18:22:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDB476B0081; Wed, 18 Jan 2023 18:22:30 -0500 (EST) 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 B8E5C6B007E for ; Wed, 18 Jan 2023 18:22:30 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8A9074029E for ; Wed, 18 Jan 2023 23:22:30 +0000 (UTC) X-FDA: 80369496060.01.9F78755 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf13.hostedemail.com (Postfix) with ESMTP id B7F362000B for ; Wed, 18 Jan 2023 23:22:28 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lR6rKoh2; spf=pass (imf13.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674084148; 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:in-reply-to:references:references:dkim-signature; bh=AyaiUqa6uxGoekyzThZMenGPL9hncRzPR7deDY3LNSw=; b=c3e2aRu6Q/jDV23/56Jc5kwDk74y3h4380MSV+CiLPlhFbn72ElxOCnEnOetoeORO13BL+ sXgCU9gc00dKjTJbCbXsxstvopNIOhOm0ECcgekD4ix56+Rk+Imn1kcgPdanQy9wMsRpNi Cxm8pE/i4BXB0L804hDeYCtYz+9T63Y= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lR6rKoh2; spf=pass (imf13.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674084148; a=rsa-sha256; cv=none; b=N8ghhXuMJQpG3K7m+QFP7+Zbh0ZGG9ZjNLPTJ2WsZmCssQmxsOEJ8vNh/S1EW2by9n7Kue 2PL0csi7BdYCijc4yqAgpbBAHzFQ90apA+QE9Yzi2ARu20mK1fOeVFFxMGpIwM7B27eAil WkBA1ohtNk+qSRwcspoJtJJi26RSZQc= Received: by mail-pj1-f48.google.com with SMTP id gz9-20020a17090b0ec900b002290bda1b07so2794299pjb.1 for ; Wed, 18 Jan 2023 15:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AyaiUqa6uxGoekyzThZMenGPL9hncRzPR7deDY3LNSw=; b=lR6rKoh2RFGVgliV98r5mNThqsblkwbahtu0j3cOy5zj+Wzs0dviXjd2xpwYFy2b/s FygjQje2As8gfiTv9IpoYviItU5IfXF3C+GHMqEG1TIChBHPivgqi6vwtmYerHkKtLg7 Wor81yJRBNys/MDCgjcgoFKMBZc6oqepM5BPCSw5FKbe5xpLw6HtkAKD/ZCxElxGwXq/ E7IuAIb85nTgV+Zl0fknCajTg5E6lgdimAdfDfa1GyuBlO703HbOwVSZiZ1bBuRQaOo+ 40WaxHk5Ci8dNgUiqHOfu4PLfvBSxBin0LQbgice19D3oERHCz3XPGmgoPf+Xd0BQzLs xjcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AyaiUqa6uxGoekyzThZMenGPL9hncRzPR7deDY3LNSw=; b=KvHOct9ct6AqKGFGrsn1f/WCvrn2PKKRDpHiYYEDAlfJztAYo9Ng239hCyl0I2rQU7 L8g3GRkFfY5G65TfD91RF9Vn+Nmio9uGpBxm6HMu+ajt74AIWUw2ikWrE8Thyk+EJAc3 4YQu3WazBexy4uK67fp0EQu8+lPLGEE2UsIZA/qQ1JzZIMUd2kHa/HqJTR8LpqzLD0ta lzCA4gvbA/0OAaHYUiXINxTv/aHAUrQQQopHYeDP4YJYvPthj2PrxyLdphlkEWot0V3c THoWzBTY+B9IT5RjaQ8vUCmSxgAqG9/sWjM0lWEQEv1hOq+A/NHYgiuiCY0V6fz99D32 5C7w== X-Gm-Message-State: AFqh2krF5c0h6FVwOdfbM2f6Kh5DgHMxMmXsvyVfGCEd5NkTAJ2Es7LW 6Pgb/DbaV1MhWBjxu0XyVwm/p4vtrxU= X-Google-Smtp-Source: AMrXdXuNC0wSbEBnfwY4tpq5Uzm/p/V4ipRKGX+mC0Iiyh8LXHRGagSW26Bf2QUBFcOVAY6JVMfNOA== X-Received: by 2002:a17:90a:ea86:b0:229:9369:e13 with SMTP id h6-20020a17090aea8600b0022993690e13mr8927376pjz.36.1674084147437; Wed, 18 Jan 2023 15:22:27 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::4e4b]) by smtp.googlemail.com with ESMTPSA id k1-20020a17090a7f0100b00223f495dc28sm1862265pjl.14.2023.01.18.15.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 15:22:27 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH mm-unstable 5/5] mm/mempolicy: Convert migrate_page_add() to migrate_folio_add() Date: Wed, 18 Jan 2023 15:22:19 -0800 Message-Id: <20230118232219.27038-6-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230118232219.27038-1-vishal.moola@gmail.com> References: <20230118232219.27038-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Stat-Signature: m3cz4bz8k1dgtobj1echjhix5ydr9ch5 X-Rspam-User: X-Rspamd-Queue-Id: B7F362000B X-Rspamd-Server: rspam06 X-HE-Tag: 1674084148-769948 X-HE-Meta: U2FsdGVkX1+8+YZOLAT+p+iacvdaOpNxxDgJVp3y5W9vGrYKV3KJcojpZoPl1qdSHfWB2jyT0gKh7TBEqmjKBW/9sjeKHkaLsIOaxOG+FpoIkHq5zqBnpdzklSD8JuwnG1W7n4Pl2et3oLHEVPH8G4H8mP/WNNK73pdLczjqgaPfX/+oQRluGFYISuCZOfvGBjKVFH7VsckYzHNejzL2vvXcyomG5zGAzH124f1KluUbKpVkdVVJi4q+P4ZrfdumSrBcGb0QRR74l1hZpmcf8NlaUV5U17lex9xQ4zhZ3aUeiShC6CkU833gM40Pl6Pyj4Nur3eBRlROzjYFZtQd3t7s7FpMQA5/+ThUsRB6ZD9HuihQWehx08wJ9DnLdNqkCW4ua6OFp/2pbbSX2Zqc7GCySGAf+3wu09ZDqjMyL3QtaTH2/v73PZpgdOpQcq8jLH7UdYDv8UutMw+z6Jz8vtxnNjWLK09hNIGoCDD4iBdvfhkKVN5v4IJN9YKwSQzshFXDU2+0CPnbDs4lNw4yXGf30ydbh2snGM6AjYqFl6RdCAA1Tx/xYjI5rTo90+TwnjcTe07fK8x/Lfgu++tI23yZeECK9gASYlGc2W9W23LnIC5XzIOxUaP79hbTo5tz44q9V/mPCfQEqDSzN/qwSrDQDliu6qXImdkldaTbgvkK3toxvYyGW95bv+SW1dIjRa9avA3AN206hQZoNrve/sB1uPy36g9CCUYrnvwiActsxx7EMSYAToNmEMqzFiZbRMnvmbxQNAKj5dSEZbFJSe62dy5/+9/H0PkL/Hyz6RCy+fxSF4XDVto0VEOnESWI5KaLOccVXOEnQBPCEShRg5V+Yszqxl0eDELWhyZpYf013xiFSEg1oCG6iSyjQwVFekeaOflAjLuEYM1AoprFb2hD42VNrxS47nLWUbLlR4nMOg23RSGmvZgCXMrNwkb63ow8y5VsIq/stL9OL6Y h9hLLzLJ 2VFx0Crk4mriLWLl7wBhcvF8BZpfQEnJVYezqdWkgB/nJbT0MUEyvWEjiSvXj1jdtQqbsAa+4lQGhApTHbnWqk8aoz0rmMVBj/DSEvN6mlqpmNTOq9eCT+5ReQJEK3u8Gv1PxB16SvXP4d8KZy3VDbySN9hgX4o0dLAzdqUqDiHg6y7ERQKq0cEHOZl+GDwyfK0WXq41uDCkTQE9s6tLgSbEEyMCnIdBwsSQmh55nxCyHklwCoBG4fsI0EDJQWbU45QOMXiVziFLrtr4lZ5ovb73bwg== 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: Replace migrate_page_add() with migrate_folio_add(). migrate_folio_add() does the same a migrate_page_add() but takes in a folio instead of a page. This removes a couple of calls to compound_head(). Signed-off-by: Vishal Moola (Oracle) --- mm/mempolicy.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 0a3690ecab7d..253ce368cf16 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -414,7 +414,7 @@ static const struct mempolicy_operations mpol_ops[MPOL_MAX] = { }, }; -static int migrate_page_add(struct page *page, struct list_head *pagelist, +static int migrate_folio_add(struct folio *folio, struct list_head *foliolist, unsigned long flags); struct queue_pages { @@ -476,7 +476,7 @@ static int queue_folios_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr, /* go to folio migration */ if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { if (!vma_migratable(walk->vma) || - migrate_page_add(&folio->page, qp->pagelist, flags)) { + migrate_folio_add(folio, qp->pagelist, flags)) { ret = 1; goto unlock; } @@ -544,7 +544,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr, * temporary off LRU pages in the range. Still * need migrate other LRU pages. */ - if (migrate_page_add(&folio->page, qp->pagelist, flags)) + if (migrate_folio_add(folio, qp->pagelist, flags)) has_unmovable = true; } else break; @@ -1022,27 +1022,23 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, } #ifdef CONFIG_MIGRATION -/* - * page migration, thp tail pages can be passed. - */ -static int migrate_page_add(struct page *page, struct list_head *pagelist, +static int migrate_folio_add(struct folio *folio, struct list_head *foliolist, unsigned long flags) { - struct page *head = compound_head(page); /* - * Avoid migrating a page that is shared with others. + * Avoid migrating a folio that is shared with others. */ - if ((flags & MPOL_MF_MOVE_ALL) || page_mapcount(head) == 1) { - if (!isolate_lru_page(head)) { - list_add_tail(&head->lru, pagelist); - mod_node_page_state(page_pgdat(head), - NR_ISOLATED_ANON + page_is_file_lru(head), - thp_nr_pages(head)); + if ((flags & MPOL_MF_MOVE_ALL) || folio_mapcount(folio) == 1) { + if (!folio_isolate_lru(folio)) { + list_add_tail(&folio->lru, foliolist); + node_stat_mod_folio(folio, + NR_ISOLATED_ANON + folio_is_file_lru(folio), + folio_nr_pages(folio)); } else if (flags & MPOL_MF_STRICT) { /* - * Non-movable page may reach here. And, there may be - * temporary off LRU pages or non-LRU movable pages. - * Treat them as unmovable pages since they can't be + * Non-movable folio may reach here. And, there may be + * temporary off LRU folios or non-LRU movable folios. + * Treat them as unmovable folios since they can't be * isolated, so they can't be moved at the moment. It * should return -EIO for this case too. */ @@ -1234,7 +1230,7 @@ static struct page *new_page(struct page *page, unsigned long start) } #else -static int migrate_page_add(struct page *page, struct list_head *pagelist, +static int migrate_folio_add(struct folio *folio, struct list_head *foliolist, unsigned long flags) { return -EIO;