Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1348777iob; Wed, 4 May 2022 22:05:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz48AL2ul/TIPe83JzqJJrw4rEas9cwVObuE0F7GlnNpqicgJOxb5pZip6lIBzN3AXGGh9B X-Received: by 2002:a17:906:9b8b:b0:6f4:d2ab:e5c with SMTP id dd11-20020a1709069b8b00b006f4d2ab0e5cmr5353929ejc.362.1651727157834; Wed, 04 May 2022 22:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651727157; cv=none; d=google.com; s=arc-20160816; b=pphky2a808yaTq0GUYW7dVsPGv5/RmMTOBmy2b0JDLcl14Dtjxq5FFeBVf/5XIY3dE Y5stNQ7HcvzgqU0TiR7GOv93exay9nT5dZRrble+HkYKXiWDPE9HEa8K6ArucQ9wnOCN HoYZuwfWDAkm2DQePpt2ljjxkGj/TmKixCycQOsdxdD0OmpYsww1lbgkGsCwRjTJNAXh 64PCzIPWh0TJki+subcz8FsG96TVcnvXNPvXxw7dwb1A9CWgCWXtE2ZRMUmLbKoLD5zE Wrux8UrZwsVUO0CXTT5c71+xSJGf4a3wfQ5PWJ/D1RT5Tn9M8TuRhQM10cQjEe23lGAC dpDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QOlSUfZzKtFK6OBOAIQBuc4S3ERymqNr6JmNBIBdXWE=; b=C8nKlp4IhtXv1tdpyyHolWaDpmy9/+FyeL0XquHlbGeah50jgXfjMJOySvyi9VcK6F zfkVmyDFJ7B9z3aEHwARMkQFMOQ8FlkSlJxGvIIlw9BC5i0X/CE56rOS9laGjPv8bJUK 1rtr+kEg5UWO5AA+RY7wFpmV0slCrJ8AzoVGgvDml8AlOguux5QJxmpBNWuCRIdEX4/c nim2+bOWulLwAe7K9KV4SedRSyF/buPItSsldfKBlkftwZ41FHPualzbYqiXA+NUd08P dmjF509aOLRmmt/lUW70gi/LlxeID+UF/dtistqtuKQMCZiR2kGX0XsOQEiwG4L4PJil LDYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lFAHEtRD; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc39-20020a1709078a2700b006f49fb1b332si1089628ejc.608.2022.05.04.22.05.33; Wed, 04 May 2022 22:05:57 -0700 (PDT) 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=@intel.com header.s=Intel header.b=lFAHEtRD; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376871AbiEDRz1 (ORCPT + 99 others); Wed, 4 May 2022 13:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356364AbiEDRVK (ORCPT ); Wed, 4 May 2022 13:21:10 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFFDA4EDE5 for ; Wed, 4 May 2022 10:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651683724; x=1683219724; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=CTg7Xyv27hMl+wBuAu9Sk2WDDBF7tqVYHYYBMKvmxj0=; b=lFAHEtRDiWcLrAPxJEEIg50D2RCU7/xit3h7h1WdMqxcUG3lLSHglH7X QV9FenAOdWsPDEU0pLuzcOHG93+e6S3RJ0OvDUqpW3SONpHzqRRh/0yWN QnliSs1p2yyUOrHz7tzmD2JzpT+Dner2S/ghLhOsiAd+n3dZffcgsUORB rjk5Y9qOqTz3C8vQuTX/p8j9jWl1d8zaIvTXCe8teYDf+w+NTcevm1PnN jUEgltbt7Ei0zzkFbH+NzFc1WicD3yysYe9vWbJE8eUww18vyd/a6lT8B MOgJIJuV2UrXTmEw5hpvWN52abJhM4ATxJPU++IBXN79dDBbfzwUcx8fg A==; X-IronPort-AV: E=McAfee;i="6400,9594,10337"; a="267422323" X-IronPort-AV: E=Sophos;i="5.91,198,1647327600"; d="scan'208";a="267422323" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 10:02:02 -0700 X-IronPort-AV: E=Sophos;i="5.91,198,1647327600"; d="scan'208";a="562814255" Received: from jrhamric-mobl.amr.corp.intel.com (HELO [10.212.121.177]) ([10.212.121.177]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 10:02:00 -0700 Message-ID: <52541497-c097-5a51-4718-feed13660255@intel.com> Date: Wed, 4 May 2022 10:02:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: RFC: Memory Tiering Kernel Interfaces Content-Language: en-US To: Wei Xu Cc: Alistair Popple , Davidlohr Bueso , Andrew Morton , Dave Hansen , Huang Ying , Dan Williams , Yang Shi , Linux MM , Greg Thelen , "Aneesh Kumar K.V" , Jagdish Gediya , Linux Kernel Mailing List , Michal Hocko , Baolin Wang , Brice Goglin , Feng Tang , Jonathan Cameron References: <20220501175813.tvytoosygtqlh3nn@offworld> <87o80eh65f.fsf@nvdebian.thelocal> <87mtfygoxs.fsf@nvdebian.thelocal> <9fb22767-54de-d316-7e6b-5aac375c9c49@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On 5/3/22 18:31, Wei Xu wrote: >> Well, x86 CPUs have performance monitoring hardware that can >> theoretically collect physical access information too. But, this >> performance monitoring hardware wasn't designed for this specific use >> case in mind. So, in practice, these events (PEBS) weren't very useful >> for driving memory tiering. > The PEBS events without any filtering might not be useful for memory > tiering, but the PEBS events with hardware-based data source filtering > can be useful in driving promotions in memory tiering. Certainly, > because these events are not designed for this specific use case in > mind, there are inefficiencies using them for memory tiering, e.g. > instead of just getting a heat counter for each hot page, we can get > events repeatedly on the hot pages. Also, I believe the addresses that come out of the PEBS events are virtual addresses (Data Linear Addresses according to the SDM). If the events are written from a KVM guest, you get guest linear addresses. That means a lot of page table and EPT walks to map those linear addresses back to physical. That adds to the inefficiency. In the end, you get big PEBS buffers with lots of irrelevant data that needs significant post-processing to make sense of it. The folks at Intel that tried this really struggled to take this mess and turn it into a successful hot-page tracking. Maybe someone else will find a better way to do it, but we tried and gave up.