From mboxrd@z Thu Jan 1 00:00:00 1970 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 DBAABC25B08 for ; Wed, 17 Aug 2022 16:07:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3CD466B0075; Wed, 17 Aug 2022 12:07:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 355DC8D0002; Wed, 17 Aug 2022 12:07:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F6C28D0001; Wed, 17 Aug 2022 12:07:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0CFCC6B0075 for ; Wed, 17 Aug 2022 12:07:26 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C9ACF41645 for ; Wed, 17 Aug 2022 16:07:25 +0000 (UTC) X-FDA: 79809564450.30.6485137 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id D6D19401CE for ; Wed, 17 Aug 2022 16:07:24 +0000 (UTC) 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 264DF615B3; Wed, 17 Aug 2022 16:07:24 +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 ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ON2nnV9t; spf=pass (imf01.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660752445; a=rsa-sha256; cv=none; b=imYKqtqVqU1waC28wgW5p7Xl2pBIq5M/C5oafpbR488AHwsa3qT81rBtXZI/VTNWOm/1+p 5HVH1tSkTTpgBsbRPNYiDk8i1FMCoMoTlyukVXSpkceXYmJkwxzJolICb/yqzRdKZX2Ypr +wqjfdxkepJs3txcJj/fpC1DpF/ynxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660752445; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MfX2YmEDg+XRqW4b4Jm1XVvFWlG/IAWDUzQ2o7K/ReE=; b=cyYcfzWfq3xc5h7sA8qYTGjTyDhfMZ7DW3Sk4p2EBi7M4RwDjAxSzZaW9M+rQkTMNNFaG5 US7UWJc/gXJZUcdgSW48g1FP7NRkp2eJEGWWsTAtkJKeOKDfaYUtFBVkwnc04c+7jt2fSy ixwb/OLnshzGht67ANhl2smu9GXXrIY= Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ON2nnV9t; spf=pass (imf01.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: obs1btg37uy5jriwwft8aobjjsjpdrw8 X-Rspamd-Server: rspam09 X-Rspam-User: X-Rspamd-Queue-Id: D6D19401CE X-HE-Tag: 1660752444-503651 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: 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?