Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp165102rdb; Tue, 31 Oct 2023 04:16:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+eAoE/mSQ1kiNsOLIpgExHlj9sOEuPsBDxYdhD00PyqwhlABpYgIHiA4VYQMErtaDdZ/F X-Received: by 2002:a05:6e02:3113:b0:359:3b32:1715 with SMTP id bg19-20020a056e02311300b003593b321715mr347324ilb.18.1698750967985; Tue, 31 Oct 2023 04:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698750967; cv=none; d=google.com; s=arc-20160816; b=vSd0ei2txxvb4SeZoZvAQzYsD1i78LToBK/qzRhTpPawnyuQ5Cn/o/ENQdPVasDjU1 FNtXYOCwzsRvGt8yPQ6B2fa/hMnq+kzhWj4JoQ5oq1+KsPcmQSRh7SSeYGCt1Ofr2aIx 9V2ZpHIpQTZjfAZCRWVLR8dpo3F+ynwqqN4eSpvzaPfGG2HX+r7EyUEPvMtazITqTrl2 DykahDsYZ3qzvUtuMrKoCCcDxWP7yT+4/9Y1gySFgOLvLBQUXLOjiXDqa+YtI8OdsEhF ud8pyVwTjPfUuqLP048BWZie6au/DwjQoQJxDoKpcd3fsB7GKY6Oci0AprYWCLbR7Atv TwBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hldBQeVlnzcxJxh6wOmSdWjQZeq5v7flC9grgdCposU=; fh=o6c0hsEE3BiexNea5VhkzifEGR1410RR3bGY3G1YNVM=; b=J2IWGxtDlM69O2gEkrVg2eS3hLZxmoec0Iy1OCG2it348waX3/G4DTzRmRY7i0Vvvp Q7bodzBNj2eWd5iiE4WdOJ029nqYGzr+8cWJ7pTpuMR0fPvOLjM12TRAhNeKpSx6ntnq eaptpYZ0f+WDR8XGqXP3HUEJ+arW1Yuda5GhEp1uxVmba8mfVBNo9wve1QQJbqMEaTCa NGfOB3Sf6lo8kJiTb4hNlw26eHaSUliuNYIk90TpOD+8lu+z01pWWVGK0UJhXtXJI+7o Ew5NXhscQbRE6ipVBAXyDtrDedpFnTvTG4l2dPookDE/bZ3NJG2J5bkUTGXH6cGuYsxK mb6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=jXbhZ5At; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u186-20020a6385c3000000b005ac50a019b3si848362pgd.745.2023.10.31.04.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 04:16:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=jXbhZ5At; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DAF3C8031127; Tue, 31 Oct 2023 04:16:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbjJaLPx (ORCPT + 99 others); Tue, 31 Oct 2023 07:15:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235949AbjJaJy0 (ORCPT ); Tue, 31 Oct 2023 05:54:26 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C206D61; Tue, 31 Oct 2023 02:53:43 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3FF341F38A; Tue, 31 Oct 2023 09:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1698746022; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hldBQeVlnzcxJxh6wOmSdWjQZeq5v7flC9grgdCposU=; b=jXbhZ5At6n6gg1nSVJhvzsaRTbKUfxTAg6z30byugTH7CgJY4vtLEdIvBPpGF/tP27lR9z MoblyO7DrwG11ZV3MX0jQwLEgI05yeFeZQRqga0Vue3SJ5OdlFW/+k42xv1jD+MAM8U1WR eLAY64j/+JGgspqmSLOwvHa88ruOnpc= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 17C2F1391B; Tue, 31 Oct 2023 09:53:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GhjLAqbOQGWDcQAAMHmgww (envelope-from ); Tue, 31 Oct 2023 09:53:42 +0000 Date: Tue, 31 Oct 2023 10:53:41 +0100 From: Michal Hocko To: Gregory Price Cc: linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, linux-mm@kvack.org, ying.huang@intel.com, akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, weixugc@google.com, apopple@nvidia.com, hannes@cmpxchg.org, tim.c.chen@intel.com, dave.hansen@intel.com, shy828301@gmail.com, gregkh@linuxfoundation.org, rafael@kernel.org, Gregory Price Subject: Re: [RFC PATCH v3 0/4] Node Weights and Weighted Interleave Message-ID: References: <20231031003810.4532-1-gregory.price@memverge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231031003810.4532-1-gregory.price@memverge.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 04:16:05 -0700 (PDT) On Mon 30-10-23 20:38:06, Gregory Price wrote: > This patchset implements weighted interleave and adds a new sysfs > entry: /sys/devices/system/node/nodeN/accessM/il_weight. > > The il_weight of a node is used by mempolicy to implement weighted > interleave when `numactl --interleave=...` is invoked. By default > il_weight for a node is always 1, which preserves the default round > robin interleave behavior. > > Interleave weights may be set from 0-100, and denote the number of > pages that should be allocated from the node when interleaving > occurs. > > For example, if a node's interleave weight is set to 5, 5 pages > will be allocated from that node before the next node is scheduled > for allocations. I find this semantic rather weird TBH. First of all why do you think it makes sense to have those weights global for all users? What if different applications have different view on how to spred their interleaved memory? I do get that you might have a different tiers with largerly different runtime characteristics but why would you want to interleave them into a single mapping and have hard to predict runtime behavior? [...] > In this way it becomes possible to set an interleaving strategy > that fits the available bandwidth for the devices available on > the system. An example system: > > Node 0 - CPU+DRAM, 400GB/s BW (200 cross socket) > Node 1 - CPU+DRAM, 400GB/s BW (200 cross socket) > Node 2 - CXL Memory. 64GB/s BW, on Node 0 root complex > Node 3 - CXL Memory. 64GB/s BW, on Node 1 root complex > > In this setup, the effective weights for nodes 0-3 for a task > running on Node 0 may be [60, 20, 10, 10]. > > This spreads memory out across devices which all have different > latency and bandwidth attributes at a way that can maximize the > available resources. OK, so why is this any better than not using any memory policy rely on demotion to push out cold memory down the tier hierarchy? What is the actual real life usecase and what kind of benefits you can present? -- Michal Hocko SUSE Labs