From patchwork Wed Jan 25 23:41:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13116414 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 73E3EC54EED for ; Wed, 25 Jan 2023 23:41:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B7F36B0081; Wed, 25 Jan 2023 18:41:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36AEE6B0083; Wed, 25 Jan 2023 18:41:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 146076B0087; Wed, 25 Jan 2023 18:41:54 -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 EEC6C6B0081 for ; Wed, 25 Jan 2023 18:41:53 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id CACD61A0E98 for ; Wed, 25 Jan 2023 23:41:53 +0000 (UTC) X-FDA: 80394946506.12.30C0BC8 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf03.hostedemail.com (Postfix) with ESMTP id 883CE20010 for ; Wed, 25 Jan 2023 23:41:51 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jQrVZxKe; spf=pass (imf03.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.45 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=1674690111; 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=nE+3UuHIJTsmxu1JqArGmSE4JP62IBIElITMZZ15/p0=; b=L2sUtq+hX+uXFvYk2CYq1vit97VjPoeodUH++ULt8XsHkieb9K5rIn2Ds8xVvQPitdJNx3 mdr07DcgA+17YPoYiIhRJbgFuqJkuroKYrg0YY7rzQFSidvvzahgjba4d2BJm/cBCvpoCs BWaG6PgVZFSbL+I2to3/411CAJHxL9A= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jQrVZxKe; spf=pass (imf03.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.45 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=1674690111; a=rsa-sha256; cv=none; b=y/rv2+yyzWYQTb1MwKzXqh+pfTl+64hlqK0OVbhGiw0WfuLThH1BkX52fX9d5UbnD1d/uc X9/++IUQB1yxHcXDdZsqUNMfGL62DpS4AM80VZPZ7VA/xJLknG2140t3DH+IZbjHV5OkJV rhkxxKRkaSEEJfb0SptC72x8vtDoYxA= Received: by mail-pj1-f45.google.com with SMTP id m7-20020a17090a71c700b0022c0c070f2eso3053478pjs.4 for ; Wed, 25 Jan 2023 15:41:51 -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=nE+3UuHIJTsmxu1JqArGmSE4JP62IBIElITMZZ15/p0=; b=jQrVZxKeueZyKOX/9U6abED0nBNMUqF3gG1HIZMoK5tlZcQs9cJ/ODvbcqhthYHpKQ DWBlgZq8Tb2XiUpPQuMtypfYZ9+e6LBX9aHXQkiGdmyvdgULRvOsFnVYvZyBzK93TgON yT+3SjOAyRVIKqC2tyImtBCNxFkufKllds3KVdssuCQ158DP+AUXt5N9a7sXPIwJu0b7 6NUR4WdIza3XMkpwmk7ebXCPL8ZC27KhnroLf9RZKkf8URh1kFoa0wxqKDWcfTalHBmd 5ICDiFBJCDc915aV0MFz6KVHGYDjIaaj6cqBHLkLCcrCG7fiSVT8xzU8d7ZO0yGQVsMP GiWA== 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=nE+3UuHIJTsmxu1JqArGmSE4JP62IBIElITMZZ15/p0=; b=5MgnxI29dbmzsZrO3tsbiJ41E4fKPTVnSNTq38sSubHbq3XhhxIw8f5jW2tzLc0FfW WRYGEVvs5/kjDoOmPLgVnWCuxAvdU17hNLCgqyXJmDpSkRzRxiLCB+Fm8ZrhZIpM4/5R zGyPrBAeXXoMphCMLodkH7VD0nQLx5zwh+diD3MjLSV2tO//zW12QpUgay05F8lRKfTo uHlhDtJ+7g9xIBhNOHx4R6HP7+xAEXRjSE7M/A/IBhi0NmEKB7z1Bgyb7K/vcEaWeyBc uPXUqmFrDo3iFaM9rGyVzgx4Eq2QyZy8My98CaHgJvgxEjtUcKOSHcLa4MlyuFIHiUHh eR0Q== X-Gm-Message-State: AFqh2kpN6afJnzLaomovbns5ksBM365xmwIKrz8pFFkPeEWvA6+AE3lb FGakpXfznb0VmAzVc5WoTIqNJOBwVoTsxw== X-Google-Smtp-Source: AMrXdXv4oLc42hq8XgjfnjjhZaGW0OoALKHESNHJGGGtNWvyj5n5jowOYvkPnWGGVyUX9x1zr7AhOw== X-Received: by 2002:a17:90a:7804:b0:229:912:1340 with SMTP id w4-20020a17090a780400b0022909121340mr34515942pjk.39.1674690110189; Wed, 25 Jan 2023 15:41:50 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::4e4b]) by smtp.googlemail.com with ESMTPSA id e8-20020a17090a630800b00219752c8ea5sm2226806pjj.37.2023.01.25.15.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 15:41:49 -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 v3 5/6] mm/mempolicy: Convert queue_pages_required() to queue_folio_required() Date: Wed, 25 Jan 2023 15:41:33 -0800 Message-Id: <20230125234134.227244-6-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230125234134.227244-1-vishal.moola@gmail.com> References: <20230125234134.227244-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: cs1xuwd5czuugmcqrhfnn9zmuhianexd X-Rspamd-Queue-Id: 883CE20010 X-HE-Tag: 1674690111-499754 X-HE-Meta: U2FsdGVkX1/5vi/YWZ7/tSfiX19KDT0rne1dG4gTxFGh/L0YVgBy+oqPP5QfKqu+7IMqcAzk4+lOCmO/pGIf8LuECg8NEv5pmQorUin2jGfepMJNdzok+JYhpKo0waoUFUOX/V02kknALXLHRGkeZKYStKWu1PH70PJ0dB2z026+zBzMfSwhUSaeWQXz2r1EEv3hzyN3qriB/Xia+ur6LRtm2rdI2UTtoDNkMx4iPrb5jErG8JEUSykiN+y3hDV6iUOvSWL+O+H/5YiYGgJcSJf9MruvrbnFBPpo6JRO92O1IBjpeXrkfUS/QAsqUNmuqhzftmIaBXCeaGpT1K6ODcYhVIPgET0tPWJ+g97vrHf1dALY3Ei5G1sp5iajxu0Io7drP9gk3i/dMTIhe4SPLC6dlGafMMHhpNiqkAD2ktB9jSKrt2Z+n1kKLq/rHFi2xyFjvgGQwyX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R9LiZw5EDgrN50ltInP0VbRevbbVK1wJ9ezH3wruCT3YGuX9nNEshZ6w== 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 ea8cac447e04..da87644430e3 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) {