lkml.org 
[lkml]   [2018]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 13/19] mm/migrate: Use xchg instead of spinlock
From
Date
On Mon, 2018-06-04 at 15:30 +0530, Srikar Dronamraju wrote:
>
> +++ b/mm/migrate.c
> @@ -1874,11 +1874,9 @@ static bool
> numamigrate_update_ratelimit(pg_data_t *pgdat,
> * all the time is being spent migrating!
> */
> if (time_after(jiffies, pgdat-
> >numabalancing_migrate_next_window)) {
> - spin_lock(&pgdat->numabalancing_migrate_lock);
> - pgdat->numabalancing_migrate_nr_pages = 0;
> - pgdat->numabalancing_migrate_next_window = jiffies +
> - msecs_to_jiffies(migrate_interval_millisecs)
> ;
> - spin_unlock(&pgdat->numabalancing_migrate_lock);
> + if (xchg(&pgdat->numabalancing_migrate_nr_pages, 0))
> + pgdat->numabalancing_migrate_next_window =
> jiffies +
> + msecs_to_jiffies(migrate_interval_mi
> llisecs);
> }

I am not convinced this is simpler, but no real
objection either way :)

--
All Rights Reversed.[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-06-04 20:23    [W:0.304 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site