Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1600540rdb; Tue, 20 Feb 2024 00:49:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUXWxrnJBZlkne2bdudCMHl1qqGo1cMxo7OI+HA8GCMvsWbknVn/kr9KuRpgMWRBL4LGnW/V71eHHCzPUGD2lSEZBA3YnjbRSQpRCDzIA== X-Google-Smtp-Source: AGHT+IEKtn/iIQt9aivXGxz5XvAy4qCDn0+sdeNBLTeOGb6a67fi5ilEX8iOj/rib4HfO5Mf0ZDq X-Received: by 2002:a9d:7f8c:0:b0:6e2:deee:925 with SMTP id t12-20020a9d7f8c000000b006e2deee0925mr13114118otp.20.1708418949803; Tue, 20 Feb 2024 00:49:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708418949; cv=pass; d=google.com; s=arc-20160816; b=sPM81IsR2VeNuyIZL1ngrYfnGLzoBaCXwsTq8E4/VaLm33u5cbBpytyWP5JJSDC0fF sH7vOggzAibvi2vfnpYlm15Ji8vQj6QkaYzo3ZZqUcOWxpEUA8fPUav+saX3ONI/VJ6E tFKZ5LqKrRzlrfIj7z6SU6NRfvXD1eyecg4nr20gWny82ksrSqas0PdFq4ZDWoEuOomv miqqrNW9p1FoAXbHCj0C4EMoNyGWVbc9EXltaE4Vt5UP9Sw0gujyagPMZonn2aDkf2YO GWt3zQ3tZJb7Xczj3AjvnDCcOOOIoisTckMKYfICuOnK5y0Av1ZY8p47H0A9chpKVyqQ GbbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=NA7J3Y3vhZLjDH51M6OXG8PWjFrYhMMpO51KFvCjoVI=; fh=ULyJzse6XHUIFHsmd4W0v3eY8OUxh6Sffwsf77WCtEg=; b=KfVFrtBZOoPCvwNquySt3HLcxUliqwOWVrmvDbdTkYXmqPUX4220Tb46xcFSYTfFqf 7NQcyn41h2tfzHQojYN1vYMevcUxXAW7jdh13oH9d33I466xSV0O2hCozS3EhgFHsM/8 YKF5eokY9Uhvyk/5ye/cSoWEHlq/UYQkWtAnqCgpMUda1TATbCMGXt0JYNzk5xJPIFd2 vkZymMREezjL2QjBC2l2KaY/Y8TqgpNCb71hAO5O+UeMe5bVizk72tRBYo/alRLYsPYw P8zrqqNYu+V9GdArekXIhnOslpoFqSOfhm5qrXmqXJe1ntO7S17oVwhxah5xXvR9HzF0 8MNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=JoYKdNM3; dkim=pass header.i=@suse.com header.s=susede1 header.b=JoYKdNM3; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-72598-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cc11-20020a056a02074b00b005e3cdc24c26si1916195pgb.467.2024.02.20.00.49.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:49:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72598-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=@suse.com header.s=susede1 header.b=JoYKdNM3; dkim=pass header.i=@suse.com header.s=susede1 header.b=JoYKdNM3; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-72598-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 728842833B0 for ; Tue, 20 Feb 2024 08:49:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F4C75D758; Tue, 20 Feb 2024 08:49:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="JoYKdNM3"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="JoYKdNM3" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AA6F5D743 for ; Tue, 20 Feb 2024 08:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708418942; cv=none; b=GzeP+q2E/vO6uncyBKUwM/ws0aM5qq1rlawEb/4+lSp0s0tudRliYEGnLzP/86zZgF3gIz4bxPHjB86M5TfL2VHuZJKJZtAGNvA8djuwe6SqQolk2uQtheHUil39vuLABa5kE19euGkHDP2bgXcn1iNJkKbJu+3JV5PMikJmERM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708418942; c=relaxed/simple; bh=zDKctsX4v6uMhmZSqwb6usrdrAhg4DRpu0tYJotpcZI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c2010TeLQOtWqL7HRnYB0pvLnCphHFL9jiGEmj1jkCrUw1u5R8BPDfiFcfaDqQEX4whjm6qnTzHFCZlbFks/CDm82aFhIxNa05lRo9xgAL/nQAIAqR/i8NT7IgchjOOjXKZcADe2FaD9Nzhd8UwTuHdVlZOWFse5OzKgMUiwMUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=JoYKdNM3; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=JoYKdNM3; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BA372221D8; Tue, 20 Feb 2024 08:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708418938; 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=NA7J3Y3vhZLjDH51M6OXG8PWjFrYhMMpO51KFvCjoVI=; b=JoYKdNM39nCYsRL0sZvp0+yzB+eKDHNkGApRiibylMOLY+9lgckn/wRgWhJoDOkPEs0Ag8 CrpKTbxfTeT9duaneRdiu33rxOsgseILo2iP8yNQbxMZ8TyVJxu9vROWim49h/aKRyEetO PuUN6cM1ysURTQtKuiz9t7n890GT7Bs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708418938; 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=NA7J3Y3vhZLjDH51M6OXG8PWjFrYhMMpO51KFvCjoVI=; b=JoYKdNM39nCYsRL0sZvp0+yzB+eKDHNkGApRiibylMOLY+9lgckn/wRgWhJoDOkPEs0Ag8 CrpKTbxfTeT9duaneRdiu33rxOsgseILo2iP8yNQbxMZ8TyVJxu9vROWim49h/aKRyEetO PuUN6cM1ysURTQtKuiz9t7n890GT7Bs= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 97C7C139D0; Tue, 20 Feb 2024 08:48:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id A7cCInpn1GUeXQAAD6G6ig (envelope-from ); Tue, 20 Feb 2024 08:48:58 +0000 Date: Tue, 20 Feb 2024 09:48:57 +0100 From: Michal Hocko To: "Aneesh Kumar K.V" Cc: Donet Tom , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Dave Hansen , Mel Gorman , Ben Widawsky , Feng Tang , Andrea Arcangeli , Peter Zijlstra , Ingo Molnar , Rik van Riel , Johannes Weiner , Matthew Wilcox , Mike Kravetz , Vlastimil Babka , Dan Williams , Hugh Dickins , Kefeng Wang , Suren Baghdasaryan Subject: Re: [PATCH 3/3] mm/numa_balancing:Allow migrate on protnone reference with MPOL_PREFERRED_MANY policy Message-ID: References: <9c3f7b743477560d1c5b12b8c111a584a2cc92ee.1708097962.git.donettom@linux.ibm.com> <8d7737208bd24e754dc7a538a3f7f02de84f1f72.1708097962.git.donettom@linux.ibm.com> <25b420aa-3fe6-40a4-8d60-a46ab61ee7b7@linux.ibm.com> <0f0fd8e3-98b2-4001-ba6a-6a8a26a5393f@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <0f0fd8e3-98b2-4001-ba6a-6a8a26a5393f@kernel.org> Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [0.03 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_TWELVE(0.00)[22]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.37)[76.85%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: 0.03 On Tue 20-02-24 09:27:25, Aneesh Kumar K.V wrote: [...] > case MPOL_PREFERRED_MANY: > if (pol->flags & MPOL_F_MORON) { > if (!mpol_preferred_should_numa_migrate(thisnid, curnid, pol)) > goto out; > break; > } > > /* > * use current page if in policy nodemask, > * else select nearest allowed node, if any. > * If no allowed nodes, use current [!misplaced]. > */ > if (node_isset(curnid, pol->nodes)) > goto out; > z = first_zones_zonelist( > node_zonelist(thisnid, GFP_HIGHUSER), > gfp_zone(GFP_HIGHUSER), > &pol->nodes); > polnid = zone_to_nid(z->zone); > break; > .... > .. > } > > /* Migrate the folio towards the node whose CPU is referencing it */ > if (pol->flags & MPOL_F_MORON) { > polnid = thisnid; > > if (!should_numa_migrate_memory(current, folio, curnid, > thiscpu)) > goto out; > } > > if (curnid != polnid) > ret = polnid; > out: > mpol_cond_put(pol); > > return ret; > } Ohh, right this code is confusing as hell. Thanks for the clarification. With this in mind. There should be a comment warning about MPOL_F_MOF always being unset as the userspace cannot really set it up. Thanks! -- Michal Hocko SUSE Labs