lkml.org 
[lkml]   [2022]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 3/5] sched: Enforce user requested affinity
From

On 8/31/22 05:21, Peter Zijlstra wrote:
> On Wed, Aug 31, 2022 at 11:18:22AM +0200, Peter Zijlstra wrote:
>> On Thu, Aug 25, 2022 at 09:01:17PM -0400, Waiman Long wrote:
>>
>>> @@ -9352,6 +9381,11 @@ int sched_cpu_activate(unsigned int cpu)
>>> sched_update_numa(cpu, true);
>>> sched_domains_numa_masks_set(cpu);
>>> cpuset_cpu_active();
>>> + /*
>>> + * Preallocated scratch cpumask
>>> + */
>>> + if (!rq->scratch_mask)
>>> + rq->scratch_mask = kmalloc(cpumask_size(), GFP_KERNEL);
>>> }
>> this is too late; I think you'll have to add a sched_cpu_prepare() and
>> simply fail the cpu-up when the allocation fails.
> Alternatively, waste some more memory and add yet another per-cpu
> cpumask.

A percpu cpumask is probably a better idea. However, I don't need that
as early as the other cpumasks like __cpu_possible_mask. Maybe I can do
a percpu memory allocation early in the pre-smp boot.

Cheers,
Longman

\
 
 \ /
  Last update: 2022-08-31 23:00    [W:0.124 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site