Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5012523rwb; Wed, 17 Aug 2022 09:30:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5UUCpPltZ4FujWNAromVg709lzztthmGOk2XW1rHKdw0d1X72q4j19uJKqbFZU7ZkoqXZl X-Received: by 2002:a17:907:6d16:b0:731:17b5:699 with SMTP id sa22-20020a1709076d1600b0073117b50699mr18411258ejc.23.1660753849968; Wed, 17 Aug 2022 09:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660753849; cv=none; d=google.com; s=arc-20160816; b=TscyhHRGAvIIpkN8Zrf8Qx9AK2N5g7luPZjZaurtMWg9iXGDGh4fwHGDaMu/yMDaRV PX2qU2i5gJotDbKhjubIH930DGZiZ8AeRxCdMWQkFuts3T9mff0CpexfgEoi9oW1bYwe SShEi7OH85Ve0NZl/2/OjBC2qLQLSJd37J/y7ss5QmxMhVUJ6cYQHMIiX717MosZSP1W LJHn5Akd4/FT5y6yWhfGnM7RIfkNcMFvsy2HIiq+mOepgAsZKQOQSkaoa8FP+aIwchQN x6VgPG1n6Vefxv0nfTwFdu7zB0/Gqi9zF+kKo66CiFfUuyr/7FRtBEj9NvrkqbArjxE7 /MOA== 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:subject:cc:to:from:date :dkim-signature; bh=MfX2YmEDg+XRqW4b4Jm1XVvFWlG/IAWDUzQ2o7K/ReE=; b=05T5q5GIV5hDzlbttDa/NUT2w6XuJ8n40aJNOwNKFHODPlAflGkSTyWDK+rOQgrscv Hi/FDqNmq5fePKqbaDqcWj+FSBJj30tXz+hgqLxBoSXV3m6dWiT0yF3Sj+tsOgL0OXbU ojOxM/vcZv/RP9/NtZvdNjFYjP/nhQQl/xQe4THWfIz9nruYjJEueTnupKPqeGO3B2eO gtfkQ45DbwizQRczd/nqGGbdPPs1VvwUqo4dY8bmWkITN1YZQyIzUFx1Bs3diS+D2BpO Cl1nNKHoSvsiwKjUftw6Y+RbwPhyMhTS8NJD4EMPplxfYjwveObpSsoTjLu8qLdoIS4R qoPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ON2nnV9t; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dv13-20020a170906b80d00b006feba25b350si10912039ejb.106.2022.08.17.09.30.24; Wed, 17 Aug 2022 09:30:49 -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=@linux-foundation.org header.s=korg header.b=ON2nnV9t; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240643AbiHQQHd (ORCPT + 99 others); Wed, 17 Aug 2022 12:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240618AbiHQQH2 (ORCPT ); Wed, 17 Aug 2022 12:07:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EFB92C644 for ; Wed, 17 Aug 2022 09:07:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F3DE761590 for ; Wed, 17 Aug 2022 16:07:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B44DC433D7; Wed, 17 Aug 2022 16:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1660752443; bh=+IgIwGvGsv8iGPY4KtPJvSs69LJqZ76GCMTQrQxbLaM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ON2nnV9tohORfB7RYdUVQqEVQx5DBj5w3rUZDAqpajXdpG4bGTcaztknIh3QRinrw 87CMK3RSMKo1zzt5By6CcBmv5SabudtIaVV6HwVS38x74iVfOZ0Ax7pGnClxZStQoi hwXgTEssSu04qV1vHeQK5gu9Pjnoi3yLzoZeXu4k= Date: Wed, 17 Aug 2022 09:07:22 -0700 From: Andrew Morton To: Baolin Wang Cc: sj@kernel.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon: Validate if the pmd entry is present before accessing Message-Id: <20220817090722.3a04da77a280c74cccde6b2c@linux-foundation.org> In-Reply-To: <2838b6737bc259cf575ff11fd1c4b7fdb340fa73.1660717122.git.baolin.wang@linux.alibaba.com> References: <2838b6737bc259cf575ff11fd1c4b7fdb340fa73.1660717122.git.baolin.wang@linux.alibaba.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, 17 Aug 2022 14:21:12 +0800 Baolin Wang wrote: > The pmd_huge() is used to validate if the pmd entry is mapped by a huge > page, also including the case of non-present (migration or hwpoisoned) > pmd entry on arm64 or x86 architectures. Thus we should validate if it > is present before making the pmd entry old or getting young state, > otherwise we can not get the correct corresponding page. > What are the user-visible runtime effects of this change?