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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10E1FC25B08 for ; Wed, 17 Aug 2022 16:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240615AbiHQQHe (ORCPT ); Wed, 17 Aug 2022 12:07:34 -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 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?