Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp335265rdb; Tue, 23 Jan 2024 00:40:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGljJ2FXGhp7irGHR6BXcJOPnqdpxFoACDrrkhiSGgi8KUR5315v1wlQifZc6/skP3LkvxG X-Received: by 2002:a17:902:b708:b0:1d5:ae9f:251d with SMTP id d8-20020a170902b70800b001d5ae9f251dmr5207893pls.95.1705999209138; Tue, 23 Jan 2024 00:40:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705999209; cv=pass; d=google.com; s=arc-20160816; b=UCURRLOWExuLoht8PHYqBFjcRL3qiOLcDNN+jPuZqzF/lC7y4CKkwEq5OI+aN0knAb vharRPO37dghDDha9YZZpYiizt4moLQzkhDvhdWVqVWjAIlitKnJFg9XHlSQwf0NAWho wXtLMjVxWFDkRchuK1+7LCnZc8fHFrkIxNmJyUJ7wDFBifQTdZTSwKxpFmHYxKElfpoT /PcWosX/levQSAQYmqyy1UUgATcUIfprro8nfznu5+p1Amtm5gd/5euyOKLBtDLKdZAV UoVotAtY2nxa3MR4F97a0znQru0x51XsflV/fK/UwnTlAOv2s3QGjSSz59Q6EHIBVZVw iv9w== 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=Lv1rYne4Y00mJv+G0A0WggtQO56ixJ8OgOriNtc3yVg=; fh=7UpqHKIHYjhQD2uRTquVfcQXwSyBRXyPU1rdB7njkmA=; b=zinwA/Bo0agA3xoLOsfHAGYQpcNtXJ+0PPGHmA4JZnfakXQAM5dCMNR7vI+ulpuDaX 79NXIka0rMzKOYmPUZqpNbj8NwVqjUkEOzhAcioh0OcFqH8nISyyT6ZDDO1V5fgSOWQy OZDtF2Dqh1jQehCypDZAtAy23zZj9WrD9FQwYxJVdoR88LHlghLc4NVvvuLz5KVFwDha WDVfQGOrd57A7CXpfXPMyip9NMaAqMF0yE3WHtsSfP8YZwbKa1nI1S7c2x+GPw6gEXk6 kMeJlt5K9aR5EYZAuDzLC0n2fkxU/CcBYFTGIhi6M6PNXsOIJG3tQuxHOown5snKb1Wd JG2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XnU4Jqo7; 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-34920-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jb9-20020a170903258900b001d70a988e4csi8713351plb.441.2024.01.23.00.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 00:40:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34920-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XnU4Jqo7; 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-34920-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34920-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0047F282C08 for ; Tue, 23 Jan 2024 08:38:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CB3157892; Tue, 23 Jan 2024 08:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XnU4Jqo7" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 36A5257327; Tue, 23 Jan 2024 08:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705999046; cv=none; b=tT75GUB37yuOPmp3cPGWg1IYLWYz1uTmm+Rq0OQjEXPWqOUs46XYeNDsn3JhUNmyyb2xIPjVT153E64teTYXTH0viArXqkwMrfK88Y6ftiY+nyF1LULQmbRZAYn1VwvKPlG2o7v6EsuronHerJzyppX3JKMXqGiNX1CxDs1bZnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705999046; c=relaxed/simple; bh=i3fm9I0AtALKEDU1lFQLDOyc8qHvrAP7w0tD+wvw694=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=lSUb+JAfWcWKStRypJFoCUQk161iWlI/JGtGnfMohiWJs76vAMaUcHgvuHJmbx6q3hntu/qB1o8vv+5EeDoGupVVaIHsWu/j3iZXy59rR8b2l94US5GPHgqb6cdoB6zLNtvJ6RpLKKU0utulfuIwKFsGGAAJXqCKXl8ZfVxHCrc= 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=XnU4Jqo7; arc=none smtp.client-ip=198.175.65.15 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=1705999044; x=1737535044; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=i3fm9I0AtALKEDU1lFQLDOyc8qHvrAP7w0tD+wvw694=; b=XnU4Jqo7GuQZuCNyljLjK63RufcYaMzICzcl4HutzhaT7PJ+zhxhbUco GwMfyKz9vzRTxaP4umXoujikvDN3RgmCnPf0S++dk0w47926TWlsq5PbY hR6eLcGbnleQPY75gpB3stA6MFbFTkZ2SrJLY0c0k2PqywqjzeAx4F499 ZLLDK5VRvPuD+lfmnSubeZFxEMSxOYGsU01VY6tgTJtXHjNtzTahmEETB 3UkZwQ3QVxHbhKIBFhJ6eptJPHQrNv0uHf0ym+nROltRv04xdVMCO3VVf QO4KeO8roOBovtXd3ZwwnahOL2M/vDJ1R3wD/HuoDdrGNPUAJkXc8NqIs g==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="1339952" X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="1339952" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2024 00:37:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="20261546" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2024 00:37:16 -0800 From: "Huang, Ying" To: Gregory Price Cc: Gregory Price , , , , , , , , , , , , , , , , , , , , , Srinivasulu Thanneeru Subject: Re: [PATCH v2 3/3] mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving In-Reply-To: (Gregory Price's message of "Tue, 23 Jan 2024 00:16:12 -0500") References: <20240119175730.15484-1-gregory.price@memverge.com> <20240119175730.15484-4-gregory.price@memverge.com> <87jzo0vjkk.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Tue, 23 Jan 2024 16:35:19 +0800 Message-ID: <87a5owv454.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 Gregory Price writes: > On Mon, Jan 22, 2024 at 11:54:34PM -0500, Gregory Price wrote: >> > >> > Can the above code be simplified as something like below? >> > >> > resume_node = prev_node; > --- resume_weight = 0; > +++ resume_weight = weights[node]; >> > for (...) { >> > ... >> > } >> > >> >> I'll take another look at it, but this logic is annoying because of the >> corner case: me->il_prev can be NUMA_NO_NODE or an actual numa node. >> > > After a quick look, as long as no one objects to (me->il_prev) remaining > NUMA_NO_NODE MAX_NUMNODES-1 ? > while having a weight assigned to pol->wil.cur_weight, I think that it is OK. And, IIUC, pol->wil.cur_weight can be 0, as in weighted_interleave_nodes(), if it's 0, it will be assigned to default weight for the node. > then > this looks like it can be simplified as above. > > I don't think it's harmful, but i'll have to take a quick look at what > happens on rebind to make sure we don't have a stale weight. Make sense. -- Best Regards, Huang, Ying