lkml.org 
[lkml]   [2009]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/6] cpuset: don't allocate trial cpuset on stack
>> -static int update_cpumask(struct cpuset *cs, const char *buf)
>> +static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>> + const char *buf)
>> {
>> struct ptr_heap heap;
>> - struct cpuset trialcs;
>> int retval;
>> int is_load_balanced;
>>
>> @@ -891,8 +909,6 @@ static int update_cpumask(struct cpuset *cs, const char *buf)
>> if (cs == &top_cpuset)
>> return -EACCES;
>>
>> - trialcs = *cs;
>
> Yes, we already do.
>
> That thing contains spinlocks and list_heads (at least), which cannot
> be copied in this way.
>
> Seems that we're doing this gross thing because it just so happens that
> we only use the cpus_allowed and mems_allowed fields, and because

and also cpuset->flags.

> several of the called functions require a cpuset*, but only needed a
> cpumask_t.
>
> How perfectly beastly.
>

trial cpuset is used to ease the validation of changes to a cpuset. It
can be get rid of, but I'm afraid that the resulting code will be more
complex and less readable.


\
 
 \ /
  Last update: 2009-01-05 10:17    [W:0.333 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site