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 84280C433EF for ; Wed, 13 Apr 2022 21:44:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC38E6B0072; Wed, 13 Apr 2022 17:44:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E71736B0073; Wed, 13 Apr 2022 17:44:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D87A86B0074; Wed, 13 Apr 2022 17:44:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id CA8636B0072 for ; Wed, 13 Apr 2022 17:44:37 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8934C5C3 for ; Wed, 13 Apr 2022 21:44:37 +0000 (UTC) X-FDA: 79353185394.09.C74A367 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id EF33340007 for ; Wed, 13 Apr 2022 21:44:36 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 20AE561F49; Wed, 13 Apr 2022 21:44:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 384FBC385A6; Wed, 13 Apr 2022 21:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1649886275; bh=f7kQXgt88Fq9j64i0VJmNNGivVtdjfUG1FWA4LVgpnc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tP9AhuZsKqcU4xtK6Loi4iDoLIwHFlwI08A1leycs/htb8cD9mQPq/MaBqe3mwTqT mF+AJSbO5sOKftSb+qAAhZPYJvwe7SpILtbIBGXnu++4C7ioYKIoP5kpvfFNeLceQH Yfd/9Nt6WfUYaelFcDRd0P4N9YvjqSg7ieeeodNU= Date: Wed, 13 Apr 2022 14:44:34 -0700 From: Andrew Morton To: Jagdish Gediya Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, aneesh.kumar@linux.ibm.com, baolin.wang@linux.alibaba.com, dave.hansen@linux.intel.com, ying.huang@intel.com Subject: Re: [PATCH v2 0/5] mm: demotion: Introduce new node state N_DEMOTION_TARGETS Message-Id: <20220413144434.6eedb827c629a3a7e08f56b6@linux-foundation.org> In-Reply-To: <20220413092206.73974-1-jvgediya@linux.ibm.com> References: <20220413092206.73974-1-jvgediya@linux.ibm.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Stat-Signature: 4786qzz8dcj394dwfncc81tk3r5enstd Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=tP9AhuZs; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: EF33340007 X-HE-Tag: 1649886276-390757 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: On Wed, 13 Apr 2022 14:52:01 +0530 Jagdish Gediya wrote: > Current implementation to find the demotion targets works > based on node state N_MEMORY, however some systems may have > dram only memory numa node which are N_MEMORY but not the > right choices as demotion targets. Why are they not the right choice? Please describe this fully so we can understand the motivation and end-user benefit of the proposed change. And please more fully describe the end-user benefits of this change. > This patch series introduces the new node state > N_DEMOTION_TARGETS, which is used to distinguish the nodes which > can be used as demotion targets, node_states[N_DEMOTION_TARGETS] > is used to hold the list of nodes which can be used as demotion > targets, support is also added to set the demotion target > list from user space so that default behavior can be overridden. Permanently extending the kernel ABI is a fairly big deal. Please fully explain the end-user value, usage scenarios, etc. What would go wrong if we simply omitted this interface? > node state N_DEMOTION_TARGETS is also set from the dax kmem > driver, certain type of memory which registers through dax kmem > (e.g. HBM) may not be the right choices for demotion so in future > they should be distinguished based on certain attributes and dax > kmem driver should avoid setting them as N_DEMOTION_TARGETS, > however current implementation also doesn't distinguish any > such memory and it considers all N_MEMORY as demotion targets > so this patch series doesn't modify the current behavior. > > Current code which sets migration targets is modified in > this patch series to avoid some of the limitations on the demotion > target sharing and to use N_DEMOTION_TARGETS only nodes while > finding demotion targets. > > Changelog > ---------- > > v2: > In v1, only 1st patch of this patch series was sent, which was > implemented to avoid some of the limitations on the demotion > target sharing, however for certain numa topology, the demotion > targets found by that patch was not most optimal, so 1st patch > in this series is modified according to suggestions from Huang > and Baolin. Different examples of demotion list comparasion > between existing implementation and changed implementation can > be found in the commit message of 1st patch. > > Jagdish Gediya (5): > mm: demotion: Set demotion list differently > mm: demotion: Add new node state N_DEMOTION_TARGETS > mm: demotion: Add support to set targets from userspace > device-dax/kmem: Set node state as N_DEMOTION_TARGETS > mm: demotion: Build demotion list based on N_DEMOTION_TARGETS > > .../ABI/testing/sysfs-kernel-mm-numa | 12 ++++ This description is rather brief. Some additional user-facing material under Documentation/ would help. Describe the format for writing to the file, what is seen when reading from it, provide a bit of help to the user so they can understand how to use it, what effects they might see, etc. > drivers/base/node.c | 4 ++ > drivers/dax/kmem.c | 2 + > include/linux/nodemask.h | 1 + > mm/migrate.c | 67 +++++++++++++++---- > 5 files changed, 72 insertions(+), 14 deletions(-)