From patchwork Thu Jun 10 06:34:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12311937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E29E3C47094 for ; Thu, 10 Jun 2021 06:34:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 59A29613CA for ; Thu, 10 Jun 2021 06:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59A29613CA Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C62CC6B0036; Thu, 10 Jun 2021 02:34:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C12FB6B006E; Thu, 10 Jun 2021 02:34:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB4216B0070; Thu, 10 Jun 2021 02:34:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 7B9256B0036 for ; Thu, 10 Jun 2021 02:34:44 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 087738249980 for ; Thu, 10 Jun 2021 06:34:44 +0000 (UTC) X-FDA: 78236850888.01.5BAFDE2 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf28.hostedemail.com (Postfix) with ESMTP id 348102001086 for ; Thu, 10 Jun 2021 06:34:39 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id k4so26344024qkd.0 for ; Wed, 09 Jun 2021 23:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=pGCwo0otsY+1TNpTEy0P02naUBtXpTOD+IdeOTLcTwE=; b=lhPqqonl51gMi2Y5qmIjfHtlL9DeApoXuasczVJ23S+iGW2PmFNNYItqWpfLH7MhZ4 tVUlRtMBckVtYWTfO4DQfuc6RAOI7KFG6ogHzngJvwQfijIa0reDXsTc5nFZ85mfHrtc tTIp3DP5ZAdekIFoTHFbqzZHtD/3BeHN/SwIg5s5jF0lrhMnpRyHAV8ndVZPwr7+MFzl D/VqCz4s5wU4VpJQvp8gp6PmoM8o014bXIulyrzJaseBUHPQCbeU0DU/yhbSWW3BpGNL O/n3mhNqbCzVYV7fx3t6RLDhmfHZ0ATmPxZBeFcJ8tMbU8zN6fU0BOtmvkk2oYTpTiCi o2Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=pGCwo0otsY+1TNpTEy0P02naUBtXpTOD+IdeOTLcTwE=; b=SYlrsPkoiEfThh61QUHbE4+bTWbGpR8XhZYlKkclpJ8QmQ9PyP8u3t7uL1nzTODa+X FphyhzGC/4e5aEjjEiACNDAwSnkBy49nJnR0RGZyY7PSOnmeCCt07TTn2lFe+rShBxFd wNLhiNkElns7m0U4YJ88/bd0CGSGKKDlbSgLVk7nEd8VZROtzqJW8D+OkXD0C+2G+KXt L4/55d8GFQUKsv93enjDMYnThgfU+UMNZXvENhYGGdGFbYgFRlNq76dfW5+mqgtPMOR1 VygUzEoW0nwn0ORcdebQWcGx/GhlwRQH8xmMQL53NoAhVbHTVELhoyvbWAU7vvVMsyFM YyLA== X-Gm-Message-State: AOAM531JBuEDteuM1+glM4q0yr7GaOSRQ3CdPzLB4hWbrZ88MQruACAk Y67dGZDhJZIZn8SN43dPVDVZrA== X-Google-Smtp-Source: ABdhPJx795mENXThcbrSF3SFHQ7mxH7leIj6hOSzSyIIAiXcTG/9Yj4OerHKB8IVGGrOX291lJY05Q== X-Received: by 2002:a37:438d:: with SMTP id q135mr3166885qka.478.1623306882954; Wed, 09 Jun 2021 23:34:42 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id b2sm1692660qkd.1.2021.06.09.23.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 23:34:42 -0700 (PDT) Date: Wed, 9 Jun 2021 23:34:40 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: Hugh Dickins , "Kirill A. Shutemov" , Yang Shi , Wang Yugui , Matthew Wilcox , Alistair Popple , Ralph Campbell , Zi Yan , Peter Xu , Will Deacon , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/11] mm: page_vma_mapped_walk(): use page for pvmw->page In-Reply-To: <589b358c-febc-c88e-d4c2-7834b37fa7bf@google.com> Message-ID: <88e67645-f467-c279-bf5e-af4b5c6b13eb@google.com> References: <589b358c-febc-c88e-d4c2-7834b37fa7bf@google.com> MIME-Version: 1.0 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=lhPqqonl; spf=pass (imf28.hostedemail.com: domain of hughd@google.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 348102001086 X-Stat-Signature: 4g4ea75gpgkb71w176yubhhck5gt8c3t X-HE-Tag: 1623306879-556355 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: page_vma_mapped_walk() cleanup: sometimes the local copy of pvwm->page was used, sometimes pvmw->page itself: use the local copy "page" throughout. Signed-off-by: Hugh Dickins Cc: Reviewed-by: Alistair Popple Acked-by: Kirill A. Shutemov Reviewed-by: Peter Xu --- mm/page_vma_mapped.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index e37bd43904af..a6dbf714ca15 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -156,7 +156,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) if (pvmw->pte) goto next_pte; - if (unlikely(PageHuge(pvmw->page))) { + if (unlikely(PageHuge(page))) { /* when pud is not present, pte will be NULL */ pvmw->pte = huge_pte_offset(mm, pvmw->address, page_size(page)); if (!pvmw->pte) @@ -217,8 +217,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) * cannot return prematurely, while zap_huge_pmd() has * cleared *pmd but not decremented compound_mapcount(). */ - if ((pvmw->flags & PVMW_SYNC) && - PageTransCompound(pvmw->page)) { + if ((pvmw->flags & PVMW_SYNC) && PageTransCompound(page)) { spinlock_t *ptl = pmd_lock(mm, pvmw->pmd); spin_unlock(ptl); @@ -234,9 +233,9 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) return true; next_pte: /* Seek to next pte only makes sense for THP */ - if (!PageTransHuge(pvmw->page) || PageHuge(pvmw->page)) + if (!PageTransHuge(page) || PageHuge(page)) return not_found(pvmw); - end = vma_address_end(pvmw->page, pvmw->vma); + end = vma_address_end(page, pvmw->vma); do { pvmw->address += PAGE_SIZE; if (pvmw->address >= end)