[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4961CF1D.8090702@cn.fujitsu.com>
Date: Mon, 05 Jan 2009 17:13:01 +0800
From: Li Zefan <lizf@...fujitsu.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: Ingo Molnar <mingo@...e.hu>, Rusty Russell <rusty@...tcorp.com.au>,
Mike Travis <travis@....com>, Paul Menage <menage@...gle.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists