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) {