lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] sched/core: Introduce nr_running percpu for each cookie
On Tue, Jun 28, 2022 at 03:57:24PM +0800, Cruz Zhao wrote:

> static unsigned long sched_core_alloc_cookie(void)
> {
> struct sched_core_cookie *ck = kmalloc(sizeof(*ck), GFP_KERNEL);
> + int cpu;
> +
> if (!ck)
> return 0;
>
> refcount_set(&ck->refcnt, 1);
> +
> + ck->nr_running = alloc_percpu(unsigned int);

if (!ck->nr_running)
// do something

> + for_each_possible_cpu(cpu)
> + *per_cpu_ptr(ck->nr_running, cpu) = 0;

So I really, as in *really* dislike how this blows up the size of
cookies. Esp. with 100s of CPUs not actually being rare these days.

\
 
 \ /
  Last update: 2022-07-04 11:45    [W:0.760 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site