Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-29 Thread Oleg Nesterov
On 09/29, Ingo Molnar wrote: > > * Oleg Nesterov wrote: > > > struct task_struct *next_task_with_mm(struct task_struct *p) > > { > > struct task_struct *t; > > > > p = p->group_leader; > > while ((p = next_task(p)) != _task) { > > if

Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-29 Thread Ingo Molnar
* Oleg Nesterov wrote: > On 09/22, Linus Torvalds wrote: > > > > However, this now becomes a pattern for the series, and that just makes me > > think > > > > "Why is this not a 'for_each_mm()' pattern helper?" > > And we already have other users. And note that oom_kill_process() does

Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-29 Thread Ingo Molnar
* Oleg Nesterov wrote: > On 09/22, Linus Torvalds wrote: > > > > However, this now becomes a pattern for the series, and that just makes me > > think > > > > "Why is this not a 'for_each_mm()' pattern helper?" > > And we already have other users. And note that

Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-29 Thread Oleg Nesterov
On 09/29, Ingo Molnar wrote: > > * Oleg Nesterov wrote: > > > struct task_struct *next_task_with_mm(struct task_struct *p) > > { > > struct task_struct *t; > > > > p = p->group_leader; > > while ((p = next_task(p)) != _task) { > >

Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-23 Thread Oleg Nesterov
On 09/22, Linus Torvalds wrote: > > However, this now becomes a pattern for the series, and that just makes me > think > > "Why is this not a 'for_each_mm()' pattern helper?" And we already have other users. And note that oom_kill_process() does _not_ follow this pattern and that is why it

Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-23 Thread Oleg Nesterov
On 09/22, Linus Torvalds wrote: > > However, this now becomes a pattern for the series, and that just makes me > think > > "Why is this not a 'for_each_mm()' pattern helper?" And we already have other users. And note that oom_kill_process() does _not_ follow this pattern and that is why it

Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-22 Thread Linus Torvalds
On Mon, Sep 21, 2015 at 11:23 PM, Ingo Molnar wrote: > + > + for_each_process(g) { > + struct task_struct *p; > + struct mm_struct *mm; > pgd_t *pgd; > spinlock_t *pgt_lock; > > +

[PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-22 Thread Ingo Molnar
The memory hotplug code uses sync_global_pgds() to synchronize updates to the global (_mm) kernel PGD and the task PGDs. It does this by iterating over the pgd_list - which list closely tracks task creation/destruction via fork/clone. But we want to remove this list, so that it does not have to

[PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-22 Thread Ingo Molnar
The memory hotplug code uses sync_global_pgds() to synchronize updates to the global (_mm) kernel PGD and the task PGDs. It does this by iterating over the pgd_list - which list closely tracks task creation/destruction via fork/clone. But we want to remove this list, so that it does not have to

Re: [PATCH 02/11] x86/mm/hotplug: Remove pgd_list use from the memory hotplug code

2015-09-22 Thread Linus Torvalds
On Mon, Sep 21, 2015 at 11:23 PM, Ingo Molnar wrote: > + > + for_each_process(g) { > + struct task_struct *p; > + struct mm_struct *mm; > pgd_t *pgd; > spinlock_t *pgt_lock;