Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp214940lqh; Wed, 27 Mar 2024 22:24:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWmVmxtPoh10OBqkx8ebDtDVdDnozisVZazqwL1QtyYUZx6OcCKrK1pDnx1mqocwYZWVVj5HLDKyEtYaEvCXfufab8t2Ao5jgM76dWmQ== X-Google-Smtp-Source: AGHT+IEmcC8dqeIye+JGmtWoyeypN6kjPXB0EQBR6Kn8vb0j+Fg+5plmse8nabqRCcsRx1CcokWv X-Received: by 2002:a50:ccde:0:b0:56b:f5ae:ae58 with SMTP id b30-20020a50ccde000000b0056bf5aeae58mr1251427edj.29.1711603442767; Wed, 27 Mar 2024 22:24:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711603442; cv=pass; d=google.com; s=arc-20160816; b=ztwtvtfniJGi2Q6/vBECb9KRCOu+Zavb/GQChQoj2OZvSr/stZy/U6978CoCT9I3Kj UQbB5zXZyctBR2UIXeAmKR+5/xVNiz+VVHAPkBoktHGn8e4v/0SDPIKiS+6sG5ngMnGD J6xjFABQr8KjRTJgMXzY7iD6P1ETbr+W2R/TO95E5mzAOVGX2VMsMmSzxud3T4Bg35ZY EzRQ1hIWgrIJVVJNfbfnrTC+wZmlcHx6ON2PZfm3U3610RBE6/wicq4rAvlJu+413eCD cuxNOYy+wsEkPrILbBvdUDaxkjCipm+eGrvM++vNxwLTXjHJCuKdjsUlwZssnDTUzPI6 uIZA== 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=qiIHwS+DWyMQFUv+SnnofSpYrPhq//ieYhba2iIGqLU=; fh=7k6QPw5BlXJGFuv/bRE7oOlyLHFUso6GL2Y7TicGH8E=; b=yP1Eh+u8UbX5GnClyh1V6BNyAKepIWarRMCA3w+RF03Hf1GlzD/gAikak6jkJDDUdN qp6Vhbu0yzzem8Xa6/6iIBwNNtBVYqgn5y/o3lTOyiTILajexAuHf9qFDtxGLVXIet0y JxIas1BUDreuFrr8/FO4SndGj5z//xXz1835GYiI3OURC2+3s0CcauZ7hpD/Q05SaJDH hQ/E9/vFTTIRjXyfO99/b0EgM5BBS66WCVJBe7eYj998W3NjcIC/pMuCuz8j7oxQ8/k3 sIZKYIwGTIozrL/N/kK2Nnw38oiIeZ1827kO+yvMa5+qydGbCKRVd5YPNveX5HIgI9KB mx8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TjCBogZL; 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-122422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p20-20020a50cd94000000b0056b9664d30dsi384284edi.594.2024.03.27.22.24.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 22:24:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TjCBogZL; 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-122422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122422-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5FE3A1F2352E for ; Thu, 28 Mar 2024 05:24:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FC1640861; Thu, 28 Mar 2024 05:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TjCBogZL" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 ADE2AD304 for ; Thu, 28 Mar 2024 05:23:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711603436; cv=none; b=UzYALGjIrtFkb3eCvJYUiFGMLr1tAsWNws7r3nV/g2oBY317soXYk0oLYDPqY8LnWZOLzMsiYs2cjrUO13wxW2xcFS4A95A8z8R+Mp514xWyyqtzNUAi6W2GJKJTwpkKAPblyX/8Fm2akDU/FndMJ/XmqkArfK/KbjBf3uUGS9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711603436; c=relaxed/simple; bh=lr3vnsOJwKQS0Kkh+w8aXgTiGji+fdCT1durYgzHSYg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=eedqYf5mHj4J9aHeoM+NUYqMy1Afiz6/wa2gWo90rf3dwHtw9GFXrKZtZ1pNnVn4x/cV3HJlk4yVyGEIaWKnqWIrzaev+fiDjqlZH3skHpnow3OwGG5n7tNFsxo/l+uwtQJHopLPFpAFf2YjC9WRbP555+IaqEzbfKuNrrpCSIQ= 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=TjCBogZL; arc=none smtp.client-ip=198.175.65.18 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=1711603434; x=1743139434; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=lr3vnsOJwKQS0Kkh+w8aXgTiGji+fdCT1durYgzHSYg=; b=TjCBogZLTeHQi5X2REf3ZywBhSFsZcTRsLSxMyCCyN6uLCiOHKheYLPu tse7owqGoI+RaYs1wHn5FOJgoVNagWB00PNwrdXuKHV1T8CU6T/ktU8sO 5U31YWLQn9x5gKHfHB7ajKSW+rRHBr4cb9lF5YJ8by19hHT0w7oAjcdF2 zvtes0HSJgpwVL9Pof+ki8rmGTtT+v8Gw9GYR8b7qP9AarYNljHiJY8QF aUqUKL5woI1jQEY6Qpp2Vzas2L/steN2cDcngQoaEooD6M6SeqMhPHWVI xnto5oSA8fEDOjEu3pILkvsjbEKoG3c4QCM2HxkFi6alRWf5OjmZLS8HE A==; X-CSE-ConnectionGUID: ulDs/qFtQ+uqyk3l6j9NfA== X-CSE-MsgGUID: uA8G5ohYQXygjZZa/EIpYQ== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="6868370" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="6868370" 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) 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: > 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