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 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 B0DFBC00140 for ; Wed, 24 Aug 2022 17:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:From:References:Cc:To: Subject:Date:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uwyBm2rOnY0vff4YF1h9Zpu60KL+noedEYuByA/oSLU=; b=SgqgefLeQ4T4OfsRlS6TWuplkQ yBfjZtX4SXbMvWXU21+eZ7SbNrzKcwp7LNi/6hCqqSo+4WEkjD876r0gMuwvbCeHAv5r/IVZd6gPY m7YIr58OuEIsswT1MH8cm0TDzsAzIkU3Cg+cuQIscj3jMuT/+kTEvru3biZDV/CoAC1mTIaSE6aco ZwVG3REb5eiahCZ5hJctaT77qMz7varV0TG8GPvVTuLS1A2paiMDroG9CH4REhzFZ/FG6BlDZyUSM 1qSupQJGWk2SWOUhOQBDYT5BzxfXy4Htlh4/jeTlwNDWz09Yy04RzmRVOyDS8pPC7bEEJYIMaXZLv AgGeMA6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQtn7-00EdS3-H9; Wed, 24 Aug 2022 17:03:45 +0000 Received: from mail-eopbgr60087.outbound.protection.outlook.com ([40.107.6.87] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQtn3-00EdP4-Og for linux-arm-kernel@lists.infradead.org; Wed, 24 Aug 2022 17:03:43 +0000 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Mf5RkvKU9LYn99VJP5QOD489OwgfeLrGZ+DWJ+w1YMuIyYyCP3kJ7vEq4Tu+tFU4HO8NgC84OBQqUYZj783L7IXZiWkmzLtHeLwxaJQFQmx97g8a9PjStLgjYLGxlbPULgSZ65o+ttZ20E/V5so2g3zjEjjKSuFWdFZzboK8XV2HXAi93Uzy1LgewroDOATAeFgx4hePCgjexzVLOOyKmH+dgnjxd+nUW0m9RJAVBPdDAy1ave8U4hVlPDQpVYHu8NNihTshSuTcmzXcNr7ES8SCIqDgMnzE7IIhR/lJXBuv8ka97zrScwxLzUul/UmC6P2tMBISVvF+jrbXiifJuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+UnLEWXSgT4DQTcGUbDdRxvIjcrMpuFfUSeoH7DIAOA=; b=l7bPmvvUg2A8ieISpe7vACulbTInuxmFeLbeA1+rphNfUWfsJJSJ1bmqhCetLOt06Mkj+gbkNWQ8X29+hR8Kp41H70yyc0hM601M6rw/hwniQzayofPE6nAZgyJ+w5RH+y8CPBN0QNZdflV6/hb8MIbC1imDifTb6YAvcPDTLcMIxZ43rlh6w6fNnWMFy/HmkELM3X4fM+xDZD2ySx3/3VnH8EKw1hJAMld6ja33hK4GhcsIENQn6O+Mo9KXLPZ5Wn6KLjbc1mW7SKr/j4D9ackCgUC1E9aTLAn93qUfLXVnQ8jneFM930KXXJd7CRfzSeQg535qDeHqBw871otj4A== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+UnLEWXSgT4DQTcGUbDdRxvIjcrMpuFfUSeoH7DIAOA=; b=gGf0K13V4/YG4AzmRS8GTSwB6RF6WOAI0akyYgCGu6pOnu4dbKYETPW37X4KsHgtnTFxQqEeH3HBTFS70XfI10S23c8rdpAu7/DaNuP/Q2YiI1cbNN8tzDyiGov5tBhvG0tykGT2ccNMDIBUViggmFYKFzajUeKDNKC14kT37ds= Received: from AS8P251CA0010.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::8) by HE1PR0801MB1914.eurprd08.prod.outlook.com (2603:10a6:3:4e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Wed, 24 Aug 2022 17:03:35 +0000 Received: from VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f2:cafe::ec) by AS8P251CA0010.outlook.office365.com (2603:10a6:20b:2f2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Wed, 24 Aug 2022 17:03:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT025.mail.protection.outlook.com (10.152.18.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Wed, 24 Aug 2022 17:03:34 +0000 Received: ("Tessian outbound 63c09d5d38ac:v123"); Wed, 24 Aug 2022 17:03:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b84da0a500443880 X-CR-MTA-TID: 64aa7808 Received: from 95073a54352b.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 102F230D-1C71-4112-8E95-81DF39D91E61.1; Wed, 24 Aug 2022 17:03:22 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 95073a54352b.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Aug 2022 17:03:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OySV66iRQUFC2HySUIKfGJS+KmVDtfrNMZlupcxIWDwu284/ecQGqp3JlmWHUl87j8L2FKTTiEA9Ac51keAQxfziLxjrPL3D9ZhY5Vp/x1cTqpc3AjCyXJtfQ1t1nkKb3kgSsednNLO2u7GgM+Z1ZBC6lyhrDhn7iy2LVltA6Fb/FrRrV8xXU/fw3Kk3p+SnRk4XW1+4CyUxvv3F8fC9/CCpmCwwjxRJmQRyZEnVWMEKt/fJsYBr0BRaaF4q6MWB3IiaNJ0zT7h4XasnWuvoKcLpjTVIXpeOcZYwNTipYOlGdtzUYqkASVID02cCP1Pstml+DXgm6zvFsh3hK0w/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+UnLEWXSgT4DQTcGUbDdRxvIjcrMpuFfUSeoH7DIAOA=; b=Ugh+jmB5c8pxYS+A1VnxgWYwZ+197U4B/gyM3UutxU4L9BvyT3UGoDYaRVvNviWCFJnni+uMKkGPTovQQhbQwAFUjJbfRJERWhpkHW86LPQpc3H0KauW128XQEFxfkozWHQlmfGLfO0++5rHYYIaZ5aTH85vqmUmWoQDutDWyI/PCMJrriqxDLj6HACB0c9cwbnlEIa2cvLP58URJbFpGRAwLxLZ2yXhFbYCOpN/orPuUr6AbYZvbVhmAoZWIx+pJrQiZl7QwsGQQH9gUNkNahpcr726dhKPAcxZ/6PVUHYYN7RW4qpmAiik9i3rmu61hsIVb8/4RCdDth0PF3tbhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+UnLEWXSgT4DQTcGUbDdRxvIjcrMpuFfUSeoH7DIAOA=; b=gGf0K13V4/YG4AzmRS8GTSwB6RF6WOAI0akyYgCGu6pOnu4dbKYETPW37X4KsHgtnTFxQqEeH3HBTFS70XfI10S23c8rdpAu7/DaNuP/Q2YiI1cbNN8tzDyiGov5tBhvG0tykGT2ccNMDIBUViggmFYKFzajUeKDNKC14kT37ds= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6995.eurprd08.prod.outlook.com (2603:10a6:20b:34d::13) by AM6PR08MB3029.eurprd08.prod.outlook.com (2603:10a6:209:48::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Wed, 24 Aug 2022 17:03:21 +0000 Received: from AS8PR08MB6995.eurprd08.prod.outlook.com ([fe80::bc0f:339f:d2d4:e559]) by AS8PR08MB6995.eurprd08.prod.outlook.com ([fe80::bc0f:339f:d2d4:e559%4]) with mapi id 15.20.5546.024; Wed, 24 Aug 2022 17:03:21 +0000 Message-ID: <437ad644-a6f7-4b5e-ecb6-e8ddf4e4dc75@arm.com> Date: Wed, 24 Aug 2022 18:03:17 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH v7 4/4] KVM: arm64/mmu: count KVM s2 mmu usage in secondary pagetable stats Content-Language: en-US To: Marc Zyngier Cc: Yosry Ahmed , Tejun Heo , Johannes Weiner , Zefan Li , James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Oliver Upton , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Huang@google.com, Shaoqin , linux-mm@kvack.org, cgroups@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, nd@arm.com References: <20220823004639.2387269-1-yosryahmed@google.com> <20220823004639.2387269-5-yosryahmed@google.com> <319904e0-3722-8ab1-cf74-491b9c32e23b@arm.com> <87zgftra6e.wl-maz@kernel.org> From: Ryan Roberts In-Reply-To: <87zgftra6e.wl-maz@kernel.org> X-ClientProxiedBy: LO3P265CA0004.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:bb::9) To AS8PR08MB6995.eurprd08.prod.outlook.com (2603:10a6:20b:34d::13) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2a31c0ac-932f-48d9-e8d8-08da85f294b8 X-MS-TrafficTypeDiagnostic: AM6PR08MB3029:EE_|VE1EUR03FT025:EE_|HE1PR0801MB1914:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: mnXNg4j7/7IKN/PKwmwPJYjAtiOVoo2n3eRh7kORhw47/4psRfOHZZdcWyE8M9Q9liV6wqQj0ntxuZANPL/muKSyeP7qg2HODa3wLwW4bdbBKaQ+odzdWYhbPXp0pTPfFIZ7w1RaEIhq/pJGcUI8egYE7Eg1eX9jyfyswDHlqLsTb7gTuVtBMNTIdUVycmXa5eN5BcWtGYWuwS4Vop6T++RxxwV9FdXNs0yuhWFT9DtPoXQdslJ0bQpajLLIiuH70wA6xwmLLqCxUxkelvyLaV0lyfsE5u+uSbqMdrqA2H9EAST+Ye+26MW+7YCMFTd5CaWwa2Ahc3vNkRtl6PNwaseJP4yY33hb9cJgmlNOkOKvAL+9d3NN0ef/xnZ2mRrSCLEDA9R9cEs28J4ZFgUmAOIliqeBcaEWjXEJnjGUWi/8HsZRyhyjPA5BSPkOPmIpXZ37VhJIYIcJm1UdDQYuyuOv3IguSJxFQ6LWZd3j+bKVF3KLleXaCKmcJUK9ck+7Lh4mvYy646zW540cjQWLxhgR463jXqVDJSi6zJv9fidkJ755lI9mJXl7bf7opbPgpEvuiWo/QXtuObimrvD+ecvKCuCI71eewTt0XE0KITRUCxEhaLcYoAo2nAbHozvMkiKc9I9bez10/k1k6UoZLA2EeZGEZ4/vn/JAKq4wWNDI9VRZr+H2tCyTFJCBE1jlDpHcHABqqskdc1u4yPNSRUr0btiLg9ouEqEcN1DvgQhEJT5GQTkMqJNNRxfO88sY3vDs8zl/93mQqXAgPt/SR4zxFmXO+2R9xMGzX5IrgR0= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6995.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(39860400002)(346002)(136003)(396003)(366004)(36756003)(6916009)(31686004)(54906003)(38100700002)(66476007)(66556008)(4326008)(66946007)(316002)(8676002)(186003)(5660300002)(7416002)(478600001)(6486002)(8936002)(53546011)(44832011)(2906002)(83380400001)(6512007)(26005)(6506007)(41300700001)(6666004)(31696002)(86362001)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3029 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8399f2c3-5317-4fa7-6316-08da85f28b96 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 64OBNgatIovYFeYihFKUdF9THcVBNvWyE8vHgfPm28WCKaxEtmerQHIQ3Dxex9X2NA9yZ8FuGNQptA6RXBJvrWhs/mmqI24dFimC1W2koAA2qms5BeO3La1V4zjCP0Vo1b4sPoJ/pC/uOP7ncXBWwXKxANXydewNY8Lf4hjd12SDDvMFrupGZlIbcLFzEqzw2+qqHUwCb48u9JEFjHKWru66DON0sv0VV0G15LIXIpZxzNzF3au1xCd1HJ1lA5wSSkgfH3CfPFe290Wc0muEt2UWXd+Redgjpl0HiZ95wWzscSW4wTRzJGiHvHWNVgo2onSr/7ijvQyQg+zbQTcko1E9ECNmrtGFZoSw+OcRzQB1mXWi6/Ftq/5F6rzyF8K7KKVBgSTTwdl+T3smrIWmIkQEuKUHDP0NIJT+Gb/wq51B6stXoI1+EIvq1qQ4QL1O71lO+4V35O8eoG4LpIEkSgpYZGnejwUdUN8aF/Ms3ufBIkbZBcM2QgOYzwLOWtIFG8wuM1hoOCsPIUAoMWrRMXZ3ZDkTeMb076a/JN0urqnoOVep3bLLPYhuenib3duNC+q3cH3CzarXmDb1bQnBC9TR//IDYMp2JXDKZDhMNXRKUXEbDjO1ksP0ER/8Pl9tqFNj6KQo16Q3op6A7HNK3tWdw4askAfzViwQNywFAQbw0PxAlOdlU3SDE5I254Fk8mWrVYKnO9uFDm+1RwQZvPvkzgT70Drp8bjMBoP4mnLZyolgno3Gp4ycw9y8MkhqgJSGopNbgm+x633F8QYgtkhKuoFCSo1fqTKIIxzQRVasrYNPdqXeuL73FYF7QuQF X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(396003)(136003)(376002)(346002)(40470700004)(46966006)(36840700001)(82310400005)(40480700001)(5660300002)(6862004)(44832011)(8936002)(316002)(31686004)(6506007)(53546011)(26005)(6666004)(54906003)(6486002)(41300700001)(36756003)(478600001)(6512007)(2906002)(81166007)(356005)(2616005)(82740400003)(31696002)(86362001)(70206006)(4326008)(40460700003)(83380400001)(70586007)(8676002)(47076005)(36860700001)(336012)(186003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2022 17:03:34.8978 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a31c0ac-932f-48d9-e8d8-08da85f294b8 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1914 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220824_100341_835533_7736139B X-CRM114-Status: GOOD ( 16.99 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24/08/2022 15:24, Marc Zyngier wrote: > On Wed, 24 Aug 2022 14:43:43 +0100, > Ryan Roberts wrote: >> >>> Count the pages used by KVM in arm64 for stage2 mmu in memory stats >>> under secondary pagetable stats (e.g. "SecPageTables" in /proc/meminfo) >>> to give better visibility into the memory consumption of KVM mmu in a >>> similar way to how normal user page tables are accounted. >>> >>> Signed-off-by: Yosry Ahmed >>> Reviewed-by: Oliver Upton >>> Reviewed-by: Marc Zyngier >>> --- >> >> I see that you are not including the memory reserved for the host >> stage2 table when using protected KVM. Is this something worth adding? >> (See arch/arm64/kvm/pkvm.c:kvm_hyp_reserve()). >> >> This reservation is done pretty early on in bootmem_init() so not sure >> if this could cause some init ordering issues that might be tricky to >> solve though. > > I also don't see what this buys us. This memory can't be reclaimed, > and is not part of KVM's job for the purpose of running guests, which > is what this series is about. > > If anything, it should be accounted separately. OK fair enough. It just struck me from the patch description that the host stage2 might qualify as "pages used by KVM in arm64 for stage2 mmu". But I don't have any understanding of the use case this is for. Sorry for the noise! Thanks, Ryan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel