Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2876219rwd; Fri, 2 Jun 2023 16:33:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7HW+zP9yJTkGGwbSsjT+/DnYSmZHyzTp0592auk1UQlaSxsfDr/pTd42xCnq/6wDnjcUcP X-Received: by 2002:a05:6a20:a18e:b0:109:38b4:a210 with SMTP id r14-20020a056a20a18e00b0010938b4a210mr37034pzk.29.1685748810774; Fri, 02 Jun 2023 16:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685748810; cv=none; d=google.com; s=arc-20160816; b=GcE97UutPScloaBrmPJBHhjxGazSzHnIUCc1crTzpG49Ev95z4oE4utFq43m/44XK6 77R+sbpfzJ4wHInK9TL1yHzJfttIpG8q0I2QR0fEdzBYPink+ttBCSEfTz0XYrcnH1p8 enRcve1Dre15+zU7hNVY/whhR1X03kqjprCNxcpXhBGLN9xue41JeenSfw9dycMZs/Vj qsav6NgUjGzanY7VDr7SJ2saJTE8DruuTuoaTCbRmYyzLiix1bGP/Pa0qMHYtMbn2O/o mK/vdDGAH76C27jxSdyUktFFdmACYUcOKi8IT0ItO9XY7MGIV6usUjYgYsubuemzsfJU 4K3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7/N76tvOnLlaQAuSL3pN8eRsyONhrct8MBiAnZh2TuI=; b=l9wM8PBla41v2ax9Ju5fz9Svq3OifVvC2aypCqpt1/KImjNXudLD6aJGAPNaAIPfko rPdOdxFMsEVqExhPISD5HoS4/F6RsCd5h9x+nHOAwiyBjjaar36wGk/XVH4bVjz5oKV+ jYee05ooqcU0BMcY7UxOvjeOOixVJfuky5/QyozzQJE6EGPeE8PJngsDxGxza3ZScldu l0YCPeBMmRqUugfZuguswTdRTy/HduK7WS3SV12djJF4CcA1Vi1Vm7tsSUajFuBBznip BqRS8+wYnuF6QKThg2b84viWuSqRNGQ3Eh8F6BNXk8B4RJaNWbdivQBWwccYLzK7X91v Wq1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h087KohY; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a17090a74cc00b002475bc0a186si3448921pjl.69.2023.06.02.16.33.14; Fri, 02 Jun 2023 16:33:30 -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=@redhat.com header.s=mimecast20190719 header.b=h087KohY; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236847AbjFBXG4 (ORCPT + 99 others); Fri, 2 Jun 2023 19:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236799AbjFBXGv (ORCPT ); Fri, 2 Jun 2023 19:06:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96886E42 for ; Fri, 2 Jun 2023 16:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685747165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7/N76tvOnLlaQAuSL3pN8eRsyONhrct8MBiAnZh2TuI=; b=h087KohY/9Zk9c75R/dGcIsgkLLMfhctZS6UBnp1D5BgCWuvn4B1TtjU1vEyuPYO1cOY7H qqUbedAEGMO2h8G6opHop4CwP2sC8eaD1WpN4I6Pyh9d49fn/xEy4hBru0aQ0aQhoHMGAT kC/i3cFfoqZd9Us07EDM6mO7S0xUx6M= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-rNkeITVuMGi6grhx4f1C2A-1; Fri, 02 Jun 2023 19:06:05 -0400 X-MC-Unique: rNkeITVuMGi6grhx4f1C2A-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-3f6b46e281eso3409491cf.0 for ; Fri, 02 Jun 2023 16:06:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685747164; x=1688339164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7/N76tvOnLlaQAuSL3pN8eRsyONhrct8MBiAnZh2TuI=; b=aEd/DYkU0Rj2K0wfTT+pQpeRKlwGMseKpAGwrHs4xvUxngTvbrjJSockYWEAhtFNe5 DugE2DAfJhNrJ5yOsaEaV2HQXHTpvTiqpt5JvTvxhV7hXme61plLuiT1CGN2L/WLQLMm l5To6mbVUvO6hyzOV2HsUeTa7BnuQP9Gi+ktB5dmfexzV6ABzyCaU33h4mt1lTj3aOJz 3qPodjmw7gkmc691d1yhJhw4FAALbvEsutePjtWEPO55jAwT+RbzvG/TfmPSOWhaF6f1 MIEpcpSh++QzzE4LmIGVpZS4yRx5IU3q0T01o9BGWpMxfXPHjGbRsNAtF/x7N0mx2HOl H2eA== X-Gm-Message-State: AC+VfDz+4XdPJg9voqAlMUn44FhCEc8uKXEh/9rDD0aHqXJkxOU1MdAk 6kK+UQBphq2urOxEBP9aaOwePXcXLTpesX407yZpMqaEA9obIsBnt1wn8Mm7+2fz5cif0/vV475 PyyPv5pIpEmHMDNA36mT1NiXLdGI7M7br691PTB0Y9DcEAMKDzwQCS0dWrQaT23EF2SCRw5oIgl 6J+lrerw== X-Received: by 2002:a05:6214:21a5:b0:621:bf0:7609 with SMTP id t5-20020a05621421a500b006210bf07609mr13309574qvc.0.1685747163782; Fri, 02 Jun 2023 16:06:03 -0700 (PDT) X-Received: by 2002:a05:6214:21a5:b0:621:bf0:7609 with SMTP id t5-20020a05621421a500b006210bf07609mr13309535qvc.0.1685747163387; Fri, 02 Jun 2023 16:06:03 -0700 (PDT) Received: from x1n.. (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id px13-20020a056214050d00b0062607ea6d01sm1400792qvb.50.2023.06.02.16.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 16:06:02 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: David Hildenbrand , Alistair Popple , Andrew Morton , Andrea Arcangeli , "Kirill A . Shutemov" , Johannes Weiner , John Hubbard , Naoya Horiguchi , peterx@redhat.com, Muhammad Usama Anjum , Hugh Dickins , Mike Rapoport Subject: [PATCH 3/4] mm: Warn for unstable pmd in move_page_tables() Date: Fri, 2 Jun 2023 19:05:51 -0400 Message-Id: <20230602230552.350731-4-peterx@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230602230552.350731-1-peterx@redhat.com> References: <20230602230552.350731-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 We already hold write mmap lock here, not possible to trigger unstable pmd. Make it a WARN_ON_ONCE instead. Cc: Naoya Horiguchi Signed-off-by: Peter Xu --- mm/mremap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/mremap.c b/mm/mremap.c index da107f2c71bf..9303e4da4e7f 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -544,8 +544,8 @@ unsigned long move_page_tables(struct vm_area_struct *vma, old_pmd, new_pmd, need_rmap_locks)) continue; split_huge_pmd(vma, old_pmd, old_addr); - if (pmd_trans_unstable(old_pmd)) - continue; + /* We're with the mmap write lock, not possible to happen */ + WARN_ON_ONCE(pmd_trans_unstable(old_pmd)); } else if (IS_ENABLED(CONFIG_HAVE_MOVE_PMD) && extent == PMD_SIZE) { /* -- 2.40.1