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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF979C54E64 for ; Thu, 28 Mar 2024 05:23:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B0C86B0083; Thu, 28 Mar 2024 01:23:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 560D06B0085; Thu, 28 Mar 2024 01:23:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44FE16B0088; Thu, 28 Mar 2024 01:23:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 277206B0083 for ; Thu, 28 Mar 2024 01:23:59 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B4ECA40F7A for ; Thu, 28 Mar 2024 05:23:58 +0000 (UTC) X-FDA: 81945306156.04.5701688 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by imf23.hostedemail.com (Postfix) with ESMTP id 8DF0E14001A for ; Thu, 28 Mar 2024 05:23:55 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Pv+LQRYz; spf=pass (imf23.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.18 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711603436; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qiIHwS+DWyMQFUv+SnnofSpYrPhq//ieYhba2iIGqLU=; b=STWY2iUkLLp8QkTSvMGKWWJUC7ORGpdAO3ViceUxUSA1kSsJR2v7lsSEK06tZc7RgVEAjE 1xA4XNlS5r+vn1U4bqQB2wh7Fi1LIoMXWylu2S0UhdqK2jASce5rsKVGMA2hrTfVX7nCSf OjPSNFp5e7jlfT8nF+Rm6ibTfwgbC+A= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711603436; a=rsa-sha256; cv=none; b=yKEpfPqidKMCiWbtZiL/4BTPyv8D9imNYmiaRsf/4sEBw6PJE/m2sLWmRtr8+1/o3Apw34 8GHju0Fi2H227hEKnhYZkEgvMjt5mmVLWkdjIqMe6Gqqvpo9z7tNP+UFkfJLLqbF6qkZHq yiiTPzPb6+mDKeIjh7yOkWzl1zQVNXw= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Pv+LQRYz; spf=pass (imf23.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.18 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711603435; x=1743139435; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=lr3vnsOJwKQS0Kkh+w8aXgTiGji+fdCT1durYgzHSYg=; b=Pv+LQRYzHLuPV0K/DopGZC7bFQsraFWVttJVsbWz7Iz+F9e+indwpIjY rW78NlwP8JwwepbF9BgcbjuuLDvVCsJTJMRhoIhjoo9M3GL4YQVPUwY7w GlrIu8DS/A99cl+BikrWCASddZL9m61Jzit27ZwetpOY9CSPH180REO7J XtZfkrePYXKPIEH3sSbnkIIHJkuS8VSqAff6eWG+bCiq2BLOs6ckQFF1A dlvScQOV6HltxMw5E+LfW62qWzX6bGqpoXXFvWrAY+SiduFU4GF9cfxFH D6sHmlYaBsSiKw9FHdKRgCr/wzCzDaRqjEx2Ng4Adwj/+0winfA0HnHzu w==; X-CSE-ConnectionGUID: TbxfkKrxSkm3UGTM/QMH+Q== X-CSE-MsgGUID: XNVaxGMNS8y3Vkvyt/MRmw== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="6868366" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="6868366" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 22:23:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="21247737" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 22:23:52 -0700 From: "Huang, Ying" To: Bharata B Rao Cc: , , , , , , , , Subject: Re: [RFC PATCH 1/2] sched/numa: Fault count based NUMA hint fault latency In-Reply-To: (Bharata B. Rao's message of "Thu, 28 Mar 2024 10:09:50 +0530") References: <20240327160237.2355-1-bharata@amd.com> <20240327160237.2355-2-bharata@amd.com> <87r0fvktkn.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Thu, 28 Mar 2024 13:21:58 +0800 Message-ID: <87msqjkk21.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Queue-Id: 8DF0E14001A X-Rspam-User: X-Stat-Signature: bmbsjihbzxr9uaf8dfcz79bo6md8c7as X-Rspamd-Server: rspam03 X-HE-Tag: 1711603435-183650 X-HE-Meta: U2FsdGVkX1/czP3WhtqDH6FzZ0MbiHPMLQTs4gXVPqf0pTo436DRYKuFbb1SvtSvQVtSs+LZsW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UiIUuEmBU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Bharata B Rao writes: > On 28-Mar-24 7:26 AM, Huang, Ying wrote: >> Bharata B Rao writes: >> >> [snip] >> >>> @@ -1750,25 +1753,20 @@ static bool pgdat_free_space_enough(struct pglist_data *pgdat) >>> } >>> >>> /* >>> - * For memory tiering mode, when page tables are scanned, the scan >>> - * time will be recorded in struct page in addition to make page >>> - * PROT_NONE for slow memory page. So when the page is accessed, in >>> - * hint page fault handler, the hint page fault latency is calculated >>> - * via, >>> + * For memory tiering mode, when page tables are scanned, the current >>> + * hint fault count will be recorded in struct page in addition to >>> + * make page PROT_NONE for slow memory page. So when the page is >>> + * accessed, in hint page fault handler, the hint page fault latency is >>> + * calculated via, >>> * >>> - * hint page fault latency = hint page fault time - scan time >>> + * hint page fault latency = current hint fault count - fault count at scan time >>> * >>> * The smaller the hint page fault latency, the higher the possibility >>> * for the page to be hot. >>> */ >>> -static int numa_hint_fault_latency(struct folio *folio) >>> +static inline int numa_hint_fault_latency(struct folio *folio, int count) >>> { >>> - int last_time, time; >>> - >>> - time = jiffies_to_msecs(jiffies); >>> - last_time = folio_xchg_access_time(folio, time); >>> - >>> - return (time - last_time) & PAGE_ACCESS_TIME_MASK; >>> + return count - folio_xchg_fault_count(folio, count); >>> } >> >> I found count is task->mm->hint_faults. That is a process wide >> counting. How do you connect the hotness of a folio with the count of >> hint page fault in the process? How do you compare the hotness of >> folios among different processes? > > The global hint fault count that we already maintain could > be used instead of per-task fault. That should take care > of the concern you mention right? I have plotted the total number of hint faults per second before, and it changes a lot along the time. So I don't think it is a good measurement. -- Best Regards, Huang, Ying