Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp218997lqh; Wed, 27 Mar 2024 22:37:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVONFYQTCyhDfH67YVS8ipj68x3ZfpSXtq2ln7I9+wGjb5b+qcZdWJf9mnGVdIQdNWYfEPbnOKKtSMRAbR3hnDUYzWOV6J11KtV6/1YQ== X-Google-Smtp-Source: AGHT+IG2Y1jtfOUzQKosQD0XMPXW4J+iDWQvgbRbndN0Ya7PSsl6b5XoIcFHQZljWoJGwqTTVzzZ X-Received: by 2002:a17:906:4a8f:b0:a4e:2231:348d with SMTP id x15-20020a1709064a8f00b00a4e2231348dmr462814eju.52.1711604269430; Wed, 27 Mar 2024 22:37:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711604269; cv=pass; d=google.com; s=arc-20160816; b=LFWLRxssL6qJYI18tfvk0VCmyn0NgHsYCTDT4LLxBEfIRzodv9fmsFvSXqgROXHt0I 6dqFxrMFdzqgGn/6UXQ22EzaaGfY3yON662xwdPBmvKUEp1w3FYrEzNGTm2MuHJ8fEVQ GzYpl4b46DJVGThxEDqTYTTkkhbV63V71mvDVmnTt2ZJNXlWI6qd4LR41i5D8l0dmaGf NTpTFSzXOzE7kk4Qr2EF5emIRTiou/PqRGgKA10PWELa2JRQPI5ZrvvkyPYRzFpNz0uU LSIWQpYwiozY2G8A6Qra36BoktVy87HqOdXnN/YkK6HxoWXYFcYWIwkNr2HctS9inOrX aGDA== 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=XiAmk//C1+jMPk+ZLi5lzMjZZ6zTKsxIFk4uq0FhAu8=; fh=7k6QPw5BlXJGFuv/bRE7oOlyLHFUso6GL2Y7TicGH8E=; b=yEGlv5IHvOIVeGBDWpSRIlYVMszZkFBUWCVybIu8JqomttjjfUufqKEfz94YY7N6+B CHx+anf3EROqWliOCZhVBFY7yBYrWONZT3602ISuSoWGrBbzLEBng3TJs3jLRVIoq0HQ 7woD9bA3Jl3k7kgsgBuEwIT0qhzatSwEhnlCGuXU/FImzh/K9UYUDy7agm8r+czAM4Bm Ddp3FCNmM1ujE1bXnkadefvgP3j9rJknuU8b6VobCsKapyRQ8cYmVUTZOqzoQhYs1gMG kZTgyFSyxtu/yfWjvMdAhEjp9RnCkzTyeU1Bh0wpSJvHPN4lSN5Papjp9RZogYah0flX KhIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ngQC02l1; 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-122430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122430-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. [147.75.80.249]) by mx.google.com with ESMTPS id ov38-20020a170906fc2600b00a46e00610dfsi318334ejb.322.2024.03.27.22.37.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 22:37:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ngQC02l1; 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-122430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122430-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 2D31B1F243CF for ; Thu, 28 Mar 2024 05:37:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C646447F69; Thu, 28 Mar 2024 05:37:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ngQC02l1" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 5BF1D46424 for ; Thu, 28 Mar 2024 05:37:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711604261; cv=none; b=qh8wx8NFazzWWtDV9GEq7+/3W5anUhtFMYWi5xxiQ8nVilewCaWz4oCBKIEqW+vCyqg4Nkskpmm6FfBn91/WEXmi/CXMrmSReSM/Y9RbC65ZHLdzb9uoiMEY5PPfhH5eOZZq/dkNnNORd3Z6sv1KKEv6ITKrXRx1bDePlD3c5qk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711604261; c=relaxed/simple; bh=I1zV8l2wxGw1MD2JHTbYzY6hhxw7196Gef6nl+ubcWg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=XUTWaxikwSdYJn0xY3b/uIL6qU5msDlCuP6Ug0hqBaRc3EoF9O3XQ9OCRl8EmP154GWMMnvvqf1vrG9BoXNDxqQnV3Yqe/oJmlxxv7rAvf80KELQVmqpYFo+BxiQIVczMKYS3wgtbZi2EiGnrpJLKmRw0s/SHAFFIErw9rrnRoM= 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=ngQC02l1; arc=none smtp.client-ip=192.198.163.10 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=1711604260; x=1743140260; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=I1zV8l2wxGw1MD2JHTbYzY6hhxw7196Gef6nl+ubcWg=; b=ngQC02l1/HP1+ipq3fwjccUwlwWVLGLFoogeAIAwkUOrVrR/Dy7UqHCg FYOCjV6MqjTd7z62Yuk+bGCMWYXF8fA8mp+OoZ2xQHSfNebeK7j7/E+Ny 6PkyEAPIiq2FVaaAwwuB+iBNo+JFJUKszgs+W1Axp4/f5YkImapQPIV9c lkc5gM+beIApjsAD+blSuCL3vEe4+boPkViP9t3I3vJ/JhKUMc4tjZunA qvmd3jP+Ag1o48I0rWG5NY2azd+ScRfHur9366541TgDBdzspmFArKWvP 7426a67YxHk7G869MgaVIPBVUOTe3RJZ0oTKPzkOfg4BzYxhxavTu9Au6 g==; X-CSE-ConnectionGUID: M6TAfwOxRnqDuI2HXuDH/A== X-CSE-MsgGUID: QF/2cYRuR0ONyhnyp16hQQ== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="18122846" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="18122846" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 22:37:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="47732570" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 22:37:36 -0700 From: "Huang, Ying" To: Bharata B Rao Cc: , , , , , , , , Subject: Re: [RFC PATCH 0/2] Hot page promotion optimization for large address space In-Reply-To: <20240327160237.2355-1-bharata@amd.com> (Bharata B. Rao's message of "Wed, 27 Mar 2024 21:32:35 +0530") References: <20240327160237.2355-1-bharata@amd.com> Date: Thu, 28 Mar 2024 13:35:42 +0800 Message-ID: <87il16lxzl.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: > In order to check how efficiently the existing NUMA balancing > based hot page promotion mechanism can detect hot regions and > promote pages for workloads with large memory footprints, I > wrote and tested a program that allocates huge amount of > memory but routinely touches only small parts of it. > > This microbenchmark provisions memory both on DRAM node and CXL node. > It then divides the entire allocated memory into chunks of smaller > size and randomly choses a chunk for generating memory accesses. > Each chunk is then accessed for a fixed number of iterations to > create the notion of hotness. Within each chunk, the individual > pages at 4K granularity are again accessed in random fashion. > > When a chunk is taken up for access in this manner, its pages > can either be residing on DRAM or CXL. In the latter case, the NUMA > balancing driven hot page promotion logic is expected to detect and > promote the hot pages that reside on CXL. > > The experiment was conducted on a 2P AMD Bergamo system that has > CXL as the 3rd node. > > $ numactl -H > available: 3 nodes (0-2) > node 0 cpus: 0-127,256-383 > node 0 size: 128054 MB > node 1 cpus: 128-255,384-511 > node 1 size: 128880 MB > node 2 cpus: > node 2 size: 129024 MB > node distances: > node 0 1 2 > 0: 10 32 60 > 1: 32 10 50 > 2: 255 255 10 > > It is seen that number of pages that get promoted is really low and > the reason for it happens to be that the NUMA hint fault latency turns > out to be much higher than the hot threshold most of the times. Here > are a few latency and threshold sample values captured from > should_numa_migrate_memory() routine when the benchmark was run: > > latency threshold (in ms) > 20620 1125 > 56185 1125 > 98710 1250 > 148871 1375 > 182891 1625 > 369415 1875 > 630745 2000 The access latency of your workload is 20s to 630s, which appears too long. Can you try to increase the range of threshold to deal with that? For example, echo 100000 > /sys/kernel/debug/sched/numa_balancing/hot_threshold_ms [snip] -- Best Regards, Huang, Ying