Cody P Schafer 8d7a8fa97a mm/page_alloc: insert memory barriers to allow async update of pcp batch and high
Introduce pageset_update() to perform a safe transision from one set of
pcp->{batch,high} to a new set using memory barriers.

This ensures that batch is always set to a safe value (1) prior to
updating high, and ensure that high is fully updated before setting the
real value of batch.  It avoids ->batch ever rising above ->high.

Suggested by Gilad Ben-Yossef in these threads:

	https://lkml.org/lkml/2013/4/9/23
	https://lkml.org/lkml/2013/4/10/49

Also reproduces his proposed comment.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Reviewed-by: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03 16:07:27 -07:00
..
2012-01-03 22:54:56 -05:00
2013-07-03 10:31:38 -07:00
2011-07-26 16:49:47 -07:00
2013-02-23 17:50:18 -08:00
2010-05-21 18:31:21 -04:00
2012-06-20 14:39:36 -07:00
2013-07-03 16:23:27 +04:00
2013-02-23 17:50:18 -08:00
2013-05-07 20:16:25 -07:00
2013-05-07 18:38:27 -07:00