lkml.org 
[lkml]   [2019]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC 10/10] autonuma, memory tiering: Adjust hot threshold automatically
Date
Peter Zijlstra <peterz@infradead.org> writes:

> On Mon, Nov 04, 2019 at 02:11:11PM +0800, Huang, Ying wrote:
>> Peter Zijlstra <peterz@infradead.org> writes:
>>
>> > On Fri, Nov 01, 2019 at 03:57:27PM +0800, Huang, Ying wrote:
>> >
>> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> >> index 0a83e9cf6685..22bdbb7afac2 100644
>> >> --- a/kernel/sched/fair.c
>> >> +++ b/kernel/sched/fair.c
>> >> @@ -1486,6 +1486,41 @@ static bool numa_migration_check_rate_limit(struct pglist_data *pgdat,
>> >> return true;
>> >> }
>> >>
>> >> +#define NUMA_MIGRATION_ADJUST_STEPS 16
>> >> +
>> >> +static void numa_migration_adjust_threshold(struct pglist_data *pgdat,
>> >> + unsigned long rate_limit,
>> >> + unsigned long ref_threshold)
>> >> +{
>> >> + unsigned long now = jiffies, last_threshold_jiffies;
>> >> + unsigned long unit_threshold, threshold;
>> >> + unsigned long try_migrate, ref_try_migrate, mdiff;
>> >> +
>> >> + last_threshold_jiffies = pgdat->autonuma_threshold_jiffies;
>> >> + if (now > last_threshold_jiffies +
>> >> + msecs_to_jiffies(sysctl_numa_balancing_scan_period_max) &&
>> >> + cmpxchg(&pgdat->autonuma_threshold_jiffies,
>> >> + last_threshold_jiffies, now) == last_threshold_jiffies) {
>> >
>> > That is seriously unreadable gunk.
>>
>> The basic idea here is to adjust hot threshold every
>
> Oh, I figured out what it does, but it's just really hard to read
> because of those silly variable names.
>
> This was just a first quick read through of the patches, and stuff like
> this annoys me no end. I did start a rewrite with more sensible variable
> names, but figured this might not be time for that.

Sorry about the poor naming. That is always hard for me.

> I still need to think and review the whole concept in more detail, now
> that I've read the patches. But I need to chase regressions first :/

Thanks for your help!

> FWIW, can you post a SLIT / NUMA distance table for such a system?

Sure. Will send you as attachment in another email.

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2019-11-04 11:13    [W:0.120 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site