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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E0AAC3DA64 for ; Tue, 6 Aug 2024 13:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:CC:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mTzXgBVSWtytw++ReZuHvUl85NnTUtJGL8VRzJ6vbao=; b=GKurK+RtxbNRWh4zhdGxuWaOMs IxNSeiCxLYgOQ9J2LIhYvsgcO1yOV+H4bpV/32ZQuL3WqzFoom9QFbOACgCieNcw2VGNllkPd6jLp VYL+Qs0w3UaS5JCS9AWylR/8c6MgeF5PxQYlyB3qBm1syAPWlPe4Z4JN/y00hSMA4NHcHZFp3dLUz ZC8xe5X5GmSaga9PbtvE6NImw1mTZOGiqHWciSbMiqZK/rzKbOovH7f2wR0wixt6+rvr3gSds4KOS UTnnOB4IJK2biHtRqzlQFt1XE1gieMB9W9zlFO/FZSDFIxfL0nT5/Zvx1YWu0vbpM6FLaXVlvdUyN zGkY4I8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbKN1-00000001oIy-3P64; Tue, 06 Aug 2024 13:36:59 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbKLM-00000001nt7-2lsZ for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 13:35:18 +0000 Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WdZ1y6qW2zQpCc; Tue, 6 Aug 2024 21:30:46 +0800 (CST) Received: from kwepemd200014.china.huawei.com (unknown [7.221.188.8]) by mail.maildlp.com (Postfix) with ESMTPS id A910F14011B; Tue, 6 Aug 2024 21:35:12 +0800 (CST) Received: from [10.67.121.177] (10.67.121.177) by kwepemd200014.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Tue, 6 Aug 2024 21:35:11 +0800 CC: , , , , , , , , , , , , , Subject: Re: [PATCH 0/2] Support Armv8.9/v9.4 FEAT_HAFT To: Marc Zyngier References: <20240802093458.32683-1-yangyicong@huawei.com> <86cymr1a3z.wl-maz@kernel.org> <86jzgu2hzo.wl-maz@kernel.org> From: Yicong Yang Message-ID: Date: Tue, 6 Aug 2024 21:35:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <86jzgu2hzo.wl-maz@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.177] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemd200014.china.huawei.com (7.221.188.8) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_063516_903042_EE4A1F39 X-CRM114-Status: GOOD ( 14.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024/8/6 16:06, Marc Zyngier wrote: > On Tue, 06 Aug 2024 04:43:52 +0100, > Yicong Yang wrote: >> >> On 2024/8/2 18:40, Marc Zyngier wrote: >>> On Fri, 02 Aug 2024 10:34:56 +0100, >>> Yicong Yang wrote: >>>> >>>> From: Yicong Yang >>>> >>>> This series adds basic support for FEAT_HAFT introduced in Armv8.9/v9.4 >>>> and enable ARCH_HAS_NONLEAF_PMD_YOUNG. The latter will be used in >>>> lru-gen aging. Tested with lru-gen in below steps: >>>> 1. Generate a 1GiB workingset by `stress-ng --vm 1`. Then hang the task to >>>> stop accessing the memory. (AF bit won't be updated) >>>> 2. try to age the memory by /sys/kernel/debug/lru_gen >>>> >>>> Run above steps with LRU_GEN_NONLEAF_YOUNG(0x4) and not respectively >>>> (switching by /sys/kernel/mm/lru_gen/enabled). LRU_GEN_NONLEAF_YOUNG >>>> will clear and test the PMD AF bit on page walking for aging, >>>> otherwise will clear and test the PTE AF bit for aging. In this case >>>> LRU_GEN_NONLEAF_YOUNG will improve the efficiency of page scanning >>>> since pages won't be accessed and we don't need to scan each PTE. >>> >>> Improve by how much? Can you please publish numbers that demonstrate >>> the effect of this feature? >>> >> >> With LRU_GEN_NONLEAF_YOUNG ~40% time saved for 1GiB memory observed on our >> emulated platform. > > This certainly looks impressive, but it is a very ad-hoc benchmark, > and emulation numbers don't necessarily result in similar improvement > on actual HW. > Yes indeed. I just design this case for testing it works. The real case maybe more complex and not that ideal and may also involves other things like THP (for THP we may already use the PMD block mapping so the advantage of HAFT may not take effects). > How does this translate for a more realistic/useful workload? Even > numbers obtained on another architecture would be useful. > Currently I have no numbers for the real workload yet. Maybe for the next step once the platform's available (for a x86 or arm64 one which can run real workloads). Thanks.