Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp341049pxj; Thu, 10 Jun 2021 01:59:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/76tO0ueWgteWt9WHlrc54E+clvLIHvnuUhdR7W8GfTsJVzGWbVK9olx2/q4UHsDiIIGx X-Received: by 2002:a17:906:744:: with SMTP id z4mr3542686ejb.347.1623315578932; Thu, 10 Jun 2021 01:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623315578; cv=none; d=google.com; s=arc-20160816; b=KYSbzSFqY8nDiXYbNbk6kV8gHKaaEgWlS2jiUxFntjAW4GawADBVVCZokvhMYIu+b3 nNgADI//1qmVGBTWotD4oz0bZ5qsr28rCUJ8ApaytULpoSwf7Ei09bBnU5I34gJ0OWXj z35xW3qTg8Ew0DotUn5GLzmQNsk6LUmCz4IaOh1THwua6eIh1EdC7aoLTebcPhNI4n/8 dEwrisu4ZSTptSsNBbzvY1AVzpiKW82FBP7kUxK2wOwZc0NK3QIeM0PeFQCDJznrLR8k 6nl1eFocS2ld/chFbxMrqS3E6q0838lwVBhpQvwOpr0L2H8HjKl5ouERe5MKvzjF/doS /IKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k8HHrhbDqQGirpSdp4ZdVQqESPBnbofSKT7LecLAJ9w=; b=Xr2iBbTBb/577rs9lwHO8S81moBx4BhCMZ/OHmYO5sVGwKe1+1QlqfUPcdtzp58n6Q zyOcn0hwR79lQmIrz6Rcf0hLoH9mUEtx6IzaKvk+fmqYgW/Mlkrq9ynwnqUARrDpu8mU zFz9sQi73ceP6cnSHnKfhmQm2l9zMbjlb+sMgBGNsZV31gzY/EEadK6CilA65127aeA1 yrYWK8G2epT1RLavjrl0IqFyLWenzM+FMjo0ZUZom6EU3gxy8zN3tNUqVW/UXQ4qpdHn Wnel9/b7yH527E7cQvTbQKQkKGdNjKKFZo3fq1DjePIWz3f8Dukw13hjaLsDz98nzo3/ 7UEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=mN3F3DYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt8si1925763ejb.153.2021.06.10.01.59.16; Thu, 10 Jun 2021 01:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=mN3F3DYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230113AbhFJI5Y (ORCPT + 99 others); Thu, 10 Jun 2021 04:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbhFJI5W (ORCPT ); Thu, 10 Jun 2021 04:57:22 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EECDC061574 for ; Thu, 10 Jun 2021 01:55:10 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id a1so1981647lfr.12 for ; Thu, 10 Jun 2021 01:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=k8HHrhbDqQGirpSdp4ZdVQqESPBnbofSKT7LecLAJ9w=; b=mN3F3DYIRqj3v9kvQkuTf5YUM7BDyxusg+h9GvudYAxE2ohZCFPzTyVtLUTz266nMc In45IyTHEvNUDf/hpWrOU8nQtBJ5K4HFD5cgcOUej3vbOoy8knM12+eg3k49f0eaXDzG K4qwXv8cQVkoeCLhoVCeZrlrWQLeAI9KBnwxJy2qNW2FJwI8pPHiEY/029AuKAWJ3Hbk DrxJ9zcPsS2MWznSQ/39WuWdod4rr5FqDIg+8v+YUJPJvE/2YJ1LjtZrcbqESoWXq5k/ 0sOP86BBymiSplwP354vtkU9qylx3ob7x6BD2SudvT/m4CRjnmoMx238oNgvoSU2JR2x AYag== 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=k8HHrhbDqQGirpSdp4ZdVQqESPBnbofSKT7LecLAJ9w=; b=RIzchT5PL0fby+E7BwYfztPp1nYjqcXqHoPPxYZF84N4Ga7rPk+jgQHbISHh7vcMCh bVQlrgT2p0Kxe73GOAT9LW47aQveJbT9SH1F/fe3pWljPq0s+q2YZZJ5fqwuPx2Juxeo H9Qgf+3JLH6EoDru4M67PDQy/nuKDkOvTw1HKO6+mVP31e40JFi/fOvWIvsSjZrSfC0X 77IMJxHhSJpegDEYUWivlNwDCNtRcRbPuWZ3vtPf2mJz/u3Uj8wriQZ+gFjWynvhcSwK FFpNcx+Z5FMgbvFHnVQ5y+QtH3IXHCK0yClSErDYBARiF4fB3/G16kynYWIiXq/lxCWY Zl1g== X-Gm-Message-State: AOAM533mt9IbYFlmq+PLiout2KLP8jSYBNOHBdAkub2nCf3tG0w4nwl0 ivsDWod/NitJKIUlJ7e0eZGmLA== X-Received: by 2002:a19:4949:: with SMTP id l9mr1209925lfj.642.1623315307579; Thu, 10 Jun 2021 01:55:07 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id x19sm255787lfe.270.2021.06.10.01.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 01:55:06 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id BA96D1027EE; Thu, 10 Jun 2021 11:55:22 +0300 (+03) Date: Thu, 10 Jun 2021 11:55:22 +0300 From: "Kirill A. Shutemov" To: Hugh Dickins Cc: Andrew Morton , "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: Re: [PATCH 01/11] mm: page_vma_mapped_walk(): use page for pvmw->page Message-ID: <20210610085522.f5ffyejzn3xtqark@box.shutemov.name> References: <589b358c-febc-c88e-d4c2-7834b37fa7bf@google.com> <88e67645-f467-c279-bf5e-af4b5c6b13eb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88e67645-f467-c279-bf5e-af4b5c6b13eb@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 11:34:40PM -0700, Hugh Dickins wrote: > 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: Acked-by: Kirill A. Shutemov A question below. > --- > 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) I see two more pvmw->page in this loop. Do you leave them here as the code will be rewritten later in the patchset? -- Kirill A. Shutemov