[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1102211617510.23557@chino.kir.corp.google.com>
Date: Mon, 21 Feb 2011 16:25:17 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Li Zefan <lizf@...fujitsu.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Paul Menage <menage@...gle.com>, miaox@...fujitsu.com,
linux-mm@...ck.org
Subject: Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
On Mon, 21 Feb 2011, Li Zefan wrote:
> Unfortunately, as I looked into the code again I found cpuset_change_nodemask()
> is called by other functions that use the global cpuset_mems, so I
> think we'd better check the refcnt of cpuset_mems.
>
> How about this:
>
> [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
>
> Those functions that use NODEMASK_ALLOC() can't propogate errno
> to users, so might fail silently.
>
> Based on the fact that all of them are called with cgroup_mutex
> held, we fix this by using a global nodemask.
>
If all of the functions that require a nodemask are protected by
cgroup_mutex, then I think it would be much better to just statically
allocate them within the function and avoid any nodemask in file scope.
cpuset_mems cannot be shared so introducing it with a refcount would
probably just be confusing.
--
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