linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] mm: fixup changers of per cpu pageset's ->high and ->batch
@ 2013-04-09 23:28 Cody P Schafer
  2013-04-09 23:28 ` [PATCH v2 01/10] mm/page_alloc: factor out setting of pcp->high and pcp->batch Cody P Schafer
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Cody P Schafer @ 2013-04-09 23:28 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Gilad Ben-Yossef, Simon Jeons, KOSAKI Motohiro, Mel Gorman,
	Linux MM, LKML, Cody P Schafer

"Problems" with the current code:
 1. there is a lack of synchronization in setting ->high and ->batch in percpu_pagelist_fraction_sysctl_handler()
 2. stop_machine() in zone_pcp_update() is unnecissary.
 3. zone_pcp_update() does not consider the case where percpu_pagelist_fraction is non-zero

To fix:
 1. add memory barriers, a safe ->batch value, and an update side mutex when updating ->high and ->batch
 2. avoid draining pages in zone_pcp_update(), rely upon the memory barriers added to fix #1
 3. factor out quite a few functions, and then call the appropriate one.

Note that it results in a change to the behavior of zone_pcp_update(), which is
used by memory_hotplug. I'm rather certain that I've diserned (and preserved)
the essential behavior (changing ->high and ->batch), and only eliminated
unneeded actions (draining the per cpu pages), but this may not be the case.

Further note that the draining of pages that previously took place in
zone_pcp_update() occured after repeated draining when attempting to offline a
page, and after the offline has "succeeded". It appears that the draining was
added to zone_pcp_update() to avoid refactoring setup_pageset() into 2
funtions.

--
Changes since v1:

 - instead of using on_each_cpu(), use memory barriers (Gilad) and an update side mutex.
 - add "Problem" #3 above, and fix.
 - rename function to match naming style of similar function
 - move unrelated comment

Cody P Schafer (10):
  mm/page_alloc: factor out setting of pcp->high and pcp->batch.
  mm/page_alloc: prevent concurrent updaters of pcp ->batch and ->high
  mm/page_alloc: insert memory barriers to allow async update of pcp
    batch and high
  mm/page_alloc: convert zone_pcp_update() to rely on memory barriers
    instead of stop_machine()
  mm/page_alloc: when handling percpu_pagelist_fraction, don't unneedly
    recalulate high
  mm/page_alloc: factor setup_pageset() into pageset_init() and
    pageset_set_batch()
  mm/page_alloc: relocate comment to be directly above code it refers
    to.
  mm/page_alloc: factor zone_pageset_init() out of setup_zone_pageset()
  mm/page_alloc: in zone_pcp_update(), uze zone_pageset_init()
  mm/page_alloc: rename setup_pagelist_highmark() to match naming of
    pageset_set_batch()

 mm/page_alloc.c | 124 +++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 73 insertions(+), 51 deletions(-)

-- 
1.8.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-04-10 18:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09 23:28 [PATCH v2 00/10] mm: fixup changers of per cpu pageset's ->high and ->batch Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 01/10] mm/page_alloc: factor out setting of pcp->high and pcp->batch Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 02/10] mm/page_alloc: prevent concurrent updaters of pcp ->batch and ->high Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 03/10] mm/page_alloc: insert memory barriers to allow async update of pcp batch and high Cody P Schafer
2013-04-10  6:19   ` Gilad Ben-Yossef
2013-04-10  6:22     ` Gilad Ben-Yossef
2013-04-10 18:31       ` Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 04/10] mm/page_alloc: convert zone_pcp_update() to rely on memory barriers instead of stop_machine() Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 05/10] mm/page_alloc: when handling percpu_pagelist_fraction, don't unneedly recalulate high Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 06/10] mm/page_alloc: factor setup_pageset() into pageset_init() and pageset_set_batch() Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 07/10] mm/page_alloc: relocate comment to be directly above code it refers to Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 08/10] mm/page_alloc: factor zone_pageset_init() out of setup_zone_pageset() Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 09/10] mm/page_alloc: in zone_pcp_update(), uze zone_pageset_init() Cody P Schafer
2013-04-09 23:28 ` [PATCH v2 10/10] mm/page_alloc: rename setup_pagelist_highmark() to match naming of pageset_set_batch() Cody P Schafer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).