lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8734hbiq7j.fsf@DESKTOP-5N7EMDA>
Date: Wed, 22 Jan 2025 09:37:20 +0800
From: "Huang, Ying" <ying.huang@...ux.alibaba.com>
To: Gregory Price <gourry@...rry.net>
Cc: Joshua Hahn <joshua.hahnjy@...il.com>,  hyeonggon.yoo@...com,
  rafael@...nel.org,  lenb@...nel.org,  gregkh@...uxfoundation.org,
  akpm@...ux-foundation.org,  honggyu.kim@...com,  rakie.kim@...com,
  dan.j.williams@...el.com,  Jonathan.Cameron@...wei.com,
  dave.jiang@...el.com,  horen.chuang@...ux.dev,  hannes@...xchg.org,
  linux-kernel@...r.kernel.org,  linux-acpi@...r.kernel.org,
  linux-mm@...ck.org,  kernel-team@...a.com
Subject: Re: [PATCH v3] Weighted interleave auto-tuning

Gregory Price <gourry@...rry.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ