Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-25 Thread Mel Gorman
On Tue, Jan 24, 2017 at 09:02:20PM -0500, Tejun Heo wrote: > Hello, > > On Tue, Jan 24, 2017 at 11:54:57PM +, Mel Gorman wrote: > > @@ -2402,24 +2415,16 @@ void drain_all_pages(struct zone *zone) > > cpumask_clear_cpu(cpu, _with_pcps); > > } > > > > +

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-25 Thread Mel Gorman
On Tue, Jan 24, 2017 at 09:02:20PM -0500, Tejun Heo wrote: > Hello, > > On Tue, Jan 24, 2017 at 11:54:57PM +, Mel Gorman wrote: > > @@ -2402,24 +2415,16 @@ void drain_all_pages(struct zone *zone) > > cpumask_clear_cpu(cpu, _with_pcps); > > } > > > > +

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Tejun Heo
Hello, On Tue, Jan 24, 2017 at 11:54:57PM +, Mel Gorman wrote: > @@ -2402,24 +2415,16 @@ void drain_all_pages(struct zone *zone) > cpumask_clear_cpu(cpu, _with_pcps); > } > > + for_each_cpu(cpu, _with_pcps) { > + struct work_struct *work =

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Tejun Heo
Hello, On Tue, Jan 24, 2017 at 11:54:57PM +, Mel Gorman wrote: > @@ -2402,24 +2415,16 @@ void drain_all_pages(struct zone *zone) > cpumask_clear_cpu(cpu, _with_pcps); > } > > + for_each_cpu(cpu, _with_pcps) { > + struct work_struct *work =

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Mel Gorman
On Tue, Jan 24, 2017 at 11:07:22AM -0500, Tejun Heo wrote: > Hello, Mel. > > On Mon, Jan 23, 2017 at 11:04:29PM +, Mel Gorman wrote: > > On Mon, Jan 23, 2017 at 03:55:01PM -0500, Tejun Heo wrote: > > > Hello, Mel. > > > > > > On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Mel Gorman
On Tue, Jan 24, 2017 at 11:07:22AM -0500, Tejun Heo wrote: > Hello, Mel. > > On Mon, Jan 23, 2017 at 11:04:29PM +, Mel Gorman wrote: > > On Mon, Jan 23, 2017 at 03:55:01PM -0500, Tejun Heo wrote: > > > Hello, Mel. > > > > > > On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Tejun Heo
Hello, Mel. On Mon, Jan 23, 2017 at 11:04:29PM +, Mel Gorman wrote: > On Mon, Jan 23, 2017 at 03:55:01PM -0500, Tejun Heo wrote: > > Hello, Mel. > > > > On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > > > What is the actual mechanism that does that? It's not something that > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Tejun Heo
Hello, Mel. On Mon, Jan 23, 2017 at 11:04:29PM +, Mel Gorman wrote: > On Mon, Jan 23, 2017 at 03:55:01PM -0500, Tejun Heo wrote: > > Hello, Mel. > > > > On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > > > What is the actual mechanism that does that? It's not something that > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Vlastimil Babka
On 01/17/2017 10:29 AM, Mel Gorman wrote: > The per-cpu page allocator can be drained immediately via drain_all_pages() > which sends IPIs to every CPU. In the next patch, the per-cpu allocator > will only be used for interrupt-safe allocations which prevents draining > it from IPI context. This

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-24 Thread Vlastimil Babka
On 01/17/2017 10:29 AM, Mel Gorman wrote: > The per-cpu page allocator can be drained immediately via drain_all_pages() > which sends IPIs to every CPU. In the next patch, the per-cpu allocator > will only be used for interrupt-safe allocations which prevents draining > it from IPI context. This

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
On Mon, Jan 23, 2017 at 03:55:01PM -0500, Tejun Heo wrote: > Hello, Mel. > > On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > > What is the actual mechanism that does that? It's not something that > > schedule_on_each_cpu does and one would expect that the core workqueue > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
On Mon, Jan 23, 2017 at 03:55:01PM -0500, Tejun Heo wrote: > Hello, Mel. > > On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > > What is the actual mechanism that does that? It's not something that > > schedule_on_each_cpu does and one would expect that the core workqueue > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Tejun Heo
Hello, Mel. On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > What is the actual mechanism that does that? It's not something that > schedule_on_each_cpu does and one would expect that the core workqueue > implementation would get this sort of detail correct. Or is this a proposal >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Tejun Heo
Hello, Mel. On Mon, Jan 23, 2017 at 08:04:12PM +, Mel Gorman wrote: > What is the actual mechanism that does that? It's not something that > schedule_on_each_cpu does and one would expect that the core workqueue > implementation would get this sort of detail correct. Or is this a proposal >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
On Mon, Jan 23, 2017 at 12:03:29PM -0500, Tejun Heo wrote: > Hello, > > On Fri, Jan 20, 2017 at 03:26:06PM +, Mel Gorman wrote: > > > This translates to queue_work_on(), which has the comment of "We queue > > > the work to a specific CPU, the caller must ensure it can't go away.", > > > so is

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
On Mon, Jan 23, 2017 at 12:03:29PM -0500, Tejun Heo wrote: > Hello, > > On Fri, Jan 20, 2017 at 03:26:06PM +, Mel Gorman wrote: > > > This translates to queue_work_on(), which has the comment of "We queue > > > the work to a specific CPU, the caller must ensure it can't go away.", > > > so is

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Tejun Heo
Hello, On Fri, Jan 20, 2017 at 03:26:06PM +, Mel Gorman wrote: > > This translates to queue_work_on(), which has the comment of "We queue > > the work to a specific CPU, the caller must ensure it can't go away.", > > so is this safe? lru_add_drain_all() uses get_online_cpus() around this. > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Tejun Heo
Hello, On Fri, Jan 20, 2017 at 03:26:06PM +, Mel Gorman wrote: > > This translates to queue_work_on(), which has the comment of "We queue > > the work to a specific CPU, the caller must ensure it can't go away.", > > so is this safe? lru_add_drain_all() uses get_online_cpus() around this. > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
On Mon, Jan 23, 2017 at 05:29:20PM +0100, Petr Mladek wrote: > On Fri 2017-01-20 15:26:06, Mel Gorman wrote: > > On Fri, Jan 20, 2017 at 03:26:05PM +0100, Vlastimil Babka wrote: > > > > @@ -2392,8 +2404,24 @@ void drain_all_pages(struct zone *zone) > > > > else > > > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
On Mon, Jan 23, 2017 at 05:29:20PM +0100, Petr Mladek wrote: > On Fri 2017-01-20 15:26:06, Mel Gorman wrote: > > On Fri, Jan 20, 2017 at 03:26:05PM +0100, Vlastimil Babka wrote: > > > > @@ -2392,8 +2404,24 @@ void drain_all_pages(struct zone *zone) > > > > else > > > >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Petr Mladek
On Fri 2017-01-20 15:26:06, Mel Gorman wrote: > On Fri, Jan 20, 2017 at 03:26:05PM +0100, Vlastimil Babka wrote: > > > @@ -2392,8 +2404,24 @@ void drain_all_pages(struct zone *zone) > > > else > > > cpumask_clear_cpu(cpu, _with_pcps); > > > } > > > -

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Petr Mladek
On Fri 2017-01-20 15:26:06, Mel Gorman wrote: > On Fri, Jan 20, 2017 at 03:26:05PM +0100, Vlastimil Babka wrote: > > > @@ -2392,8 +2404,24 @@ void drain_all_pages(struct zone *zone) > > > else > > > cpumask_clear_cpu(cpu, _with_pcps); > > > } > > > -

[PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
The per-cpu page allocator can be drained immediately via drain_all_pages() which sends IPIs to every CPU. In the next patch, the per-cpu allocator will only be used for interrupt-safe allocations which prevents draining it from IPI context. This patch uses workqueues to drain the per-cpu lists

[PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-23 Thread Mel Gorman
The per-cpu page allocator can be drained immediately via drain_all_pages() which sends IPIs to every CPU. In the next patch, the per-cpu allocator will only be used for interrupt-safe allocations which prevents draining it from IPI context. This patch uses workqueues to drain the per-cpu lists

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-20 Thread Mel Gorman
On Fri, Jan 20, 2017 at 03:26:05PM +0100, Vlastimil Babka wrote: > > @@ -2392,8 +2404,24 @@ void drain_all_pages(struct zone *zone) > > else > > cpumask_clear_cpu(cpu, _with_pcps); > > } > > - on_each_cpu_mask(_with_pcps, (smp_call_func_t) drain_local_pages, >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-20 Thread Mel Gorman
On Fri, Jan 20, 2017 at 03:26:05PM +0100, Vlastimil Babka wrote: > > @@ -2392,8 +2404,24 @@ void drain_all_pages(struct zone *zone) > > else > > cpumask_clear_cpu(cpu, _with_pcps); > > } > > - on_each_cpu_mask(_with_pcps, (smp_call_func_t) drain_local_pages, >

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-20 Thread Vlastimil Babka
On 01/17/2017 10:29 AM, Mel Gorman wrote: > The per-cpu page allocator can be drained immediately via drain_all_pages() > which sends IPIs to every CPU. In the next patch, the per-cpu allocator > will only be used for interrupt-safe allocations which prevents draining > it from IPI context. This

Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-20 Thread Vlastimil Babka
On 01/17/2017 10:29 AM, Mel Gorman wrote: > The per-cpu page allocator can be drained immediately via drain_all_pages() > which sends IPIs to every CPU. In the next patch, the per-cpu allocator > will only be used for interrupt-safe allocations which prevents draining > it from IPI context. This

[PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-17 Thread Mel Gorman
The per-cpu page allocator can be drained immediately via drain_all_pages() which sends IPIs to every CPU. In the next patch, the per-cpu allocator will only be used for interrupt-safe allocations which prevents draining it from IPI context. This patch uses workqueues to drain the per-cpu lists

[PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context

2017-01-17 Thread Mel Gorman
The per-cpu page allocator can be drained immediately via drain_all_pages() which sends IPIs to every CPU. In the next patch, the per-cpu allocator will only be used for interrupt-safe allocations which prevents draining it from IPI context. This patch uses workqueues to drain the per-cpu lists