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: 105205 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp650006vqr; Thu, 8 Jun 2023 18:33:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tpAXzH5CiHYGwqBTPN50BoeJlQPq/FjcIuWPYMXYZFfrgruotM1ybS03RSBWoBENK0yOs X-Received: by 2002:a05:6358:c419:b0:129:b9f4:75d7 with SMTP id ff25-20020a056358c41900b00129b9f475d7mr67703rwb.5.1686274392484; Thu, 08 Jun 2023 18:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686274392; cv=none; d=google.com; s=arc-20160816; b=PifAChhsxZM8dMvYIv2zkZA4IRLDOA/lBGyegA7QBRS2By4cNOgiJWYbQKOtHBFdsY yCEH3xpR7hPLTnHRUqOnRpbyYzSuan4d1d3WrunKQIIPsJc14jGssHnHqp9ZPWwbJsBv 4OGeu6L58KLiSMzRiGbCQ+57l9t3O9HcAmUftpZUzY46yKm6X8inRIEZ9J2wI5DPS83o XDe0//J+6HAE5r2gXFbiBtfk9MNHqL7iwM7OnZ4TAUErzjDL8yJmjCaioyaeJC55UPVv vvU953fplUvsl+iMbqNxNJJ6Ibp6ZIrDyUyxrRmka8IhtTgEYh/JzuvTB8ACvv7nUswx UHLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=zTm3eSBiFsuHpLmgEmMbxBID/kzy6WIASRGS/m4xNS4=; b=JIvC2U4dpYD27xJhLceWv8EWXQdylOzrf1GDtTUZPE1Fs3YmCyhjqxWNoCtXnC5bnZ xdll59NbElUYlW1FBI5idN4UEaRj/kbDhfDTs05iQuxYvF20Ja6qJJ7XGkZsG5jT8CPK ikc5NXeFNpCEtPyI2CHJXpirrgtbamQxS8yMdOm3v+uMh7B4L8M+yBtl8oPGeIYnEIe+ c+8/hAZwZXNCyilSZFFo5J513zHo03iGLT1rxvuL8rISlBnOG1lEu6dv1+L1O114Khht 8XhHU39lN4SyeiMryLuVHSOuEqF5J/PzRhg5nXtTEnezKR6bWZHJ+kUYxNz3YPyQuLBY Hz3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="W/4m2uxI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a633c06000000b005303c1de315si1742266pga.853.2023.06.08.18.32.57; Thu, 08 Jun 2023 18:33:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="W/4m2uxI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237401AbjFIBNA (ORCPT + 99 others); Thu, 8 Jun 2023 21:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237379AbjFIBM6 (ORCPT ); Thu, 8 Jun 2023 21:12:58 -0400 Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B630A1B9 for ; Thu, 8 Jun 2023 18:12:57 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-5659d85876dso10704177b3.2 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=UVSSapVj1y1RVmv+xCo6QBK9LzR/L2ZGa3fhWlQOEJjhVmWp4HqG7Enl44vCFKXZP/ w/cdcFvp/huelKrBfARW93AFFTfCIwyAobGZi7NByGwIoB6vb2eTeta1UGgz/FES76Sn k6Iyfm9KoYKiv06AcNJEe3vSF4zkfebX6B0w0uCsyQwB+jvfsE2lxHgOFUb9zE0UfD0P AvI0Gt4v72awmF4UofyXjC4zZilnMejXOpOPltTtP+G5DjMWYJFF0zQP88lgek+ULGqc jF5eT/ysuMHtA8ZFoQWBArqVbM1FRLWW/uye2EDp7GbjxUIcYcBBpL1wRs4X6UVQIcSD b2wQ== X-Gm-Message-State: AC+VfDxdKgfKKspsouo8MAWWO95yWf64Lj2bxxaGLA/Jb6kA7MnHISN2 YhyQsCMM9INK+1Bw1mYhpzhUGw== 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-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768186857385924995?= X-GMAIL-MSGID: =?utf-8?q?1768186857385924995?= 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) {