Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp152704lqh; Wed, 27 Mar 2024 18:58:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHYVx0Dqafufr3ofzjSYUBHJCCU88+6dUd4Wr3v4KFmJFkS55rGYB9w3Z27USAXZU94ruveo9MQPF0vJJFlN/iKcJWVGZ/UZr0WLCR4w== X-Google-Smtp-Source: AGHT+IEJEbPM25LLwwuC0BXDBikNuFnZX2tqPFIuX8WjubatgZW5MOkzI1jDRp1XqP6+p+KhbTCq X-Received: by 2002:a05:6a00:cd5:b0:6ea:89e5:99a3 with SMTP id b21-20020a056a000cd500b006ea89e599a3mr1811026pfv.8.1711591122272; Wed, 27 Mar 2024 18:58:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711591117; cv=pass; d=google.com; s=arc-20160816; b=n/qXxoDsM5DcdhrDeSSkU5tbaUAr8nUFG+Qx7SwtXozk8GvObBK1nXGpcgkZ8c2NkP vE4wO6yS+wfsAKl/CKgDqj5jVQ/Mh17e5SAvD3lVgCZ/AvWb5m8imD5TGE/KYZOTRfIa d3vAM4rq6U7z2xYegKqNvdLaysaICS5AzrhEHx5RRGA6g7BVKcid4B51IUdtbnGybwpc 408fZ/5r7Yw9UJWgqHz7pHKjXGxZRQXYRc0jirdhy+5AkAzzrikbqHQvEZyiR2530CH0 hH4ej17VXQKp7XhLFdeF7AJBbuTOLUcuJfu5GJpEw3iB5P/9fHL8C2DrzVmqNHJYD5pY iCvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=5g0PsgTr0wFnVeC2w2z/y2qudouLxDyu9MnDHCQq8os=; fh=7k6QPw5BlXJGFuv/bRE7oOlyLHFUso6GL2Y7TicGH8E=; b=RJYdb8KYY+X0UXFPhSNcVmlpC7ue/nnqAV9RJXMEb6kbIPkFvcUK5vhk4P/Fh0pRjY OM7/tn2Vp0RP0omELuse9qHx/aAKD+138xu7XBuiVoVnZpM9J9Ag3n4ADUC8RbLK9OQB q/ZYHP86nDrGbSdv+nA8Uf/3zC75uQnK5upoW4RNKDn2YTM14eIfTsyuXUHdqEsaJ/lI wWs8b0Mh8wUl6okUH3dDUGwWyNZi7PVHRRvV6lh/WXtdiPsn47lEJACnOKsNwt22LFhl cHzN011PB0/NvPQSWdoT4/vINdYzBwCs4UBvPQriLG2/e2REKb9bvKEq9QQAbWHFrhmY olZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R2PCkL1R; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-122312-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id v1-20020a62a501000000b006e6b57ecdbdsi414381pfm.82.2024.03.27.18.58.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 18:58:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122312-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R2PCkL1R; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-122312-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7A40BB23550 for ; Thu, 28 Mar 2024 01:58:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D01E2374E; Thu, 28 Mar 2024 01:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R2PCkL1R" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFC588465 for ; Thu, 28 Mar 2024 01:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711591102; cv=none; b=qc4u8aJXyrh/QqA1dI5FYErWa4iMYD4ScKLi/FPblEnlC9Jz3swOVteVNICI9+rL5UKL4sTF1+MXLc54i5ZwjA7OBjx2bRsBM6ZyryFx5WsuSguyHGB6d7Is6rEyWCGb2gqk8ppYwMC/5rZKzrMoCTt29e2njNiAZJj4bPJ3CtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711591102; c=relaxed/simple; bh=5MbqHnqaARWljlVlxclPNn7WRcRf2Q/HvQgsbE3BT4M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=hLrTR2yrZu8BsRuFcd4yidHiVUrKhGxTGpY4ekzkuz3krYAUeWKERNeEjBZvRVJeHLj9duB2cRG4KKDYH3iAmyeBRxzlnGZdy93c8mx7GUhJupFanDjX+GZEPM+TKOS2J5uIIabQKNgFT7zGhivyQ5YB3+CltUASgn9BAUkZHZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=R2PCkL1R; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711591102; x=1743127102; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=5MbqHnqaARWljlVlxclPNn7WRcRf2Q/HvQgsbE3BT4M=; b=R2PCkL1R6+ZG+1wohgrP9Jb0H8yddJJWMcRw0YB58KGUEIQOrd6NIFSF up/Z0cq+nj0w0XLVZE5l1wZOKSpJyKYLKjPF3300Of9LongkHNaLEbtBi gBtFu9xDIl/y9uxijwnOxcADJuEy2q7lCYfYODsVhWo0q0HYNyvDKgPxM yDHSsE7Bs+deK15DuHozZNZq14k1dY7/X4Kdx1p1Fuwu0YlVF5Upf/zUe G+s+8oGlPgJr7CW0o73elLV3r8eb97Z2etzDcAZ632KanTccaMLq8G2TB 6riNEJ3lcShoCCDwjrADzAcwh6tTY8nz5EwNfiQ1EoATDLYw6ZKNEoGgm w==; X-CSE-ConnectionGUID: zIY5qAEWSruTcHAWo7yQBg== X-CSE-MsgGUID: w4qhIX98QB+lSRQ5/0sDNg== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="10517383" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="10517383" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ascii 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