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 D1055C54798 for ; Tue, 27 Feb 2024 08:26:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5DDDC440206; Tue, 27 Feb 2024 03:26:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 564324401FB; Tue, 27 Feb 2024 03:26:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DF29440206; Tue, 27 Feb 2024 03:26:53 -0500 (EST) 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 27B894401FB for ; Tue, 27 Feb 2024 03:26:53 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7C998809C9 for ; Tue, 27 Feb 2024 08:26:52 +0000 (UTC) X-FDA: 81836903064.01.0C347FE Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by imf15.hostedemail.com (Postfix) with ESMTP id 644CFA0009 for ; Tue, 27 Feb 2024 08:26:49 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=e+RsuACD; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf15.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709022410; 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=X3mxCoEKb59dQUB0TIkZZSh9xJZj1HgKD1n492mSBTE=; b=KI7VPNdVh9JKA3CeJTu4yTcEYbX63Wqi4cZ/drRGU/NTR8OuBRkj6vySQMQNLywh8jiN+m lU1zltUAwd9mqVNLTzkyecK3AhKZirF5oUf7dLrcfqnLx6f4z0h5tigIDQmBgTxHOJc5zs 0ZIDF2zPlk58yucl2CAH8lv9JBffD/Q= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=e+RsuACD; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf15.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709022410; a=rsa-sha256; cv=none; b=DGSpqWF0edRe65xbFxygFRvW4CZxpxV6+1Q04YAZTcX9azFwjBYTLYshg131+7XnlzdCLe mF/b+610GLoBeeYzTOsdenF41ICyeXnFXppl7WO9opTkP6AscjeC3D8SajKj8FFf1NDLO+ R2ZaWw+Ih1p715XCUzipWnaJHUsI/gA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709022410; x=1740558410; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=o2XMkzXMkwPFel/APz6jVJp+QxaW7CBccneLWcc1hPY=; b=e+RsuACD/kfEjcDiVFf8hEw9nnfXm5Lg2RN7eQutHtx5gIh+5FbO4IHq kq5xzw6EYDgA84UDar26npOFw0oOG6hYlEODDCr/e2MyJb1Cg+PfYclLk AwGRJHQDBxWrQGimBZOKUPtlhJy4+BLXaZixtwYOMsN+oqPb0AwzC199M yoONMBVGHTuSTbLh+izhC5k5g3lowvzhZz2x90whQK15Z7Vq5ayLEkqGx C6mIAgwm3vs0V5lo9076BZZbaRXJ4RndLbBlj2mCIA29fiLZMwvSArBAi 4VJ4nnlJyz1CGVTgcdUF4ROdR/xI8agc8NRkF5X7lIoVugv/FHf42IwEz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3510487" X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="3510487" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 00:26:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="7112705" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 00:26:44 -0800 From: "Huang, Ying" To: Gregory Price Cc: Gregory Price , , , , , Subject: Re: [RFC 1/1] mm/mempolicy: introduce system default interleave weights In-Reply-To: (Gregory Price's message of "Tue, 27 Feb 2024 01:11:50 -0500") References: <20240220202529.2365-1-gregory.price@memverge.com> <20240220202529.2365-2-gregory.price@memverge.com> <87wmqxht4c.fsf@yhuang6-desk2.ccr.corp.intel.com> <87sf1jh7es.fsf@yhuang6-desk2.ccr.corp.intel.com> <87edcyeo78.fsf@yhuang6-desk2.ccr.corp.intel.com> <87a5nme9c1.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Tue, 27 Feb 2024 16:24:49 +0800 Message-ID: <875xyae2lq.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-Server: rspam09 X-Rspamd-Queue-Id: 644CFA0009 X-Stat-Signature: q5rmdt4g9y1hmstdpzitzdnkcuubdz39 X-Rspam-User: X-HE-Tag: 1709022409-424875 X-HE-Meta: U2FsdGVkX19e7C/RbLwYlbZB03PNMLLxckoScFAYN2jLfEiw1EurXteHY9XPLTb15qV/71qsGyPY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b2KmTlDOeLhzjN8NgfKw61CklMzF6TJCE17d3vYn/5G1TRDrmdglRICf4+s3WWUlefphtKSl8EU= 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: Gregory Price writes: > On Tue, Feb 27, 2024 at 01:59:26PM +0800, Huang, Ying wrote: >> Gregory Price writes: >> >> > I have to press this issue: Is this an actual, practical, concern? >> >> I don't know who have large machine like that. But I guess that it's >> possible in the long run. >> > > Certainly possible, although that seems like a hyper-specialized case of > a supercomputer. I suppose still worth considering for a bit. > >> > I suppose another strategy is to calculate the interleave weights >> > un-bounded from the raw bandwidth - but continuously force reductions >> > (through some yet-undefined algorithm) until at least one node reaches a >> > weight of `1`. This suffers from the opposite problem: what if the top >> > node has a value greater than 255? Do we just cap it at 255? That seems >> > the opposite form of problematic. >> > >> > (Large numbers are quite pointless, as it is essentially the antithesis >> > of interleave) >> >> Yes. So I suggest to use a relative small number as the default weight >> to start with for normal DRAM. We will have to floor/ceiling the weight >> value. > > Yeah more concretely, I was thinking something like > > unsigned int *temp_weights; /* sizeof nr_node_ids */ > > memcpy(temp_weights, node_bandwidth); > while min(temp_weights) > 1: > - attempt GCD reduction > - if failed (GCD=1), adjust all odd numbers to be even (+1), try again > > for weight in temp_weights: > iw_table[N] = (weight > 255) ? 255 : (unsigned char)weight; > > Something like this. Of course this breaks if you have two nodes with a > massively different bandwidth ratio (> 255:1), but that seems > unrealistic given the intent of the devices. Better to evaluate the maximum error introduced. For example, for 3:2 bandwidth, the result could be 2:1. That appears not necessary. -- Best Regards, Huang, Ying