Re: [PATCH v3 1/1] kthread: allocate kthread structure using kmalloc
From: Oleg Nesterov
Date: Tue Oct 25 2016 - 12:19:04 EST
Roman, I need to run away, just one note.
On 10/25, Roman Penyaev wrote:
>
> On Tue, Oct 25, 2016 at 5:43 PM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> So in particular I do not understand this comment from the patch above
> where you abuse 'current->set_child_tid':
>
> * This is the ugly but simple hack we will hopefully remove soon.
>
> how you are going to avoid this abuse of set_child_tid?
please ignore this comment. It actually reflects my desire to kill
struct kthread. If we won't do this, we can (ab)use this or another member
in task_struct.
> or vfork_done?
> because vfork_done is not only for waking up (yes, I totally agree, we
> can reuse task_work), it is also for getting a private data (like
> workqueue uses it): task_struct->vfork_done->kthread->data.
kthreads simply should not use ->vfork_done at all. to_kthread() can
use the same pointer.
Oleg.