[CRIU] [PATCH 3/7] rlimit: Allocate and free appropriate Core entry, v2
Pavel Emelyanov
xemul at parallels.com
Fri Mar 14 03:43:19 PDT 2014
On 03/14/2014 02:37 PM, Cyrill Gorcunov wrote:
> On Fri, Mar 14, 2014 at 02:27:45PM +0400, Pavel Emelyanov wrote:
>> On 03/14/2014 02:19 PM, Cyrill Gorcunov wrote:
>>> 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
>>
>> regular thread, tsk == 0.
>
> Pavel, I don't understand what you're trying to say me ;) We have 2 arguments here @tsk and @th.
> The routine is called in 3 cases
>
> 1) For tasks (thred group leader) th = 1 tsk = 1
> 2) For threads th = 1 tsk = 0
> 3) For zombies th = 0 tsk = 1
>
> we need to dump rlimits for case 1) only and that's where I allocate memory only.
> You propose to allocate memory simply if tsk = 1, or something else?
Yes, I was under impression, that we need rlims only for tsk == 1. Now I
see that the zombies overturn this assumption.
More information about the CRIU
mailing list