Message ID | 20230927095002.10245-1-ravis.opensrc@micron.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2517245vqu; Wed, 27 Sep 2023 03:08:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyt635SoRJb+tRUSgbLZWau4+l7IRdhuui2TRBrYdVs5AyOAy8qt0IEQpGJeE570qbDBuj X-Received: by 2002:a05:6a00:1ad1:b0:690:2ecd:a593 with SMTP id f17-20020a056a001ad100b006902ecda593mr1771351pfv.26.1695809307809; Wed, 27 Sep 2023 03:08:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695809307; cv=pass; d=google.com; s=arc-20160816; b=wL37n9BCbVVQGMyAOMv/0kzlETToQfoM6Rmg7o5UDyRv1qNdSO84KE3a39gq7LysI3 Sz7wM/FDTptQv+PWvKEBRd5p4KWNKrVaPEJOgPnOKjs/+2Ed8jVXR6hhxUjKRGlIMamp ogNTEXbYrqZTXmid/iMbMLnmZELew3VdcUKt5RZCkWcGr+0OaztRVbzII7iwuYntKywT +XN2v3UssuWndxdYwYijJ+/6RwwBXqi5jpy+VCpfUDZiM2sXzLiJ3uh+JEIqSSGw0mfp 1zURgooFuiVUK4ZkVs4TxJtHP0vkeF741lrXVJttkcEbz7GuMTLZ/kTGGO8ABTXaaaXX 9ASg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6a9/12WgCgZMTWXMzVNEZXcO1CrVBtcJsx8yF/T3UpA=; fh=Jzg+gUVhe4Nii9xKAH4ipqbRyrGF7n1ZceEI1CmDRcc=; b=J5ID71SgMdjqnIrMBER5SnW5pKUHQJVOhD4HAMllrs/R1KrNO2DDz+XeCARS6IRoMI 2vjsoMcEd0DGG7RAEz7YjvTBl0cgj+6y2oASgCk5UQjo+TkSDch90oxxodvg3Z65xxsz vGxaf3E8nqcVTUfQ4I3DrHCb2L/Hy/k5oSTJmFNy1lzBsRScjMxDhO2XytV+XugKtP/e iINe8GiwXAlbDcbRc+qR7WAGgZ2S+y2+D35nqRK9yci1HWq5mgPG1ZeK7u4SPSS0PXCI bOsuRLmYgZ3LLkD9YyKVrIq75J5xLOlK10ofOKzYtx9fAHV1lwPBn56CYn3VwSIb7ojA o/BA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@micron.com header.s=selector2 header.b=UQdLHMma; arc=pass (i=1 spf=pass spfdomain=micron.com dmarc=pass fromdomain=micron.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=micron.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n50-20020a056a000d7200b00690bc21d900si14312945pfv.136.2023.09.27.03.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 03:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@micron.com header.s=selector2 header.b=UQdLHMma; arc=pass (i=1 spf=pass spfdomain=micron.com dmarc=pass fromdomain=micron.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=micron.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 22BC9820E502; Wed, 27 Sep 2023 02:50:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbjI0Juf (ORCPT <rfc822;pwkd43@gmail.com> + 22 others); Wed, 27 Sep 2023 05:50:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjI0Jue (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 27 Sep 2023 05:50:34 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2088.outbound.protection.outlook.com [40.107.94.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE1121AE; Wed, 27 Sep 2023 02:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KIPQ/7x0jHokAt0F1xeeAEzyBqiGQLFAwnonjSlAFA76eVhOAj+uWssArci5hjiIjh8Tz5WShW1fjJ0p+8nretNIUYA7E+tDYS4HnIOEDUxiPHYauKbjdkFiOHhP8VDx9EhDTJk22BDBSNdNAOGQXT/1cUd5fKQgHho2NlqWmil1+eBIfH2QfnMRCBNW8tYzi8Z7aqcy+fkn8E98KaNmNcrKaJs86SZ5+QUOyiGx2SAFdYXoeGPAKf318wWASOaxL1SDO1vg0WCU/0Mz4uqH3XMQDibRgEQb3TRke1yzxXefHkmd3ek1NX3iSr7pUOAW5Uowyd6aHx8Vzc9IDRsnnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6a9/12WgCgZMTWXMzVNEZXcO1CrVBtcJsx8yF/T3UpA=; b=lP7Q13zdqcL2IWTl+TsO8C8goutCR5vHL94zO29xy/UOowJDO7GJqr5ZEIer5A+Uea+FeeDgzSN1SwuPPf4FBN6wmIv65Z6HqvG4Wb+h4qiJUeGEKeljmPJY6eZb5P4NO5Cd9TjyvyVHLUP/9BCfVz2xBpcNPlXx/uMwUIF4ibI0lkAKslyKgxgx6FMZ80HZoaNLIP1Q5+51SFuSS733l0sbpFGyM5RlkV/TrNMMl4LYhOe1jcH9XAq5REoymWPaQDrQ9Z2oMcNUpKFr3GAiVcZvhg8OVuDVfcXq9gzx60fAtOTd0AP2lrutUZSsVPQTREioHTm0UjTOcl5hvi3ULg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.201.242.130) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=micron.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=micron.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=micron.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6a9/12WgCgZMTWXMzVNEZXcO1CrVBtcJsx8yF/T3UpA=; b=UQdLHMmanbNFLFmggey3pyKi0+B+MUIjhFr8FM9N8hgoVKsIdRFbTT3qwjSGkzihoM1alHsSn+oIx4VoIURpI+LaHoaRmpVv1jw46RAS0BHZKfzMpmHR6oULiNrjWlFSoXWsT3R5TL3+DRg2mfcQhcauRA8gfE3eVHDyuNmaU+JmTWAc0Z7Fzx1U08XeA2gWCuWfy6mYh2QL5y8aeZR1zxdfTe0qLL7TK4snKqDDJBugyEQxbZX8oL0BrJzko5tsgtTCwPhNeM/VUQgLHPrMQR/K67OJPUP4/UvYHt+2Icb181A0MAuwM+S8B+kFRFVYtXDjksPx/srd7DW1T7pP9g== Received: from MW4PR04CA0218.namprd04.prod.outlook.com (2603:10b6:303:87::13) by BL3PR08MB7300.namprd08.prod.outlook.com (2603:10b6:208:353::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.31; Wed, 27 Sep 2023 09:50:26 +0000 Received: from CO1PEPF000044EE.namprd05.prod.outlook.com (2603:10b6:303:87:cafe::6d) by MW4PR04CA0218.outlook.office365.com (2603:10b6:303:87::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 09:50:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 137.201.242.130) smtp.mailfrom=micron.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=micron.com; Received-SPF: Pass (protection.outlook.com: domain of micron.com designates 137.201.242.130 as permitted sender) receiver=protection.outlook.com; client-ip=137.201.242.130; helo=mail.micron.com; pr=C Received: from mail.micron.com (137.201.242.130) by CO1PEPF000044EE.mail.protection.outlook.com (10.167.241.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.14 via Frontend Transport; Wed, 27 Sep 2023 09:50:25 +0000 Received: from BOW17EX19B.micron.com (137.201.21.219) by BOW36EX1902.micron.com (137.201.85.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.16; Wed, 27 Sep 2023 03:50:23 -0600 Received: from VENKATARAVI-LAP.micron.com (10.70.32.235) by RestrictedRelay17EX19B.micron.com (137.201.21.219) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 27 Sep 2023 03:50:17 -0600 From: Ravi Jonnalagadda <ravis.opensrc@micron.com> To: <linux-mm@vger.kernel.org>, <linux-cxl@vger.kernel.org> CC: <linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>, <linux-api@vger.kernel.org>, <luto@kernel.org>, <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>, <dietmar.eggemann@arm.com>, <vincent.guittot@linaro.org>, <dave.hansen@linux.intel.com>, <hpa@zytor.com>, <arnd@arndb.de>, <akpm@linux-foundation.org>, <x86@kernel.org>, <aneesh.kumar@linux.ibm.com>, <gregory.price@memverge.com>, <ying.huang@intel.com>, <jgroves@micron.com>, <ravis.opensrc@micron.com>, <sthanneeru@micron.com>, <emirakhur@micron.com>, <vtanna@micron.com> Subject: [RFC PATCH 0/2] mm: mempolicy: Multi-tier interleaving Date: Wed, 27 Sep 2023 15:20:00 +0530 Message-ID: <20230927095002.10245-1-ravis.opensrc@micron.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044EE:EE_|BL3PR08MB7300:EE_ X-MS-Office365-Filtering-Correlation-Id: 4514ed98-6195-47e8-228f-08dbbf3f2cad X-EXT-ByPass: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jkJACQMgCBEtHMNXUL+bWBnflAhl+ptNnYlsuQ+uaZ264LHa2n4vVWf9X8iozlL9rFaU6BQhdQnomcYYcNniP3wCWQB7Xvap6zTovfbbvp9Ul5wTF0R1Ts98ErRMKLlYobZNerADpBouhvVWtbmy2mQ4DlD4bbJlle8NxzvL1QTpTHLWTulWiVqtd6rfe+I8gx5uczUY7ZSipfzaLnyYIGS2E9iJ5R2GpbpiFnED4qZHhuNEPl6WndH89xNjIYugPGYc37hA0OMofCAeH6InpqNeYD6DQB9YfdZIjlUd/WnW8m32aXeEM53NMV6ZHYhN6cRCuCeb7LtQVzIfB5XXLauNnNg9iIr9jDyMpGNK2q/cA7e95klk+z3ryol1dEUtZ2iErQnsPfp30Dab9ZM5k2MkqDwRRb1b2aM5dkfp7xyOr/em26rqUlaXI5YmRbaJKQRTkH8j0ZGIJNRq2n35g5GanyzGEZ4BBwW/rrRNZ2kz1P0/SKYDEle5FacOHCuGJD3ENxxNE7w/UkUfKgucXwB5Oz83A99Z4yzw47RxqcaumQqq8Oc/nvqOYspRCwXZlHrgVGDWrayHnhJPplUKSu1QGaukKWi5nHfhN8sr7l5LaMApXPGdcnBObVYiF1PXmgLNZ9U+JIAqGPdMyZAgCNb10k98a1fXmeSRAcBYvs68x68M5dYkwvnGv0Q/H4uapI0EKhJYd/A0gLPcOyOsH+QSFLb8mTGgyBpQAvfyLbU= X-Forefront-Antispam-Report: CIP:137.201.242.130;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.micron.com;PTR:masquerade.micron.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(136003)(396003)(39860400002)(346002)(230922051799003)(1800799009)(82310400011)(186009)(451199024)(46966006)(40470700004)(36840700001)(40480700001)(426003)(6666004)(7696005)(70586007)(40460700003)(5660300002)(36756003)(107886003)(7636003)(2616005)(41300700001)(26005)(336012)(1076003)(356005)(478600001)(70206006)(54906003)(316002)(110136005)(86362001)(82740400003)(7416002)(966005)(2906002)(83380400001)(47076005)(4326008)(8936002)(8676002)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: micron.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 09:50:25.5352 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4514ed98-6195-47e8-228f-08dbbf3f2cad X-MS-Exchange-CrossTenant-Id: f38a5ecd-2813-4862-b11b-ac1d563c806f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f38a5ecd-2813-4862-b11b-ac1d563c806f;Ip=[137.201.242.130];Helo=[mail.micron.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044EE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR08MB7300 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 27 Sep 2023 02:50:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778184940779739909 X-GMAIL-MSGID: 1778184940779739909 |
Series |
mm: mempolicy: Multi-tier interleaving
|
|
Message
Ravi Jonnalagadda
Sept. 27, 2023, 9:50 a.m. UTC
From: Ravi Shankar <ravis.opensrc@micron.com>
Hello,
The current interleave policy operates by interleaving page requests
among nodes defined in the memory policy. To accommodate the
introduction of memory tiers for various memory types (e.g., DDR, CXL,
HBM, PMEM, etc.), a mechanism is needed for interleaving page requests
across these memory types or tiers.
This can be achieved by implementing an interleaving method that
considers the tier weights.
The tier weight will determine the proportion of nodes to select from
those specified in the memory policy.
A tier weight can be assigned to each memory type within the system.
Hasan Al Maruf had put forth a proposal for interleaving between two
tiers, namely the top tier and the low tier. However, this patch was
not adopted due to constraints on the number of available tiers.
https://lore.kernel.org/linux-mm/YqD0%2FtzFwXvJ1gK6@cmpxchg.org/T/
New proposed changes:
1. Introducea sysfs entry to allow setting the interleave weight for each
memory tier.
2. Each tier with a default weight of 1, indicating a standard 1:1
proportion.
3. Distribute the weight of that tier in a uniform manner across all nodes.
4. Modifications to the existing interleaving algorithm to support the
implementation of multi-tier interleaving based on tier-weights.
This is inline with Huang, Ying's presentation in lpc22, 16th slide in
https://lpc.events/event/16/contributions/1209/attachments/1042/1995/\
Live%20In%20a%20World%20With%20Multiple%20Memory%20Types.pdf
Observed a significant increase (165%) in bandwidth utilization
with the newly proposed multi-tier interleaving compared to the
traditional 1:1 interleaving approach between DDR and CXL tier nodes,
where 85% of the bandwidth is allocated to DDR tier and 15% to CXL
tier with MLC -w2 option.
Usage Example:
1. Set weights for DDR (tier4) and CXL(teir22) tiers.
echo 85 > /sys/devices/virtual/memory_tiering/memory_tier4/interleave_weight
echo 15 > /sys/devices/virtual/memory_tiering/memory_tier22/interleave_weight
2. Interleave between DRR(tier4, node-0) and CXL (tier22, node-1) using numactl
numactl -i0,1 mlc --loaded_latency W2
Srinivasulu Thanneeru (2):
memory tier: Introduce sysfs for tier interleave weights.
mm: mempolicy: Interleave policy for tiered memory nodes
include/linux/memory-tiers.h | 27 ++++++++-
include/linux/sched.h | 2 +
mm/memory-tiers.c | 67 +++++++++++++++-------
mm/mempolicy.c | 107 +++++++++++++++++++++++++++++++++--
4 files changed, 174 insertions(+), 29 deletions(-)
Comments
Hi, Ravi, Thanks for the patch! Ravi Jonnalagadda <ravis.opensrc@micron.com> writes: > From: Ravi Shankar <ravis.opensrc@micron.com> > > Hello, > > The current interleave policy operates by interleaving page requests > among nodes defined in the memory policy. To accommodate the > introduction of memory tiers for various memory types (e.g., DDR, CXL, > HBM, PMEM, etc.), a mechanism is needed for interleaving page requests > across these memory types or tiers. Why do we need interleaving page allocation among memory tiers? I think that you need to make it more explicit. I guess that it's to increase maximal memory bandwidth for workloads? > This can be achieved by implementing an interleaving method that > considers the tier weights. > The tier weight will determine the proportion of nodes to select from > those specified in the memory policy. > A tier weight can be assigned to each memory type within the system. What is the problem of the original interleaving? I think you need to make it explicit too. > Hasan Al Maruf had put forth a proposal for interleaving between two > tiers, namely the top tier and the low tier. However, this patch was > not adopted due to constraints on the number of available tiers. > > https://lore.kernel.org/linux-mm/YqD0%2FtzFwXvJ1gK6@cmpxchg.org/T/ > > New proposed changes: > > 1. Introducea sysfs entry to allow setting the interleave weight for each > memory tier. > 2. Each tier with a default weight of 1, indicating a standard 1:1 > proportion. > 3. Distribute the weight of that tier in a uniform manner across all nodes. > 4. Modifications to the existing interleaving algorithm to support the > implementation of multi-tier interleaving based on tier-weights. > > This is inline with Huang, Ying's presentation in lpc22, 16th slide in > https://lpc.events/event/16/contributions/1209/attachments/1042/1995/\ > Live%20In%20a%20World%20With%20Multiple%20Memory%20Types.pdf Thanks to refer to the original work about this. > Observed a significant increase (165%) in bandwidth utilization > with the newly proposed multi-tier interleaving compared to the > traditional 1:1 interleaving approach between DDR and CXL tier nodes, > where 85% of the bandwidth is allocated to DDR tier and 15% to CXL > tier with MLC -w2 option. It appears that "mlc" isn't an open source software. Better to use a open source software to test. And, even better to use a more practical workloads instead of a memory bandwidth/latency measurement tool. > Usage Example: > > 1. Set weights for DDR (tier4) and CXL(teir22) tiers. > echo 85 > /sys/devices/virtual/memory_tiering/memory_tier4/interleave_weight > echo 15 > /sys/devices/virtual/memory_tiering/memory_tier22/interleave_weight > > 2. Interleave between DRR(tier4, node-0) and CXL (tier22, node-1) using numactl > numactl -i0,1 mlc --loaded_latency W2 > > Srinivasulu Thanneeru (2): > memory tier: Introduce sysfs for tier interleave weights. > mm: mempolicy: Interleave policy for tiered memory nodes > > include/linux/memory-tiers.h | 27 ++++++++- > include/linux/sched.h | 2 + > mm/memory-tiers.c | 67 +++++++++++++++------- > mm/mempolicy.c | 107 +++++++++++++++++++++++++++++++++-- > 4 files changed, 174 insertions(+), 29 deletions(-) -- Best Regards, Huang, Ying
Micron Confidential Hi Huang, Thanks to you for your comments and in the next version, these suggestions will be incorporated. Regards, Srini Micron Confidential