Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6840753rwl; Mon, 9 Jan 2023 13:54:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXt5NryDwWpW4jRfek1MsaPre0QCd+08qfE57HSbQqDI0KUEYQNlaNDR5Kxc2bDfpOJfqiv1 X-Received: by 2002:aa7:8692:0:b0:589:a782:470c with SMTP id d18-20020aa78692000000b00589a782470cmr2466037pfo.2.1673301279594; Mon, 09 Jan 2023 13:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673301279; cv=none; d=google.com; s=arc-20160816; b=l931eH8m3TrMCaus8zh4RJ4tz4alaNVcYr/1JFwbH2MlnsfJ42OblNzNy37I6yCkPS Mhfurj4Am0+eKlBN564AMRNNNnvoyPjK8PafJNi+R3AjA+tNfwHaVWmLjzyaXi6JmyDK 8GVQ86QSpU9V0GisU9HH9Io/6luhjRmZx2jtJx8WevcyoJQ/Lz0DFi29u9xHbSPCRFTN YsZzeBq0ohttJyVyx8x4Cb5WropolMvkPt85Vfoazq0/CkMhblGcFanNClrNynvOi53V TtaL7k+DWT++TLpgrfmiuf+vyy7VUpSzEXZjElgTjiQZb1j9/9OhoWPlUBo8VMTkwaly Fj4g== 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=MGUu9cOvc1HuAi4ImywWxr6yj31JHAQ/zFkqT9+UlA4=; b=tTGAJoVWKW/jFgYFyKJDt8MVJjiqzxaEIFmi4LQISfiHeOqWdgRs3b7oEzC3eiU2a3 3ULzjDtUut0ypU/FFSa+LMRu+VUl8Y/Ht4xrwdaS4vGr7KSSWSiMhR5bskmi0ZoEvZ0+ iVqm6rNip+KQd/iR/3Y9XsXy/Yuvnfc/tYO9nmnYqRg1rErgCV48Sai1I1e8HLjWZODK vwvKwB1nTg+vEh2YpL9ShlYftq2QtKNiTs15vtWDS9yqvoOcnB9MxFN3Ufq0kvfIgMVb s2McB6P/lqt0NmcK7Lg1DGn9vtBBIbMfKjcSNBxcEI3eLs5dum50z5zu1Eg3WzXL6qyW dOhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jRDHdTCz; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v185-20020a6261c2000000b00576ebcdd307si9409026pfb.352.2023.01.09.13.54.32; Mon, 09 Jan 2023 13:54:39 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=jRDHdTCz; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234992AbjAIVdz (ORCPT + 53 others); Mon, 9 Jan 2023 16:33:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231220AbjAIVdv (ORCPT ); Mon, 9 Jan 2023 16:33:51 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 257E1DD0 for ; Mon, 9 Jan 2023 13:33:48 -0800 (PST) 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 AB40D6140C for ; Mon, 9 Jan 2023 21:33:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95EB2C43392; Mon, 9 Jan 2023 21:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673300026; bh=S9qpLQ77vZLkX0Fi/FnXthnFg4be2LJbk3/kO/j1qTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jRDHdTCz4fpg4pSg+atnuiWHPSzA34OuiyN0y4hpkdydvPbEXc5zQNd2rmXYtLG3R 3qnhCqhu0s5e6yY71KGAHWgxIuU/eKP9xpeghcLzTaHoAiaNpS1AV6Ixh21DKD0orM uSzwGl7Itp0qOi0SAjUWVJgo6gllE3SdJ2Tfo53cV7OsSDL+n310BVjzmPDIcm0XMO p8wPGPwVOXBEM6ivtFSJskAo1VQNvggSIM9GNleCP4uRobOuMxdi9GBMueeRyyR1Rr BEaar4UIe6j/wPq/l0eaX6+bLZBckUQuURSfg9NUCEN8MXUiJ4raIz5tcuKTpBcfsR BUGNJ394IFnhg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] mm/damon/vaddr: support folio of neither HPAGE_PMD_SIZE nor PAGE_SIZE Date: Mon, 9 Jan 2023 21:33:31 +0000 Message-Id: <20230109213335.62525-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230109213335.62525-1-sj@kernel.org> References: <20230109213335.62525-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 DAMON virtual address space monitoring operations set treats folios having non-HPAGE_PMD_SIZE size as having PAGE_SIZE size. Use the exact size of the folio. Signed-off-by: SeongJae Park --- mm/damon/vaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index d6cb1fca1769..c7b192006fe6 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -475,7 +475,7 @@ static int damon_young_pmd_entry(pmd_t *pmd, unsigned long addr, goto out; if (pte_young(*pte) || !folio_test_idle(folio) || mmu_notifier_test_young(walk->mm, addr)) { - *priv->folio_sz = PAGE_SIZE; + *priv->folio_sz = folio_size(folio); priv->young = true; } folio_put(folio); -- 2.25.1