[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <052e3ba49bf815393ca4b51650134faee0d70feb.camel@intel.com>
Date: Wed, 08 Jun 2022 14:42:33 +0800
From: Ying Huang <ying.huang@...el.com>
To: Aneesh Kumar K V <aneesh.kumar@...ux.ibm.com>,
Tim Chen <tim.c.chen@...ux.intel.com>, linux-mm@...ck.org,
akpm@...ux-foundation.org
Cc: Wei Xu <weixugc@...gle.com>, Greg Thelen <gthelen@...gle.com>,
Yang Shi <shy828301@...il.com>,
Davidlohr Bueso <dave@...olabs.net>,
Tim C Chen <tim.c.chen@...el.com>,
Brice Goglin <brice.goglin@...il.com>,
Michal Hocko <mhocko@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Hesham Almatary <hesham.almatary@...wei.com>,
Dave Hansen <dave.hansen@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Alistair Popple <apopple@...dia.com>,
Dan Williams <dan.j.williams@...el.com>,
Feng Tang <feng.tang@...el.com>,
Jagdish Gediya <jvgediya@...ux.ibm.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH v5 2/9] mm/demotion: Expose per node memory tier to sysfs
On Wed, 2022-06-08 at 10:25 +0530, Aneesh Kumar K V wrote:
> On 6/8/22 1:45 AM, Tim Chen wrote:
> > On Fri, 2022-06-03 at 19:12 +0530, Aneesh Kumar K.V wrote:
> > >
> > >
> > >
> > >
> > >
> > > +static struct memory_tier *__node_get_memory_tier(int node)
> > > +{
> > > + struct memory_tier *memtier;
> > > +
> > > + list_for_each_entry(memtier, &memory_tiers, list) {
> >
> > We could need to map node to mem_tier quite often, if we need
> > to account memory usage at tier level. It will be more efficient
> > to have a pointer from node (pgdat) to memtier rather
> > than doing a search through the list.
> >
> >
>
> That is something I was actively trying to avoid. Currently all struct
> memory_tier references are with memory_tier_lock mutex held. That
> simplify the locking and reference counting.
>
> As of now we are able to implement all the required interfaces without
> pgdat having pointers to struct memory_tier. We can update pgdat with
> memtier details when we are implementing changes requiring those. We
> could keep additional memtier->dev reference to make sure memory tiers
> are not destroyed while other part of the kernel is referencing the
> same. But IMHO such changes should wait till we have users for the same.
No. We need a convenient way to access memory tier information from
inside the kernel. For example, from nid to memory tier rank, this is
needed by migrate_misplaced_page() to do statistics too, iterate all
nodes of a memory tier, etc.
And, "allowed" field of struct demotion_nodes (introduced in [7/9] is
per-memory tier instead of per-node. Please move it to struct
memory_tier. And we just need a convenient way to access it.
All these are not complex, unless you insist to use memory_tier_lock and
device liftcycle to manage this in-kernel data structure.
Best Regards,
Huang, Ying
> > > + if (node_isset(node, memtier->nodelist))
> > > + return memtier;
> > > + }
> > > + return NULL;
> > > +}
> > > +
> > >
> >
> > Tim
> >
>
> -aneesh
>
Powered by blists - more mailing lists