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 B1DE2C47258 for ; Tue, 23 Jan 2024 08:15:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A4D66B008A; Tue, 23 Jan 2024 03:15:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 454936B008C; Tue, 23 Jan 2024 03:15:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31C546B0092; Tue, 23 Jan 2024 03:15:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 227036B008A for ; Tue, 23 Jan 2024 03:15:50 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D9B4B1C123A for ; Tue, 23 Jan 2024 08:15:49 +0000 (UTC) X-FDA: 81709867218.22.0704E6B Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by imf23.hostedemail.com (Postfix) with ESMTP id 955D014000B for ; Tue, 23 Jan 2024 08:15:46 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=dBCMBJgn; spf=pass (imf23.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705997747; 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=8EwwjtZt/i9H2hXOw6AMHc0vgRKB/lOeaYWu9f34MPY=; b=0U1rGRaLLdUCLtJhFLghfle0frc17L6k8/rnYfprDOiCNGymKRVfEjygJfOgNJX9j5+ZWj jy+ObEcC2pjZjfXkWlyW5TU+ti6YZqjJam7mzjgSaz9NwgVmHkDV21yyhR8SC/x7JPnJSK E9VA+KflxZWx2GdltnWfQv7TbG7MAew= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705997747; a=rsa-sha256; cv=none; b=SBHez5OPPyXQbuU3lM/vfTA66e9Q/6wu/9nnxFOJ9uE9BNsUG/hF32t79kiiiQzawOKUIA GyrSlPDoK26g+xp/Tv9zqOoCDn8gK16LssvR2BTO+yDAIEGycNRMl4g3c1XWBKnmZUzMdO qqJwYX2L0G09MhlrdZOZckh/rWEG4rE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=dBCMBJgn; spf=pass (imf23.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705997746; x=1737533746; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=Q9cZM58uRpptNUZAKXZJSLxxlo/oFlDoWc5U0H4XU38=; b=dBCMBJgnnZxxyK0erbvktvEXpropBlY20o+40ErPDqu2eqqtJsmai7xK OkGDNTiOH1BS/M/JGmYjOxb61OLRIqasy7/uWLc6YqiV3Gnd0XUu9l5Go JFK7Pgwm7Nzd/WW6Z7ZebVO0PYmQjNUkXlnPNPl5M3tH2/FxoFsp8rki0 07O/yRWBzxvzEOVKT0jj4C2642kPmxgsyG3QDTYHWzNgx4tAjq3E7brca 7P9b7fyVIkvdlWxaIp4zM6/KR+JjsOfO0heSqiK8BcEvjE2Eb4qztMcob myX0/GR0zkcQ3YBm+BBRrDb8hcJNYtlB/4JqCZ4E4+Nkn3Oz23ugdJ0Pr Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="432610291" X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="432610291" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2024 00:15:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="929264349" X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="929264349" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2024 00:15:39 -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 "Mon, 22 Jan 2024 23:54:34 -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:13:43 +0800 Message-ID: <87ede8v554.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-Queue-Id: 955D014000B X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: o7sjcfmnbgigkgbcomecazrryq88faew X-HE-Tag: 1705997746-897140 X-HE-Meta: U2FsdGVkX18zOksGJQ01GcvkgZhyGI6H2zH/g28XPNuKq71YlHpBl0IV1qHZPvIf4y6wYf8aqhlq7h4FzJ0OZ8/Kx3W/BNeOTxRMu0CjijYKGC92W1H52319FgljCvTaiG0TIWcn4KN9cLGcPVzaTr0njMj0mA6DSb+D8cBfamdjBbwaAONj6gI0UUXW4LrkJ/twICmYzdbZE6iHKuouF2QcSPMOznU7L9LL/xH71eVL5+y9ngCjySj3CNn0ItZtkMN+Wq0+3xluUBiXRZvKi5e2TjCtaGg6WjDBmwod/ITEXd+aM5LWAQbM8890AHtEjWYrZ+Vxprlu7Hf/k6130tIgm3vp/ZrthLPD3KL7uhP00syNx3HiH+HUI1YBgOdWfoJZ6d1YhoYhQBY+VUxPK460HOWnBzL+PrleYUwnGpwz/0nq+C8jNe5heRWNC/KeEVo3ln86Tfu/une7VT2tTZeECFKzRGFDVB9NBdIRIQ/aWKi84UkLzgvPGdWnQYbFePTg1bhPqku3CC6Bjuq0BwlFc2TZhsZ++OYllmzpcL0C17NbsGku3I4grx56enCVoclsl32n52fLZBNcAXwHaY06d6Cva3NOaG7ewT/OBaF6SHDQ4Hte0m0YfvgLN6MPjPqawh+Yyg6lbZ0xq2zIpjn9EovpZu0NBcqH/sExRnEGg/MLZ++GOgljusqpk6P7adPvRYbS9yxgVQBAR1/JIPOeKhUyvLtlIcJfAyVLQ6MvP7OS3uug7HUlvPjLBWR9Hrn6HcW+/U6wpEYWs0kM0VIEU+vzWBZciu3mq5JclBRpDKBZgVsgWnKYK4exHdDnRCQCdABLu+vy2yETk9lPGvXLChzyLT0Okdn00VAEBctOG7atDTqb+OEWYpUkg110XPQuxvi6ZDzdQCDkxQDUdRZxjycxvfZXieLqViQeO066IF8IhxVr+tLQO5GGz2GiCx0iCA8bkwv4xk5GkY1 ivw== 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, Jan 23, 2024 at 11:02:03AM +0800, Huang, Ying wrote: >> Gregory Price writes: >> >> > + int prev_node = NUMA_NO_NODE; >> >> It appears that we should initialize prev_node with me->il_prev? >> Details are as below. >> > > yeah good catch, was a rebase error from my tested code, where this is > the case. patching now. > >> > + if (rem_pages <= pol->wil.cur_weight) { >> > + pol->wil.cur_weight -= rem_pages; >> >> If "pol->wil.cur_weight == 0" here, we need to change me->il_prev? >> > you are right, and also need to fetch the next cur_weight. Seems I > missed this specific case in my tests. (had this tested with a single > node but not 2, so it looked right). > > Added to my test suite. > >> We can replace "weight_nodes" with "i" and use a "for" loop? >> >> > + while (weight_nodes < nnodes) { >> > + node = next_node_in(prev_node, nodes); >> >> IIUC, "node" will not change in the loop, so all "weight" below will be >> the same value. To keep it simple, I think we can just copy weights >> from the global iw_table and consider the default value? >> > > another rebase error here from my tested code, this should have been > node = prev_node; > while (...) > node = next_node_in(node, nodes); > > I can change it to a for loop as suggested, but for more info on why I > did it this way, see the chunk below > >> > + } else if (!delta_depleted) { >> > + /* if there was no delta, track last allocated node */ >> > + resume_node = node; >> > + resume_weight = i < (nnodes - 1) ? weights[i+1] : >> > + weights[0]; > ^ this line acquires the weight of the *NEXT* node > another chunk prior to this does the same > thing. I suppose i can use next_node_in() > instead and just copy the entire weigh array > though, if that is preferable. Yes. I think copy the entire weight array make code logic simpler. -- Best Regards, Huang, Ying