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 40F6CC54E67 for ; Thu, 28 Mar 2024 01:58:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B02516B0085; Wed, 27 Mar 2024 21:58:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB2C56B0088; Wed, 27 Mar 2024 21:58:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97A2F6B0089; Wed, 27 Mar 2024 21:58:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 6B2896B0085 for ; Wed, 27 Mar 2024 21:58:24 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 23CC51A0E78 for ; Thu, 28 Mar 2024 01:58:24 +0000 (UTC) X-FDA: 81944788128.10.C422C03 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by imf12.hostedemail.com (Postfix) with ESMTP id BE04C40005 for ; Thu, 28 Mar 2024 01:58:21 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=U2x6kyes; spf=pass (imf12.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.14 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=1711591102; 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=5g0PsgTr0wFnVeC2w2z/y2qudouLxDyu9MnDHCQq8os=; b=g+1vduW3Bf0+/y/NyubFveGd9h+tsBpzRxwccHcBnnfiOvn/BsqxcfYdVKj8yTkzOw3+Yr laz6kDWirdEW1PcNLilpvHaPbQzwysh0/7wIQeqlWfzT2IiG6DKdgwC4uELvY8fEjlHRkb KGZvugHVLhRjxCvYBqTb1Zd47VOXKMo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711591102; a=rsa-sha256; cv=none; b=ygDRrPZmpaoYYIkqTdCyU5nl5qnodLHpIIaD57rlcDE180594GLwShciwpVwP1shteGuLZ 5AekMIYFBFFcrMgZMmYDMdV+c4OJC2lLwYyBT+cz3FpSnw6I42/Vljg2mlzyNCjYjPvQ69 Sc465Z+SIhFfBC3eNBgudXSm1ciOJo4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=U2x6kyes; spf=pass (imf12.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.14 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=1711591103; x=1743127103; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=5MbqHnqaARWljlVlxclPNn7WRcRf2Q/HvQgsbE3BT4M=; b=U2x6kyesQvx8Ioxcd+iUO7ptic/+kDqXl7wePPEXgSRPEMOupFqBhhbp zU92IM0ijfnK/KnE3s2DcZXFb6fdmc8BZC+mzxJfm4Q8jlxiGWkMTTuWE d0pKGQmfdC6UCOrbKc2BCL8co/UsMYvsEZMKBDZYYMrSAjB5Nms/nzu5B E1pLhTRjg4fPqJF3OlDglieitl2fNgpZQukzbF3hhgusZfhEnIhIgTKxX Zaw2F+mwLgAhxjc0X4yFNGtJUKfH31VzrT244f3fUuZNfoSzaFlBjBeQQ xOqLjv8Cdzh77aGh9WzRe20SurB5F7BjYR1TqsNnfGEeaiWiRs8JpCmDe A==; X-CSE-ConnectionGUID: t3TrhgK0SSyYb0HAsmUj6A== X-CSE-MsgGUID: mFj+hkmBTZWjyRnslLXcqw== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="10517384" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="10517384" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 18:58:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="47476595" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 18:58:17 -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: <20240327160237.2355-2-bharata@amd.com> (Bharata B. Rao's message of "Wed, 27 Mar 2024 21:32:36 +0530") References: <20240327160237.2355-1-bharata@amd.com> <20240327160237.2355-2-bharata@amd.com> Date: Thu, 28 Mar 2024 09:56:24 +0800 Message-ID: <87r0fvktkn.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: BE04C40005 X-Rspam-User: X-Stat-Signature: eq8i1mg7p4g3htrgqfn7pnf7bgjseuxn X-Rspamd-Server: rspam03 X-HE-Tag: 1711591101-966695 X-HE-Meta: U2FsdGVkX19OIh2SBXynB9JP5uOy+2K6U5DDQPv2Kq37LWo2AONl0vN5Pckr4K1ZWFPri6PDco0O6x1IfISwRs4yfO5R3njkkjhgMVwVcz4wx2PwcNNb06zAIg3Y/7yKeL51RgMceG/OFZBnqnh1OyqfSjgbQjuJpXwPjbXK34lCyNzOBMRonaOYAdDvau/jOe3Krw6ESHJeI9y5AjjZ8OAmSpB8RBKA/WDgXaOP5Lo3qh4esv3P4wSovaUwKi0noE++0UtQM260LWmwkM8XRm0Zu9FY5aOMbUUUI6m89aMqIdafG/3j5jwrxTFhcv4VdW17DtNOj0UsM5rcs0ux8UEFSKxpcYe2NBvcPiP+IvjcNhalVm3XnV+02GopcG2pSAZ1zV+G+Ca9xcYXeS5G8TcJ9vLkKTWQR0BmvnYzK1WBW2Fc/rYmv1f633ojuj+d8KMIshklxuXCyRkUoPN1rNT0oTKbGUjaARmNKlcWh0O4m2aKjdLll49ALlXphVlgK7EEBxmS9ISVGlp4aukcmxB8p1VDu19GLmQwEAcWkDyL1oHagjLzLZPYybXyjmHpJPxvV/FqdqsNCw08Zw55C6/8afrlJVd/EQMW8VMJn/yThMjMBlyxUzZYZ6Bx8Xc6tUv9kPnnktnscPlkPcv4FlM3y5uJGlVsGQwMTc6i9hhKDf0ae22xVQyk95daQllkWTsgiYVcsIznCfyt83IakR1wJdHUzKU76NU/KGwVFhqG+kGIGKRYD3M7YRoo1/1njrcOAkrP2U5EsiHxDqGeemjuQXWdGeTsh2LEUZGftl3CGdivThgamzNwsb7wywa8dzgLZdiirukO6jStsf9snV0LtYWRumIB 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: [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? > /* > @@ -1794,35 +1792,6 @@ static bool numa_promotion_rate_limit(struct pglist_data *pgdat, > return false; > } > -- Best Regards, Huang, Ying