[CRIU] [PATCH 3/7] rlimit: Allocate and free appropriate Core entry, v2
Cyrill Gorcunov
gorcunov at gmail.com
Fri Mar 14 03:19:56 PDT 2014
On Fri, Mar 14, 2014 at 02:06:55PM +0400, Pavel Emelyanov wrote:
> On 03/14/2014 01:48 PM, Cyrill Gorcunov wrote:
> > On Fri, Mar 14, 2014 at 01:45:25PM +0400, Pavel Emelyanov wrote:
> >>>
> >>> if (th) {
> >>
> >> rlimits are per task, why allocating them per thread?
> >
> > No, the idea behind is that we allocating them per thread group leader,
> > ie when th = 1 _and_ tsk = 1 only.
>
> For threads tsk == 0, isn't it?
for (i = 0; i < item->nr_threads; i++) {
if (item->threads[i].real == item->pid.real)
item->core[i] = core_entry_alloc(1, 1); <-- group leader (task)
else
item->core[i] = core_entry_alloc(1, 0); <-- regular thread
if (!item->core[i])
goto err;
}
Cyrill
More information about the CRIU
mailing list