From patchwork Tue Jan 24 01:22:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13113246 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 52E8DC25B50 for ; Tue, 24 Jan 2023 01:22:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 637D96B007B; Mon, 23 Jan 2023 20:22:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 599D86B007D; Mon, 23 Jan 2023 20:22:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4122D6B007E; Mon, 23 Jan 2023 20:22:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2DA086B007B for ; Mon, 23 Jan 2023 20:22:22 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EAFBA1C5EF1 for ; Tue, 24 Jan 2023 01:22:21 +0000 (UTC) X-FDA: 80387942082.22.A4DDC14 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf08.hostedemail.com (Postfix) with ESMTP id 315C816000A for ; Tue, 24 Jan 2023 01:22:19 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ZP/5bObP"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.51 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=1674523340; 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=u2K0b6OXimoYx7XFbk3Zc7Fi8UI+rHcdQrUQ8JIV6kePa0DvfGfate2PHcdNWwcZNPGe3T yMet+gJ3K0k2RWeaiF1BcP2fLFTNYfUciGPC1NgoysRLcJxt1meEf8+Qy+5pyy1LPyy+io fGQvAbDnYgmK1rA8t7+8GUYpETxAJhY= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ZP/5bObP"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674523340; a=rsa-sha256; cv=none; b=rZJRS6/5FzT9gHTp5AjHgg6ILf60ShOkG6SRF9f3Eq9PoVDjfC6YhMNc+/CwIDDC3HaV4v HaeOaREfGu1TOgHnXpudzH/dM/sp+1HgCvX1aR4g4qBNXqik9l+6yoUVlvy86YfCCT4bBp TC6p4FGTkhtoB6JXLEjXYqMYR9206eE= Received: by mail-pj1-f51.google.com with SMTP id k10-20020a17090a590a00b0022ba875a1a4so10007389pji.3 for ; Mon, 23 Jan 2023 17:22:19 -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=ZP/5bObP5pqsvaY9t0h8rIoT9dI9iJBk3mx62rI2nojE2rF17RJDpgzpAJ838bLs/U 6kRuTVVhRzVrpXQBJQ78n2+00oBc8IN+Qr4UmE90EnJV14gUU4AKy9lGkW4u4LtenMm7 nNmyb7o9J1AjOT0Yzvb5W29TbD6D52DH1LSYkfBlcnUV7VBOl5yKEIAG1RBVMFbc663g RLNNMG4tMyd0Qw6zqvgCGsrHo0cHg2hi/rBgbW25Jg1UoelSwenfNsqRSAJzZSPNwYsY HOZe0gaG/lQCzN42ApROK0PrZ8T/HL5yRfeRvFK0HwVF97BGf3YOY1mK9uyGsG2s0OVf zR2g== 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=fmnTZbxdcPHb+gy3IX4W6VqungdpVBHeyolMNkLsy7xUmRkAlxMKtinYlUl20oqh0B +IQQfd3apzBD+jcg9kQHwN6dtmpUXupIgTPV2GzQrh8x6aAsDKnYRbk3eYYVHW2e0LPG MIm33i5CL6e4Q8H2mxAOPXRYNvRursbBTfvs6GrN5ltfZ8Ej1NxAQhti70ehsTojLhRu aKvzsAy4hvnkzNpUJaPp1MH6eQXsh1YDWykR6FmN+7COFzuIY5mozW+9zlag8/1KIC/S +vPM8O1nCww0bJRY3bJSOcU8yNa2eXiwpsIHUAnBYg3fFf81e03TMGfhi4GlwLjiDzbj 0F3g== X-Gm-Message-State: AFqh2kr2j2tccYpylGjIqtoth760ohdiLEYX1r2YHXD/h7dlyEZVwDI8 LER3GrAmzwj6z4BMldUIFYFalwtfQXI= X-Google-Smtp-Source: AMrXdXs0B1T1RoQ7VAB/8nsyU5key1ZZZZtdA3fPrHEjotnA1Vx130RbBWsgiLsAjdttNXdx7IZk6Q== X-Received: by 2002:a05:6a20:4407:b0:b8:66f6:6263 with SMTP id ce7-20020a056a20440700b000b866f66263mr38103651pzb.23.1674523338995; Mon, 23 Jan 2023 17:22:18 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::4e4b]) by smtp.googlemail.com with ESMTPSA id 68-20020a620547000000b005825b8e0540sm213335pff.204.2023.01.23.17.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 17:22:18 -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 v2 5/6] mm/mempolicy: Convert queue_pages_required() to queue_folio_required() Date: Mon, 23 Jan 2023 17:22:09 -0800 Message-Id: <20230124012210.13963-6-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230124012210.13963-1-vishal.moola@gmail.com> References: <20230124012210.13963-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 315C816000A X-Stat-Signature: 3ujnq636rjf9rpjzn9syahr8aurdr8xz X-HE-Tag: 1674523339-317192 X-HE-Meta: U2FsdGVkX1/dvYNV59ZiM7p5v/k4AeCKW3ja5URn+DQZTXJlFT45vYmab+xMczsfvtyyzFgRjZtKA3UEvL9jHFJx0GmWUKyttRi7vNMZc7p580miQ5KP/RA8Ia6Faf95bZqELRAJC60zVG42GPjmNItj2gRg8dnGWlhbLn89Qt4wsJv38m2zZHNgTxT6CPAOm9FV1O/XQqi+Joqd3BTfm26dzrinqecM46uJTnUQ1rsmxQt0mux7sHseSheka/OpIOPEFhUiEQi7UKaMOgkzKGZ3cdEDwSw3rfFCR+eGQK4uQ1si0tfcHlOBoaeoRSry6Oce4Ra+hl4uZktH8DM6pW5F8jFxaD8vwH44s6UfkXM4if0GDbjd9USShiY+TF09cSDIGwi7DAyYvPJjLIXyaK2uT+LNnjGEeff1uYV7kAXonfBDgSe0VdQeSUVrSecEGUsp+tyX5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ur/4bNk6V9VeQi5tO7Sh6WdArH2uAuV7OzsZ9Vrd1Tv4UG3BGQ9ufNHI/8cVtC2wOALObfNjRA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000071, 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) {