linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@linux.alibaba.com>
To: Gregory Price <gourry@gourry.net>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>,
	 hyeonggon.yoo@sk.com, rafael@kernel.org,  lenb@kernel.org,
	 gregkh@linuxfoundation.org, akpm@linux-foundation.org,
	 honggyu.kim@sk.com,  rakie.kim@sk.com, dan.j.williams@intel.com,
	 Jonathan.Cameron@huawei.com, dave.jiang@intel.com,
	 horen.chuang@linux.dev,  hannes@cmpxchg.org,
	linux-kernel@vger.kernel.org,  linux-acpi@vger.kernel.org,
	linux-mm@kvack.org,  kernel-team@meta.com
Subject: Re: [PATCH v3] Weighted interleave auto-tuning
Date: Wed, 22 Jan 2025 09:37:20 +0800	[thread overview]
Message-ID: <8734hbiq7j.fsf@DESKTOP-5N7EMDA> (raw)
In-Reply-To: <Z4_782yoMKqIOfW5@gourry-fedora-PF4VCD3F> (Gregory Price's message of "Tue, 21 Jan 2025 14:56:35 -0500")

Gregory Price <gourry@gourry.net> writes:

> On Tue, Jan 21, 2025 at 07:17:15PM +0800, Huang, Ying wrote:
> ... snip ...
>> 
>> Unless it's possible we will add more modes in the future, this is kind
>> of overkill for me.  How about something simpler as below?
>> 
>> $ cat auto
>> true
>> $ echo 0 > auto
>> $ cat auto
>> false
>
> We have discussed having a dynamic-mode where the weights might adjust
> on the fly based on system-state, but i think this ends up being
> controlled under mempolicy/dynamic_interleave or something.
>
> So this seems reasonable.
>
>> >  static u8 __rcu *iw_table;
>> >  static DEFINE_MUTEX(iw_table_lock);
>> > +static const int weightiness = 32;
>> > +static bool weighted_interleave_auto = true;
>> 
>> I still prefer to use 2 iw_table, one is for default, the other is for
>> manual.  The default one will be used if the manual one is NULL.  Both
>> are protected by RCU.  The default one can be updated upon hotplug
>> blindly.  This makes the whole model easier to be understood IMHO.
>> 
>> What do you think about that.
>> 
>
> only question is, lets say you have
>
> `cat auto node0 node1` -> `true 5 1`
> and you do
> echo 0 > auto
>
> what should a subsequent `cat auto node0 node1` output?
>
> `false 5 1`
> or
> `false 1 1`

IMO, it should be

`false 5 1`

That is, we copy auto-generated weights to manual weights atomically and
use it.

> Then lets say we do
> echo 7 > node0

Now, `cat auto node0 node1` outputs,

`false 7 1`

That is, we delete manual weights and use the auto-generated ones.

> what should
> echo true > auto
> result in?
>
> `true 5 1`
> or
> `true 7 1`

It should be

`true 5 1`

> The current code makes sure that when you switch modes from auto
> to manual, it inherits the current state - instead of there being
> some hidden state that suddenly takes precedence.

I think that we can do that with two weight arrays.

> So I prefer to just have one IW array and no hidden state.

Then, when we switch from manual to auto mode, where to find
auto-generated weights?  Re-calculate them?

---
Best Regards,
Huang, Ying


  reply	other threads:[~2025-01-22  1:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15 18:58 Joshua Hahn
2025-01-20  4:47 ` Hyeonggon Yoo
2025-01-21 21:24   ` Joshua Hahn
2025-01-21 11:17 ` Huang, Ying
2025-01-21 11:27   ` Honggyu Kim
2025-01-21 20:02     ` Gregory Price
2025-01-22  1:24     ` Huang, Ying
2025-02-05  5:34       ` Honggyu Kim
2025-01-21 19:56   ` Gregory Price
2025-01-22  1:37     ` Huang, Ying [this message]
2025-01-22 15:59       ` Joshua Hahn
2025-01-22 16:53         ` Gregory Price
2025-01-23  3:32         ` Huang, Ying
2025-01-24  5:58 ` Matthew Wilcox
2025-01-24 15:48   ` Gregory Price
2025-01-24 15:53   ` Gregory Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734hbiq7j.fsf@DESKTOP-5N7EMDA \
    --to=ying.huang@linux.alibaba.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=gourry@gourry.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=honggyu.kim@sk.com \
    --cc=horen.chuang@linux.dev \
    --cc=hyeonggon.yoo@sk.com \
    --cc=joshua.hahnjy@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rafael@kernel.org \
    --cc=rakie.kim@sk.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox