From patchwork Fri Jun 9 01:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13273067 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 5248AC7EE29 for ; Fri, 9 Jun 2023 01:13:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E52308E0002; Thu, 8 Jun 2023 21:12:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E29038E0001; Thu, 8 Jun 2023 21:12:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF1F88E0002; Thu, 8 Jun 2023 21:12:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C14C68E0001 for ; Thu, 8 Jun 2023 21:12:59 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 994DDA03A5 for ; Fri, 9 Jun 2023 01:12:59 +0000 (UTC) X-FDA: 80881435278.06.8AB4402 Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) by imf25.hostedemail.com (Postfix) with ESMTP id CB3B7A0008 for ; Fri, 9 Jun 2023 01:12:57 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="W/4m2uxI"; spf=pass (imf25.hostedemail.com: domain of hughd@google.com designates 209.85.128.173 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686273177; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zTm3eSBiFsuHpLmgEmMbxBID/kzy6WIASRGS/m4xNS4=; b=WJevkJd76u+8AskiAyoS92QuKu241Yl8yGNBV/GWNsHFP0rRjxmf/4IJ1AZzSwM8Fr1men +j3LICk3qBuxf3Ho/MslMjVPdgAjDqXSkKDNWg99QevOByNLMi2m97qWqZrTS+NaAqr49R pZAupT7qAVj6SALANDupDkG82Hnf53M= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686273177; a=rsa-sha256; cv=none; b=0fCTHgRNJzp0yqWBA12ji9fnE6rMa8czch1iu9KuXZjPSEl0b4f882qEh1Xk4yGvMPVeHU sYX4c8lMLt45FZTt7bFdQyn8NcnvE/MOHgpcGlWp8fHHDX9gz2qoC5J2CX7Jfs+MBHKye9 +w4Bhj+E8Jhl24auE4l12PxsHwU2fGU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="W/4m2uxI"; spf=pass (imf25.hostedemail.com: domain of hughd@google.com designates 209.85.128.173 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-565cdb77b01so10792497b3.0 for ; Thu, 08 Jun 2023 18:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686273177; x=1688865177; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=zTm3eSBiFsuHpLmgEmMbxBID/kzy6WIASRGS/m4xNS4=; b=W/4m2uxIgiBxYZeqFiaOJ+t56Xk1lzeX/0joWZYYIlyVr9x1rZQ0PVY6idfgJo3YAs J06WtHIbHcuFZFi7CTRbs4r/YWp12HHJP2GIpjC6Vtuxoe9P0OFgcqDXalAZfOXD7v9f PF1TUdN6QUVjLjHU9HZGO/hqyJB/REsEub0tjNaQLQmNIjXpYIuYk+iYoQFltIweg+DY h7yV6zg9eLJCboUD4lcwwTs6Aiti1k/7W+hJoajF2B88W4XFTVhUJC0bytvim02PYS13 jSNRaWmPHUADOzQcYjUwHqikvc9EsK2V2BuWiEGpR+wVTRiltwgLI4HXCzIB2BRua0U+ cdFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686273177; x=1688865177; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zTm3eSBiFsuHpLmgEmMbxBID/kzy6WIASRGS/m4xNS4=; b=OpTjI0NbYO3Te0JGCHXF0b8XywQ4PQhy8/k7BX4kMfHjaYkh5ZSeq8Kiu60oFFRS92 wbT4A+EMow0RQ0IsfdL0l0spoOz4zsDk+lmt0enF4jiI/Brxx1w2aJLG+aYWuMtLXZmR pQt/SAz/aFqy5z+tuHXu+sa+lmuIqDOmAOs4DyZuGCwsXONVuVkDs/9etsmHNBYutEhG dwJCV5wFfeA6aLtbGQ+X2RI33X1wRoASKteN1Q1l5o/kYVJl36oiz0ZaV7ANzBKfoHOs IuX9c/L4LWlul+9q8Sv8SbfX6JaOsKmwtX5XOtENPlebjjsI/Q1QQRpoXDJSW9ZZTb+k +lKw== X-Gm-Message-State: AC+VfDzGraJ0W0lC7Ltl3y28fy3+HKxUElGWZxTHjuiUN6wgJwcYybCZ MVvDVethR1HOIKCGX63EQrsqtg== X-Google-Smtp-Source: ACHHUZ7s2CfLundXAjg1vKJyhl3Rk4a+SVhLQYBVIqG94BbiAa+Lman4+SqaG4ekKQNDIkezzL6CKw== X-Received: by 2002:a25:b11e:0:b0:b8e:cb88:1b69 with SMTP id g30-20020a25b11e000000b00b8ecb881b69mr1064722ybj.34.1686273176726; Thu, 08 Jun 2023 18:12:56 -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 b1-20020a252e41000000b00ba6ffc7ef35sm573643ybn.65.2023.06.08.18.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 18:12:56 -0700 (PDT) Date: Thu, 8 Jun 2023 18:12:52 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Lorenzo Stoakes , Huang Ying , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 06/32] mm/page_vma_mapped: delete bogosity in page_vma_mapped_walk() In-Reply-To: Message-ID: <87475a22-e59e-2d8b-d78a-df376d314bd@google.com> References: MIME-Version: 1.0 X-Rspamd-Queue-Id: CB3B7A0008 X-Rspam-User: X-Stat-Signature: yhmbt1hj5joq1i95zg68uwgnb4tb45qp X-Rspamd-Server: rspam03 X-HE-Tag: 1686273177-28197 X-HE-Meta: U2FsdGVkX1/1mdIJCYP87TuUCL0F4ZrZq5Lc7BU+amgiAeqyOBvuWjYm3VUWCIhFPl0zGT16xzn1kozSnS/9n/x8XNpxghZc80lxRVqWrWdsHaLnfJC7kI+NKNQYIkAp+4kJgbpVzOlk/oxTa354vAX7Vo/8MQszUgJ2rbdAHeMawECEoBCZEvlprbyPfsKrptekZXYEVAyv1GUR7fdOOBCj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+36xWyNrDA6uemFbC89cflLf/BhCa5F+Bsk0WyeQA3WSmyc0l23mBYh+tfo48+mnOk+J4aGUkA/ZxAI+f4Z7lw= 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: Revert commit a7a69d8ba88d ("mm/thp: another PVMW_SYNC fix in page_vma_mapped_walk()"): I was proud of that "Aha!" commit at the time, but in revisiting page_vma_mapped_walk() for pte_offset_map() failure, that block raised a doubt: and it now seems utterly bogus. The prior map_pte() has taken ptl unconditionally when PVMW_SYNC: I must have forgotten that when making the change. It did no harm, but could not have fixed a BUG or WARN, and is hard to reconcile with coming changes. Signed-off-by: Hugh Dickins --- mm/page_vma_mapped.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index 64aff6718bdb..007dc7456f0e 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -275,10 +275,6 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) goto restart; } pvmw->pte++; - if ((pvmw->flags & PVMW_SYNC) && !pvmw->ptl) { - pvmw->ptl = pte_lockptr(mm, pvmw->pmd); - spin_lock(pvmw->ptl); - } } while (pte_none(*pvmw->pte)); if (!pvmw->ptl) {