Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-07-23 Thread Peter Zijlstra
On Mon, Jul 23, 2018 at 04:20:32AM -0700, Srikar Dronamraju wrote: > > If you maybe write that like: > > > > if (time_after(jiffies, next_window) && > > xchg(>numabalancing_migrate_nr_pages, 0UL)) { > > > > do { > > next_window += interval; > >

Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-07-23 Thread Peter Zijlstra
On Mon, Jul 23, 2018 at 04:20:32AM -0700, Srikar Dronamraju wrote: > > If you maybe write that like: > > > > if (time_after(jiffies, next_window) && > > xchg(>numabalancing_migrate_nr_pages, 0UL)) { > > > > do { > > next_window += interval; > >

Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-07-23 Thread Srikar Dronamraju
> If you maybe write that like: > > if (time_after(jiffies, next_window) && > xchg(>numabalancing_migrate_nr_pages, 0UL)) { > > do { > next_window += interval; > } while (unlikely(time_after(jiffies, next_window))); > >

Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-07-23 Thread Srikar Dronamraju
> If you maybe write that like: > > if (time_after(jiffies, next_window) && > xchg(>numabalancing_migrate_nr_pages, 0UL)) { > > do { > next_window += interval; > } while (unlikely(time_after(jiffies, next_window))); > >

Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-07-23 Thread Peter Zijlstra
On Wed, Jun 20, 2018 at 10:32:54PM +0530, Srikar Dronamraju wrote: > Currently resetting the migrate rate limit is under a spinlock. > The spinlock will only serialize the migrate rate limiting and something > similar can actually be achieved by a simpler xchg. You're again not explaining things

Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-07-23 Thread Peter Zijlstra
On Wed, Jun 20, 2018 at 10:32:54PM +0530, Srikar Dronamraju wrote: > Currently resetting the migrate rate limit is under a spinlock. > The spinlock will only serialize the migrate rate limiting and something > similar can actually be achieved by a simpler xchg. You're again not explaining things

Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-06-21 Thread Mel Gorman
On Wed, Jun 20, 2018 at 10:32:54PM +0530, Srikar Dronamraju wrote: > Currently resetting the migrate rate limit is under a spinlock. > The spinlock will only serialize the migrate rate limiting and something > similar can actually be achieved by a simpler xchg. > > Running SPECjbb2005 on a 4 node

Re: [PATCH v2 13/19] mm/migrate: Use xchg instead of spinlock

2018-06-21 Thread Mel Gorman
On Wed, Jun 20, 2018 at 10:32:54PM +0530, Srikar Dronamraju wrote: > Currently resetting the migrate rate limit is under a spinlock. > The spinlock will only serialize the migrate rate limiting and something > similar can actually be achieved by a simpler xchg. > > Running SPECjbb2005 on a 4 node