From patchwork Sat Jan 14 00:15:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13101751 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 53DE7C54EBE for ; Sat, 14 Jan 2023 00:16:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D82CA8E0005; Fri, 13 Jan 2023 19:16:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D327F8E0001; Fri, 13 Jan 2023 19:16:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF9968E0005; Fri, 13 Jan 2023 19:16:31 -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 AF42E8E0001 for ; Fri, 13 Jan 2023 19:16:31 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8C55E40AB5 for ; Sat, 14 Jan 2023 00:16:31 +0000 (UTC) X-FDA: 80351488182.21.B819334 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf26.hostedemail.com (Postfix) with ESMTP id E4C8C14000C for ; Sat, 14 Jan 2023 00:16:29 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P3XFIbjS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.45 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=1673655390; 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=R11gpIsoLjoJPx/bJDZSX3qFzcN1YPIoVj3Kg++9jRA=; b=XsDKJ+TIjXdnRs25UGB3WXLly8/tt5oQCxIzKszT3UTZ6ugwGkL6hfpUHnl9SpoeP6YANq rYYKBE9Sjrj3YYHJYHRGUc3wqsP+zIhKabvaYiZBTcJdQ5OlEti/06RUPBijDUQI+c4rhI OKV8p7Hu7CbNp3fwKttKYhxgH40GLyI= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P3XFIbjS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673655390; a=rsa-sha256; cv=none; b=m6GYdiFemTdpAOg/M2sBe161WRKWQGeZwpkVDK9ZCbl2TXdvfVLw5WEcIEhZGDwXfdnXmB iwTqP2yoOsY2l7bzrXk9t2Pf74cmcKWRE67DRtVTshqiUMYfTD+wgJh4PffetoKMrsUWDz I2jT6aDkvBVQdsjxcZ0mlIhLGA5jaQk= Received: by mail-pj1-f45.google.com with SMTP id u1-20020a17090a450100b0022936a63a21so2070053pjg.4 for ; Fri, 13 Jan 2023 16:16:29 -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=R11gpIsoLjoJPx/bJDZSX3qFzcN1YPIoVj3Kg++9jRA=; b=P3XFIbjS9O2iFLNHs9KwE1VQ8werQuyrNARUhLmH0lCVNRZJ2rk7sgZT+Zn/CV3aO9 n8NosQbbujPD1yTLzY2UtT/orCnuHWy7JhAv4QCSPiGNheHs2ZNcWCweXjNj0NCFqodH Xz2SipLoimvA1UTBTssbm8XWZ8xtLfiLHZwIdk9wyWIUkEEnyVwoQOahZlGWgFgcbv1v vdMyCUandgKkyl6eDOY3ntLLrn6MzeGGOX03JuITzAcChJZuNGQh9FnQ05DZoIPVVoeT fH3iJEksq5Dz+dM+HeaMJPuXGVstuBYeICD8N7ANsSkrBqLXmgyUzhVmF9vR2+cf6V9N DOKQ== 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=R11gpIsoLjoJPx/bJDZSX3qFzcN1YPIoVj3Kg++9jRA=; b=SJseBR1Rn0e30+zkS3zgRd8gvNKMTQ3E74YNwVpiv/KvrTiNourRN1cKaii3itp614 7sPyb7zTPqWjY2MiQWW8PAZtC2Cuge58E4uZFbliwMOtru4BKR5Ae0aHRpHX1ZXXixdB fi3Raq7iPyX+gBSE3uOOWQPwlPfTfKULvkVO5/daen4azdaQSO+pru3p7faP496rcbCl zUes2N1Ipr/ifV37QjZW16rUMX3/Hol6wzCiQbaAJoLi8sQ6HmM5ZblgUkDU0o+pbWdx BR6pUzLPkrIdndiKpeb6fM42SEODfZBhUCVyls58aVLHNjt7TFC4Zwot0PGryKVCKrMO AGbA== X-Gm-Message-State: AFqh2kqns76maKc7iUIS7EoE2Vetwhk+Gh68XUVHJ+iGZyM/hemWcV1B 5b/femZstNGsx7Z00PfF9TbJ+vQ3DwU= X-Google-Smtp-Source: AMrXdXuuoqgSVenxCxLXxH+0fhWynqRedNaei9TXcehDD/NR+Z5Pd9hEF7ldxqIfPwbvyTb/zrcE3g== X-Received: by 2002:a05:6a20:43a2:b0:b6:71f6:a4c0 with SMTP id i34-20020a056a2043a200b000b671f6a4c0mr9808650pzl.1.1673655388607; Fri, 13 Jan 2023 16:16:28 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2e58]) by smtp.googlemail.com with ESMTPSA id nl5-20020a17090b384500b0020b21019086sm4064541pjb.3.2023.01.13.16.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 16:16:28 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, "Vishal Moola (Oracle)" Subject: [PATCH 2/2] mm/khugepaged: Convert release_pte_pages() to use folios Date: Fri, 13 Jan 2023 16:15:56 -0800 Message-Id: <20230114001556.43795-2-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230114001556.43795-1-vishal.moola@gmail.com> References: <20230114001556.43795-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E4C8C14000C X-Stat-Signature: m4smtdrg9zqnpgubdoehywxsbsqhbdoe X-HE-Tag: 1673655389-667194 X-HE-Meta: U2FsdGVkX1/nr8vYWKxRtuflEO2+cZgI6wnOJNuJqMali+pB9itX4B7Cp5wkF7ZlTkRPLgmhaIYAno4nzEqIifRwkZEwJdsWzmkKwCKYM2Dgr5qEshCenCdA61Q+wUFu0IRr70tavY2HVEPF3BYT84rcSy0dj7+9eqGmv+vxWwgvNnwkRfWC+y7FdfAw80MmJ1FG+OUEDv2602flu068w8kteAYuRkWNY19FrOdHeIE040M2sknY+M8EqMoOPX5sNAT71UIVgpyw0BeO/BgSBgrvC6THI8VwMSkW86tRhTdlrfiQic0zgOMpvg8zJ0xGcI7XdbUSSkHkcB9jUXKdSiFD0J61FhLC02keCU+G+i7ha0PnNhL9WyRyyTiEsZajbmilBI2qdjbzurGeZXqhCAThflu4y3zQsk2GQi1ItpCx8F+dtsj7Fkr03sLLWSg8tMMw/JcMLxxAT/SuOc6ZuUdaQnO6+1bsI+hojHVWATmOlAwomMRfWrqCwhq0U46L7tDpN0vKf1VG1n3TqqEI4Wj5uixvlqAgducWdpMZX47u4LzrkLIqlQuXoqYJSClGnuKw6AIyeXtgcDlPW5IiV19N19+YU4YjMidjGTrpXCUIHTbYnipY5YRmEp3jDAWRuZGbTzdqc+1hNElcLoTkdYcGUhoQSVXV8AISgc9hPYi4zQXSuxq+i3yEaIHB8DCW3lQGXtuO7pjiQ83Cr40O7IAn2NahVCjzYYnZWaaOLFi+nI0KGDUT0ekjj9eR9Cob5Kktj089xIxzgtZoEQNg2HA8btpV75l76dbRpBXweBM0K2NwgC/Dh77HgETr5Sgnlm4fZMRHb5MXCqMUl+q8fMSDCVvT4cS0z6n2u5l5LHSFE6/q4lLYtlmCaDsbuBHQS8uwHYEooJ7YWcDws+NtljeligW22nYPNqHad2nzDm+2n4N5xkhkNgXMxAA6b5qozDDBqR6347NkmjeLyri /alKvdDu TK/x7koX1mc5Fmm4FFPnjLu3ktViSN1201gj4JMODJiPc0u5GThMK6JH46Z0Ire5LJjP01+F4Avh+GP69GrTgAY2zxR/qVI79C870mdXBaVOwHN53bwfAzUyKztjwD3oGAlJnp98ZmCXbDs8bLAycTv0PcqZtYWJvnvH2cickTtTJysPUOV4f/WtU5xyKcTGqeWShRxyqjZieJzMdYdnxtFuP6uYyQjayh3N+qXFd7fkku7CDArmcrwv6qnN73/oWwTQFCaQnwiKXkkY3yWXcEX0Pkw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000296, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Converts release_pte_pages() to use folios instead of pages. Signed-off-by: Vishal Moola (Oracle) --- mm/khugepaged.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 4888e8688401..27d010431ece 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -509,20 +509,20 @@ static void release_pte_page(struct page *page) static void release_pte_pages(pte_t *pte, pte_t *_pte, struct list_head *compound_pagelist) { - struct page *page, *tmp; + struct folio *folio, *tmp; while (--_pte >= pte) { pte_t pteval = *_pte; - page = pte_page(pteval); + folio = pfn_folio(pte_pfn(pteval)); if (!pte_none(pteval) && !is_zero_pfn(pte_pfn(pteval)) && - !PageCompound(page)) - release_pte_page(page); + !folio_test_large(folio)) + release_pte_folio(folio); } - list_for_each_entry_safe(page, tmp, compound_pagelist, lru) { - list_del(&page->lru); - release_pte_page(page); + list_for_each_entry_safe(folio, tmp, compound_pagelist, lru) { + list_del(&folio->lru); + release_pte_folio(folio); } }