From patchwork Thu Jun 10 06:31:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12311935 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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 74799C47094 for ; Thu, 10 Jun 2021 06:32:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F3CFF613DE for ; Thu, 10 Jun 2021 06:32:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3CFF613DE 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 6C05E6B0036; Thu, 10 Jun 2021 02:32:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 670986B006E; Thu, 10 Jun 2021 02:32:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F53E6B0070; Thu, 10 Jun 2021 02:32:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id 18B646B0036 for ; Thu, 10 Jun 2021 02:32:15 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9E62C180AD81D for ; Thu, 10 Jun 2021 06:32:13 +0000 (UTC) X-FDA: 78236844546.32.080A77F Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf21.hostedemail.com (Postfix) with ESMTP id EE847E000261 for ; Thu, 10 Jun 2021 06:32:06 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id k4so26339187qkd.0 for ; Wed, 09 Jun 2021 23:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version; bh=rKU7oZHObUw3YMoE26/u+eyLTV4/DZf9d0MBH5vOABo=; b=F0gpvRmNqTdYXTGMccw4P8InnlhpGqbHzsWVgdNwC2ILxTgCRe8L+d5SCQnIpv6Xgs ffMgTUPESnj+FTlrSZjfGOvHOSfdqy/fqDOobLDEQ9S4aCjGyw9Za+2bndFM7dBrKAVo oMXwNbPN/TaUiB8jrv6F0eNw2WzBAL3S22H+a7sdLBeTlsdW/V7TT0W/hguQwZJnTdbH FFH/B3oMZVvHMaRNnsQfs1JvmR0a/BaYGIYCEsJDdtHXXivcDpiUgS7d3XAwudZkPgI9 +YaQgSiaSAh9/RZbqW6OuFSit7nUutF7EnmeDa/WKzdQ+lW2b1cfXjTXITtk8oVegGAM fP1A== 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:mime-version; bh=rKU7oZHObUw3YMoE26/u+eyLTV4/DZf9d0MBH5vOABo=; b=aFSw1A+w8EwQFvjXozPLW/6NUDg814dHpVCDtvEHxlVj//lCNPvsyM4Q2goNJls1gD aaZk/NYlm20+bvLEmD7kH1TVHiMVWabsEjLvwAwdcJrNGAQUuz1zujKVD299hQPHe14X N9ncLPxqwJ8G0UFYlb/phkvi+17b0JGkNYf2JKbtztVHLYaJyr9wyKMQgwizkMILkkW3 wxBBzvq+QDIBFkmuLiIUVtezgik73IluDF/xnleHGxoXAxyY3kFRz3N1XPoKMurQmEYQ fpv3h44X/2IivVGdw+w0lMFbbwGHZl+xaXsgwmbj73k4+z1fTMPy0ja23gA7ZlVnQvsv tBBA== X-Gm-Message-State: AOAM532qu4EU5Vj++npWsGLbqqrQ8x79PnUxs82uu7kw5bNZpfyQlw7u K2PCITFCDR+UZwActH3L5TfPdA== X-Google-Smtp-Source: ABdhPJz+HT2ALNEsStJr5GIZwireXwBnHeXMm8jG5B1+AAK/E1ASC3c1QWpUJ0zGeO+ZMwoJ4IUlEw== X-Received: by 2002:a37:e215:: with SMTP id g21mr3182478qki.37.1623306732373; Wed, 09 Jun 2021 23:32:12 -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 i11sm1591461qkl.95.2021.06.09.23.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 23:32:11 -0700 (PDT) Date: Wed, 9 Jun 2021 23:31:57 -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 00/11] mm: page_vma_mapped_walk() cleanup and THP fixes Message-ID: <589b358c-febc-c88e-d4c2-7834b37fa7bf@google.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: EE847E000261 X-Stat-Signature: cegephx768fc1spagzewck4muofhdj1p Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=F0gpvRmN; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of hughd@google.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=hughd@google.com X-HE-Tag: 1623306726-174460 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: Here is the promised splitup of what I posted a few days ago as 5/7 mm/thp: fix page_vma_mapped_walk() if huge page mapped by ptes. These are against 5.13-rc5 plus yesterday's mm/thp series: https://lore.kernel.org/linux-mm/f7fc2e72-b8b1-f132-cdb2-1b256a6f2de@google.com/T/#u (sorry about the misthreading, I missed linux-mm and lkml at first). 03/10 and 04/10 of that series also touched mm/page_vma_mapped.c. I've marked all of these for stable: many are merely cleanups, but I think they are much better before the main fix than after. 01/11 makes the opposite cleanup to the earlier 5/7: that preferred to use pvmw->page, this prefers to use page - it could go either way. 11/11 is a new fix that I noticed while splitting up. 01/11 mm: page_vma_mapped_walk(): use page for pvmw->page 02/11 mm: page_vma_mapped_walk(): settle PageHuge on entry 03/11 mm: page_vma_mapped_walk(): use pmd_read_atomic() 04/11 mm: page_vma_mapped_walk(): use pmde for *pvmw->pmd 05/11 mm: page_vma_mapped_walk(): prettify PVMW_MIGRATION block 06/11 mm: page_vma_mapped_walk(): crossing page table boundary 07/11 mm: page_vma_mapped_walk(): add a level of indentation 08/11 mm: page_vma_mapped_walk(): use goto instead of while (1) 09/11 mm: page_vma_mapped_walk(): get vma_address_end() earlier 10/11 mm/thp: fix page_vma_mapped_walk() if THP mapped by ptes 11/11 mm/thp: another PVMW_SYNC fix in page_vma_mapped_walk() mm/page_vma_mapped.c | 160 +++++++++++++++++++++++++++------------------ 1 file changed, 96 insertions(+), 64 deletions(-) Hugh