Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp152046rwb; Wed, 18 Jan 2023 15:37:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXtfcule9uPOnIkRwUCjYpHuHgQS4L7EUT7YHV0fuvIVsbS0xx69liQiU1lsN8nY2J3j8Ye5 X-Received: by 2002:a17:906:2288:b0:872:23b8:d6ed with SMTP id p8-20020a170906228800b0087223b8d6edmr9073659eja.20.1674085063102; Wed, 18 Jan 2023 15:37:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674085063; cv=none; d=google.com; s=arc-20160816; b=O+SyDIc6nWa7eUdy/YnYT8khXj7Slk3FUXhaCG5+kirytt/TtXxeEExPAdViBqMMmZ g6CixKP9RgdEwS3SjRGsKG5wAcUK/cDfutGMfwchHt6F7orbuL+s+Gf4BkXViJrreC9g FdvrvclORe5RVxpJaazA1wSsWaEAp3pAgj3COcSupBfEhTcaMROdULthzQc44zW3T/UN Mi/Z7qhDRhSwXP3eb3hT4DMs8bbnEDBF+2F6dAo+zN2FbQsOOfB8aeOaBSxm6iOg6ccY 7oLnIav4Mn3Z6CemZQeC4m3MwY37WVxGbET9w8nVIuG2wJmqJG9hbITJEQSlRJk3zscS 1ppA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sR1JcCUA9O2Vny3R+G4SUtwxLVo8Eke3dTYifmkKbTA=; b=OpBCuni3YuzE8VOcqdZzvaiVEc7O0/DqlCUJ8wzTr27QKwYHW+QJ78GRURI/fb5RIK dHV6IoTvTfUnbH6G1WKrWr3zSb1t5UD1XkQpoMq0YM0m+rMIo+7AWlEln3tkcW/lbQkd Lw4e8+wMGJgE91dHdZ5HhrO6v0Ht1vvBB7HBobCNBwaU3NWCXFpVUQ6fJG3R/eb+dXir qPbKgwNDMHFm6W2T8Ql4YGAOo0TtC5vXy9rqwmEk95bUAsqAUQwVcLsl1z9MLIQV7xuj iUnpM8+V0ka6kOoyx/WgBWWkUPnb3tfHpSZh+tM4mI8qWau98FGPUTE4wdfq9dc0AcG8 VROQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VLVGj2Me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr2-20020a170906d54200b0087774636885si411028ejc.932.2023.01.18.15.37.30; Wed, 18 Jan 2023 15:37:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VLVGj2Me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbjARXWh (ORCPT + 44 others); Wed, 18 Jan 2023 18:22:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjARXW0 (ORCPT ); Wed, 18 Jan 2023 18:22:26 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCE2666EF7 for ; Wed, 18 Jan 2023 15:22:25 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id y1so664224plb.2 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=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=4fGmfZs/CpCoWtEkc4D1jzPOblbckwDIOVabvTgDdm27Yck97Gx/en+SUfGZ5rOVDj bFfSaYnCV7nogRUw/MICWSj0HOHENJ71uAziAOzANZZEWsAuWW1NOJFjYvoaaVYWEV7u Z2VYnPmmkDXyoYykPhwIGkNBlBpHPGg3eBtBqmRG/Tv7ZPFfzGvo0E9x3cpC+OGbHkkx TzMzKvHe91ILsGK4zG3Z7jjN1/FGKi/gx0q1pQ3ZZKBzlDlPw0bbYuvkX3ryn6W34noT nl/DWpKdsmDoFlhevBTtSY9A2pEpvsCzXYFOD4xkyrNhQDii3LkaXEGw+/o+twurh8Mh vR2A== X-Gm-Message-State: AFqh2kqRDmVgZPWPbGv8fiLTWeEOwn0kZFQdo1DMoaJgphIwV33u3cH2 wqVY6V1XaQJhLfrDAAjrGqw= 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, }; -- 2.38.1