{"push_id":927008861,"size":7,"distinct_size":7,"ref":"refs/heads/caf/aosp-common/android-3.14","head":"f95365e303fbc5b27600d8448afb7e687f1393bc","before":"198654a5cc6aab4c3bf89e705d14933f0464616f","commits":[{"sha":"65cdb80525b12410010e1d4f02bf07b3fb1bac63","author":{"email":"fc379137a64feb86ce38ec5811a14280acc1ccfc@samsung.com","name":"Jingoo Han"},"message":"UPSTREAM: rtc: rtc-palmas: make of_device_id array const\n\n(cherry pick from commit 7abe3f5404fae84cecd851e140a2218ba9d24e4f)\n\nMake of_device_id array const, because all OF functions handle it as\nconst.\n\nSigned-off-by: Jingoo Han <jg1.han@samsung.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Mark Salyzyn <salyzyn@google.com>\nBug: 26346842\nChange-Id: Idb8b070b72a77c80df6c7f1aae92f803243295c3","distinct":true,"url":"https://api.github.com/repos/kykdev/caf-msm-3.10/commits/65cdb80525b12410010e1d4f02bf07b3fb1bac63"},{"sha":"bd3dc9dda36b42067f0baee7c3d0b12c2c1e8220","author":{"email":"4bb1064d1f46929ded0070376617aece30f0ee54@google.com","name":"Mark Salyzyn"},"message":"ANDROID: rtc-palmas: correct for bcd year\n\nReplace bcd2bin and bin2bcd with one that maps years 1970 to 2129\nin a pattern that works with the underlying hardware.\n\nThe only transition that does not work correctly for this rtc clock\nis the transition from 2099 to 2100, it proceeds to 2000. The rtc\nclock retains and transitions the year correctly in all other\ncircumstances.\n\nSigned-off-by: Mark Salyzyn <salyzyn@google.com>\nBug: 26346842\nChange-Id: I7a9cee7a8aff0c038838b2865fb9e557b338c1a2","distinct":true,"url":"https://api.github.com/repos/kykdev/caf-msm-3.10/commits/bd3dc9dda36b42067f0baee7c3d0b12c2c1e8220"},{"sha":"397fc1f13b9fa4361f3d95e670823633d699a284","author":{"email":"db766431e3f0373ca1ec8fa855cfd5f84b2f2eb6@suse.cz","name":"Vlastimil Babka"},"message":"UPSTREAM: mm/page_alloc: prevent MIGRATE_RESERVE pages from being misplaced\n\n(cherry pick from commit 5bcc9f86ef09a933255ee66bd899d4601785dad5)\n\nFor the MIGRATE_RESERVE pages, it is useful when they do not get\nmisplaced on free_list of other migratetype, otherwise they might get\nallocated prematurely and e.g.  fragment the MIGRATE_RESEVE pageblocks.\nWhile this cannot be avoided completely when allocating new\nMIGRATE_RESERVE pageblocks in min_free_kbytes sysctl handler, we should\nprevent the misplacement where possible.\n\nCurrently, it is possible for the misplacement to happen when a\nMIGRATE_RESERVE page is allocated on pcplist through rmqueue_bulk() as a\nfallback for other desired migratetype, and then later freed back\nthrough free_pcppages_bulk() without being actually used.  This happens\nbecause free_pcppages_bulk() uses get_freepage_migratetype() to choose\nthe free_list, and rmqueue_bulk() calls set_freepage_migratetype() with\nthe *desired* migratetype and not the page's original MIGRATE_RESERVE\nmigratetype.\n\nThis patch fixes the problem by moving the call to\nset_freepage_migratetype() from rmqueue_bulk() down to\n__rmqueue_smallest() and __rmqueue_fallback() where the actual page's\nmigratetype (e.g.  from which free_list the page is taken from) is used.\nNote that this migratetype might be different from the pageblock's\nmigratetype due to freepage stealing decisions.  This is OK, as page\nstealing never uses MIGRATE_RESERVE as a fallback, and also takes care\nto leave all MIGRATE_CMA pages on the correct freelist.\n\nTherefore, as an additional benefit, the call to\nget_pageblock_migratetype() from rmqueue_bulk() when CMA is enabled, can\nbe removed completely.  This relies on the fact that MIGRATE_CMA\npageblocks are created only during system init, and the above.  The\nrelated is_migrate_isolate() check is also unnecessary, as memory\nisolation has other ways to move pages between freelists, and drain pcp\nlists containing pages that should be isolated.  The buffered_rmqueue()\ncan also benefit from calling get_freepage_migratetype() instead of\nget_pageblock_migratetype().\n\nSigned-off-by: Vlastimil Babka <vbabka@suse.cz>\nReported-by: Yong-Taek Lee <ytk.lee@samsung.com>\nReported-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>\nSuggested-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>\nAcked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>\nSuggested-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Minchan Kim <minchan@kernel.org>\nCc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>\nCc: Marek Szyprowski <m.szyprowski@samsung.com>\nCc: Hugh Dickins <hughd@google.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: Michal Nazarewicz <mina86@mina86.com>\nCc: \"Wang, Yalin\" <Yalin.Wang@sonymobile.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nBug: 26295735\nBug: 26412925\nBug: 26379045\nChange-Id: I9c97a88508defa034d5673831cdc845646e547ab","distinct":true,"url":"https://api.github.com/repos/kykdev/caf-msm-3.10/commits/397fc1f13b9fa4361f3d95e670823633d699a284"},{"sha":"512d3ff0f5ce42495c6743a506a1461bffe467f3","author":{"email":"db766431e3f0373ca1ec8fa855cfd5f84b2f2eb6@suse.cz","name":"Vlastimil Babka"},"message":"UPSTREAM: mm: when stealing freepages, also take pages created by splitting buddy page\n\n(cherry pick from commit 99592d598eca62bdbbf62b59941c189176dfc614)\n\nWhen studying page stealing, I noticed some weird looking decisions in\ntry_to_steal_freepages().  The first I assume is a bug (Patch 1), the\nfollowing two patches were driven by evaluation.\n\nTesting was done with stress-highalloc of mmtests, using the\nmm_page_alloc_extfrag tracepoint and postprocessing to get counts of how\noften page stealing occurs for individual migratetypes, and what\nmigratetypes are used for fallbacks.  Arguably, the worst case of page\nstealing is when UNMOVABLE allocation steals from MOVABLE pageblock.\nRECLAIMABLE allocation stealing from MOVABLE allocation is also not ideal,\nso the goal is to minimize these two cases.\n\nThe evaluation of v2 wasn't always clear win and Joonsoo questioned the\nresults.  Here I used different baseline which includes RFC compaction\nimprovements from [1].  I found that the compaction improvements reduce\nvariability of stress-highalloc, so there's less noise in the data.\n\nFirst, let's look at stress-highalloc configured to do sync compaction,\nand how these patches reduce page stealing events during the test.  First\ncolumn is after fresh reboot, other two are reiterations of test without\nreboot.  That was all accumulater over 5 re-iterations (so the benchmark\nwas run 5x3 times with 5 fresh restarts).\n\nBaseline:\n\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                  5-nothp-1       5-nothp-2       5-nothp-3\nPage alloc extfrag event                               10264225     8702233    10244125\nExtfrag fragmenting                                    10263271     8701552    10243473\nExtfrag fragmenting for unmovable                         13595       17616       15960\nExtfrag fragmenting unmovable placed with movable          7989       12193        8447\nExtfrag fragmenting for reclaimable                         658        1840        1817\nExtfrag fragmenting reclaimable placed with movable         558        1677        1679\nExtfrag fragmenting for movable                        10249018     8682096    10225696\n\nWith Patch 1:\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                  6-nothp-1       6-nothp-2       6-nothp-3\nPage alloc extfrag event                               11834954     9877523     9774860\nExtfrag fragmenting                                    11833993     9876880     9774245\nExtfrag fragmenting for unmovable                          7342       16129       11712\nExtfrag fragmenting unmovable placed with movable          4191       10547        6270\nExtfrag fragmenting for reclaimable                         373        1130         923\nExtfrag fragmenting reclaimable placed with movable         302         906         738\nExtfrag fragmenting for movable                        11826278     9859621     9761610\n\nWith Patch 2:\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                  7-nothp-1       7-nothp-2       7-nothp-3\nPage alloc extfrag event                                4725990     3668793     3807436\nExtfrag fragmenting                                     4725104     3668252     3806898\nExtfrag fragmenting for unmovable                          6678        7974        7281\nExtfrag fragmenting unmovable placed with movable          2051        3829        4017\nExtfrag fragmenting for reclaimable                         429        1208        1278\nExtfrag fragmenting reclaimable placed with movable         369         976        1034\nExtfrag fragmenting for movable                         4717997     3659070     3798339\n\nWith Patch 3:\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                  8-nothp-1       8-nothp-2       8-nothp-3\nPage alloc extfrag event                                5016183     4700142     3850633\nExtfrag fragmenting                                     5015325     4699613     3850072\nExtfrag fragmenting for unmovable                          1312        3154        3088\nExtfrag fragmenting unmovable placed with movable          1115        2777        2714\nExtfrag fragmenting for reclaimable                         437        1193        1097\nExtfrag fragmenting reclaimable placed with movable         330         969         879\nExtfrag fragmenting for movable                         5013576     4695266     3845887\n\nIn v2 we've seen apparent regression with Patch 1 for unmovable events,\nthis is now gone, suggesting it was indeed noise.  Here, each patch\nimproves the situation for unmovable events.  Reclaimable is improved by\npatch 1 and then either the same modulo noise, or perhaps sligtly worse -\na small price for unmovable improvements, IMHO.  The number of movable\nallocations falling back to other migratetypes is most noisy, but it's\nreduced to half at Patch 2 nevertheless.  These are least critical as\ncompaction can move them around.\n\nIf we look at success rates, the patches don't affect them, that didn't change.\n\nBaseline:\n                             3.19-rc4              3.19-rc4              3.19-rc4\n                            5-nothp-1             5-nothp-2             5-nothp-3\nSuccess 1 Min         49.00 (  0.00%)       42.00 ( 14.29%)       41.00 ( 16.33%)\nSuccess 1 Mean        51.00 (  0.00%)       45.00 ( 11.76%)       42.60 ( 16.47%)\nSuccess 1 Max         55.00 (  0.00%)       51.00 (  7.27%)       46.00 ( 16.36%)\nSuccess 2 Min         53.00 (  0.00%)       47.00 ( 11.32%)       44.00 ( 16.98%)\nSuccess 2 Mean        59.60 (  0.00%)       50.80 ( 14.77%)       48.20 ( 19.13%)\nSuccess 2 Max         64.00 (  0.00%)       56.00 ( 12.50%)       52.00 ( 18.75%)\nSuccess 3 Min         84.00 (  0.00%)       82.00 (  2.38%)       78.00 (  7.14%)\nSuccess 3 Mean        85.60 (  0.00%)       82.80 (  3.27%)       79.40 (  7.24%)\nSuccess 3 Max         86.00 (  0.00%)       83.00 (  3.49%)       80.00 (  6.98%)\n\nPatch 1:\n                             3.19-rc4              3.19-rc4              3.19-rc4\n                            6-nothp-1             6-nothp-2             6-nothp-3\nSuccess 1 Min         49.00 (  0.00%)       44.00 ( 10.20%)       44.00 ( 10.20%)\nSuccess 1 Mean        51.80 (  0.00%)       46.00 ( 11.20%)       45.80 ( 11.58%)\nSuccess 1 Max         54.00 (  0.00%)       49.00 (  9.26%)       49.00 (  9.26%)\nSuccess 2 Min         58.00 (  0.00%)       49.00 ( 15.52%)       48.00 ( 17.24%)\nSuccess 2 Mean        60.40 (  0.00%)       51.80 ( 14.24%)       50.80 ( 15.89%)\nSuccess 2 Max         63.00 (  0.00%)       54.00 ( 14.29%)       55.00 ( 12.70%)\nSuccess 3 Min         84.00 (  0.00%)       81.00 (  3.57%)       79.00 (  5.95%)\nSuccess 3 Mean        85.00 (  0.00%)       81.60 (  4.00%)       79.80 (  6.12%)\nSuccess 3 Max         86.00 (  0.00%)       82.00 (  4.65%)       82.00 (  4.65%)\n\nPatch 2:\n\n                             3.19-rc4              3.19-rc4              3.19-rc4\n                            7-nothp-1             7-nothp-2             7-nothp-3\nSuccess 1 Min         50.00 (  0.00%)       44.00 ( 12.00%)       39.00 ( 22.00%)\nSuccess 1 Mean        52.80 (  0.00%)       45.60 ( 13.64%)       42.40 ( 19.70%)\nSuccess 1 Max         55.00 (  0.00%)       46.00 ( 16.36%)       47.00 ( 14.55%)\nSuccess 2 Min         52.00 (  0.00%)       48.00 (  7.69%)       45.00 ( 13.46%)\nSuccess 2 Mean        53.40 (  0.00%)       49.80 (  6.74%)       48.80 (  8.61%)\nSuccess 2 Max         57.00 (  0.00%)       52.00 (  8.77%)       52.00 (  8.77%)\nSuccess 3 Min         84.00 (  0.00%)       81.00 (  3.57%)       79.00 (  5.95%)\nSuccess 3 Mean        85.00 (  0.00%)       82.40 (  3.06%)       79.60 (  6.35%)\nSuccess 3 Max         86.00 (  0.00%)       83.00 (  3.49%)       80.00 (  6.98%)\n\nPatch 3:\n                             3.19-rc4              3.19-rc4              3.19-rc4\n                            8-nothp-1             8-nothp-2             8-nothp-3\nSuccess 1 Min         46.00 (  0.00%)       44.00 (  4.35%)       42.00 (  8.70%)\nSuccess 1 Mean        50.20 (  0.00%)       45.60 (  9.16%)       44.00 ( 12.35%)\nSuccess 1 Max         52.00 (  0.00%)       47.00 (  9.62%)       47.00 (  9.62%)\nSuccess 2 Min         53.00 (  0.00%)       49.00 (  7.55%)       48.00 (  9.43%)\nSuccess 2 Mean        55.80 (  0.00%)       50.60 (  9.32%)       49.00 ( 12.19%)\nSuccess 2 Max         59.00 (  0.00%)       52.00 ( 11.86%)       51.00 ( 13.56%)\nSuccess 3 Min         84.00 (  0.00%)       80.00 (  4.76%)       79.00 (  5.95%)\nSuccess 3 Mean        85.40 (  0.00%)       81.60 (  4.45%)       80.40 (  5.85%)\nSuccess 3 Max         87.00 (  0.00%)       83.00 (  4.60%)       82.00 (  5.75%)\n\nWhile there's no improvement here, I consider reduced fragmentation events\nto be worth on its own.  Patch 2 also seems to reduce scanning for free\npages, and migrations in compaction, suggesting it has somewhat less work\nto do:\n\nPatch 1:\n\nCompaction stalls                 4153        3959        3978\nCompaction success                1523        1441        1446\nCompaction failures               2630        2517        2531\nPage migrate success           4600827     4943120     5104348\nPage migrate failure             19763       16656       17806\nCompaction pages isolated      9597640    10305617    10653541\nCompaction migrate scanned    77828948    86533283    87137064\nCompaction free scanned      517758295   521312840   521462251\nCompaction cost                   5503        5932        6110\n\nPatch 2:\n\nCompaction stalls                 3800        3450        3518\nCompaction success                1421        1316        1317\nCompaction failures               2379        2134        2201\nPage migrate success           4160421     4502708     4752148\nPage migrate failure             19705       14340       14911\nCompaction pages isolated      8731983     9382374     9910043\nCompaction migrate scanned    98362797    96349194    98609686\nCompaction free scanned      496512560   469502017   480442545\nCompaction cost                   5173        5526        5811\n\nAs with v2, /proc/pagetypeinfo appears unaffected with respect to numbers\nof unmovable and reclaimable pageblocks.\n\nConfiguring the benchmark to allocate like THP page fault (i.e.  no sync\ncompaction) gives much noisier results for iterations 2 and 3 after\nreboot.  This is not so surprising given how [1] offers lower improvements\nin this scenario due to less restarts after deferred compaction which\nwould change compaction pivot.\n\nBaseline:\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                    5-thp-1         5-thp-2         5-thp-3\nPage alloc extfrag event                                8148965     6227815     6646741\nExtfrag fragmenting                                     8147872     6227130     6646117\nExtfrag fragmenting for unmovable                         10324       12942       15975\nExtfrag fragmenting unmovable placed with movable          5972        8495       10907\nExtfrag fragmenting for reclaimable                         601        1707        2210\nExtfrag fragmenting reclaimable placed with movable         520        1570        2000\nExtfrag fragmenting for movable                         8136947     6212481     6627932\n\nPatch 1:\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                    6-thp-1         6-thp-2         6-thp-3\nPage alloc extfrag event                                8345457     7574471     7020419\nExtfrag fragmenting                                     8343546     7573777     7019718\nExtfrag fragmenting for unmovable                         10256       18535       30716\nExtfrag fragmenting unmovable placed with movable          6893       11726       22181\nExtfrag fragmenting for reclaimable                         465        1208        1023\nExtfrag fragmenting reclaimable placed with movable         353         996         843\nExtfrag fragmenting for movable                         8332825     7554034     6987979\n\nPatch 2:\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                    7-thp-1         7-thp-2         7-thp-3\nPage alloc extfrag event                                3512847     3020756     2891625\nExtfrag fragmenting                                     3511940     3020185     2891059\nExtfrag fragmenting for unmovable                          9017        6892        6191\nExtfrag fragmenting unmovable placed with movable          1524        3053        2435\nExtfrag fragmenting for reclaimable                         445        1081        1160\nExtfrag fragmenting reclaimable placed with movable         375         918         986\nExtfrag fragmenting for movable                         3502478     3012212     2883708\n\nPatch 3:\n                                                   3.19-rc4        3.19-rc4        3.19-rc4\n                                                    8-thp-1         8-thp-2         8-thp-3\nPage alloc extfrag event                                3181699     3082881     2674164\nExtfrag fragmenting                                     3180812     3082303     2673611\nExtfrag fragmenting for unmovable                          1201        4031        4040\nExtfrag fragmenting unmovable placed with movable           974        3611        3645\nExtfrag fragmenting for reclaimable                         478        1165        1294\nExtfrag fragmenting reclaimable placed with movable         387         985        1030\nExtfrag fragmenting for movable                         3179133     3077107     2668277\n\nThe improvements for first iteration are clear, the rest is much noisier\nand can appear like regression for Patch 1.  Anyway, patch 2 rectifies it.\n\nAllocation success rates are again unaffected so there's no point in\nmaking this e-mail any longer.\n\n[1] http://marc.info/?l=linux-mm&m=142166196321125&w=2\n\nThis patch (of 3):\n\nWhen __rmqueue_fallback() is called to allocate a page of order X, it will\nfind a page of order Y >= X of a fallback migratetype, which is different\nfrom the desired migratetype.  With the help of try_to_steal_freepages(),\nit may change the migratetype (to the desired one) also of:\n\n1) all currently free pages in the pageblock containing the fallback page\n2) the fallback pageblock itself\n3) buddy pages created by splitting the fallback page (when Y > X)\n\nThese decisions take the order Y into account, as well as the desired\nmigratetype, with the goal of preventing multiple fallback allocations\nthat could e.g.  distribute UNMOVABLE allocations among multiple\npageblocks.\n\nOriginally, decision for 1) has implied the decision for 3).  Commit\n47118af076f6 (\"mm: mmzone: MIGRATE_CMA migration type added\") changed that\n(probably unintentionally) so that the buddy pages in case 3) are always\nchanged to the desired migratetype, except for CMA pageblocks.\n\nCommit fef903efcf0c (\"mm/page_allo.c: restructure free-page stealing code\nand fix a bug\") did some refactoring and added a comment that the case of\n3) is intended.  Commit 0cbef29a7821 (\"mm: __rmqueue_fallback() should\nrespect pageblock type\") removed the comment and tried to restore the\noriginal behavior where 1) implies 3), but due to the previous\nrefactoring, the result is instead that only 2) implies 3) - and the\nconditions for 2) are less frequently met than conditions for 1).  This\nmay increase fragmentation in situations where the code decides to steal\nall free pages from the pageblock (case 1)), but then gives back the buddy\npages produced by splitting.\n\nThis patch restores the original intended logic where 1) implies 3).\nDuring testing with stress-highalloc from mmtests, this has shown to\ndecrease the number of events where UNMOVABLE and RECLAIMABLE allocations\nsteal from MOVABLE pageblocks, which can lead to permanent fragmentation.\nIn some cases it has increased the number of events when MOVABLE\nallocations steal from UNMOVABLE or RECLAIMABLE pageblocks, but these are\nfixable by sync compaction and thus less harmful.\n\nNote that evaluation has shown that the behavior introduced by\n47118af076f6 for buddy pages in case 3) is actually even better than the\noriginal logic, so the following patch will introduce it properly once\nagain.  For stable backports of this patch it makes thus sense to only fix\nversions containing 0cbef29a7821.\n\n[iamjoonsoo.kim@lge.com: tracepoint fix]\nSigned-off-by: Vlastimil Babka <vbabka@suse.cz>\nAcked-by: Mel Gorman <mgorman@suse.de>\nCc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>\nAcked-by: Minchan Kim <minchan@kernel.org>\nCc: David Rientjes <rientjes@google.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: \"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>\nCc: \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Joonsoo Kim <iamjoonsoo.kim@lge.com>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>\nCc: <stable@vger.kernel.org>\t[3.13+ containing 0cbef29a7821]\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nBug: 26295735\nBug: 26412925\nBug: 26379045\nChange-Id: I106c11d365d41dc47a5d501e2a240a3dfb0f1a15","distinct":true,"url":"https://api.github.com/repos/kykdev/caf-msm-3.10/commits/512d3ff0f5ce42495c6743a506a1461bffe467f3"},{"sha":"eb3489d3f060c860d5109576bf95a2d2fbd884d7","author":{"email":"39ea6a09710987173e32e37c86918024a0f441c1@suse.de","name":"Mel Gorman"},"message":"UPSTREAM: mm: page_alloc: use unsigned int for order in more places\n\n(cherry pick from commit 7aeb09f9104b760fc53c98cb7d20d06640baf9e6)\n\nX86 prefers the use of unsigned types for iterators and there is a\ntendency to mix whether a signed or unsigned type if used for page order.\nThis converts a number of sites in mm/page_alloc.c to use unsigned int for\norder where possible.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Rik van Riel <riel@redhat.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Vlastimil Babka <vbabka@suse.cz>\nCc: Jan Kara <jack@suse.cz>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Hugh Dickins <hughd@google.com>\nCc: Dave Hansen <dave.hansen@intel.com>\nCc: Theodore Ts'o <tytso@mit.edu>\nCc: \"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>\nCc: Oleg Nesterov <oleg@redhat.com>\nCc: Peter Zijlstra <peterz@infradead.org>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nBug: 26295735\nBug: 26412925\nBug: 26379045\nChange-Id: Ib06a156baf657f7827ffb15283f117a40162b9f0","distinct":true,"url":"https://api.github.com/repos/kykdev/caf-msm-3.10/commits/eb3489d3f060c860d5109576bf95a2d2fbd884d7"},{"sha":"e8eed1a1cd8bc803cee5bdec3ae4cc8b25fb0625","author":{"email":"db766431e3f0373ca1ec8fa855cfd5f84b2f2eb6@suse.cz","name":"Vlastimil Babka"},"message":"UPSTREAM: mm: always steal split buddies in fallback allocations\n\n(cherry pick from commit 3a1086fba92b6e2311b6a342f68bc380beb240fe)\n\nWhen allocation falls back to another migratetype, it will steal a page\nwith highest available order, and (depending on this order and desired\nmigratetype), it might also steal the rest of free pages from the same\npageblock.\n\nGiven the preference of highest available order, it is likely that it will\nbe higher than the desired order, and result in the stolen buddy page\nbeing split.  The remaining pages after split are currently stolen only\nwhen the rest of the free pages are stolen.  This can however lead to\nsituations where for MOVABLE allocations we split e.g.  order-4 fallback\nUNMOVABLE page, but steal only order-0 page.  Then on the next MOVABLE\nallocation (which may be batched to fill the pcplists) we split another\norder-3 or higher page, etc.  By stealing all pages that we have split, we\ncan avoid further stealing.\n\nThis patch therefore adjusts the page stealing so that buddy pages created\nby split are always stolen.  This has effect only on MOVABLE allocations,\nas RECLAIMABLE and UNMOVABLE allocations already always do that in\naddition to stealing the rest of free pages from the pageblock.  The\nchange also allows to simplify try_to_steal_freepages() and factor out CMA\nhandling.\n\nAccording to Mel, it has been intended since the beginning that buddy\npages after split would be stolen always, but it doesn't seem like it was\never the case until commit 47118af076f6 (\"mm: mmzone: MIGRATE_CMA\nmigration type added\").  The commit has unintentionally introduced this\nbehavior, but was reverted by commit 0cbef29a7821 (\"mm:\n__rmqueue_fallback() should respect pageblock type\").  Neither included\nevaluation.\n\nMy evaluation with stress-highalloc from mmtests shows about 2.5x\nreduction of page stealing events for MOVABLE allocations, without\naffecting the page stealing events for other allocation migratetypes.\n\nSigned-off-by: Vlastimil Babka <vbabka@suse.cz>\nAcked-by: Mel Gorman <mgorman@suse.de>\nCc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>\nAcked-by: Minchan Kim <minchan@kernel.org>\nCc: David Rientjes <rientjes@google.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: \"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>\nCc: \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Joonsoo Kim <iamjoonsoo.kim@lge.com>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nBug: 26295735\nBug: 26412925\nBug: 26379045\nChange-Id: Ic55f3636191adc9b4b8b871efbfbc7ba6a41cea9","distinct":true,"url":"https://api.github.com/repos/kykdev/caf-msm-3.10/commits/e8eed1a1cd8bc803cee5bdec3ae4cc8b25fb0625"},{"sha":"f95365e303fbc5b27600d8448afb7e687f1393bc","author":{"email":"db766431e3f0373ca1ec8fa855cfd5f84b2f2eb6@suse.cz","name":"Vlastimil Babka"},"message":"UPSTREAM: mm: more aggressive page stealing for UNMOVABLE allocations\n\n(cherry pick from commit 9c0415eb8cbf0c8fd043b6c0f0354308ab099df5)\n\nWhen allocation falls back to stealing free pages of another migratetype,\nit can decide to steal extra pages, or even the whole pageblock in order\nto reduce fragmentation, which could happen if further allocation\nfallbacks pick a different pageblock.  In try_to_steal_freepages(), one of\nthe situations where extra pages are stolen happens when we are trying to\nallocate a MIGRATE_RECLAIMABLE page.\n\nHowever, MIGRATE_UNMOVABLE allocations are not treated the same way,\nalthough spreading such allocation over multiple fallback pageblocks is\narguably even worse than it is for RECLAIMABLE allocations.  To minimize\nfragmentation, we should minimize the number of such fallbacks, and thus\nsteal as much as is possible from each fallback pageblock.\n\nNote that in theory this might put more pressure on movable pageblocks and\ncause movable allocations to steal back from unmovable pageblocks.\nHowever, movable allocations are not as aggressive with stealing, and do\nnot cause permanent fragmentation, so the tradeoff is reasonable, and\nevaluation seems to support the change.\n\nThis patch thus adds a check for MIGRATE_UNMOVABLE to the decision to\nsteal extra free pages.  When evaluating with stress-highalloc from\nmmtests, this has reduced the number of MIGRATE_UNMOVABLE fallbacks to\nroughly 1/6.  The number of these fallbacks stealing from MIGRATE_MOVABLE\nblock is reduced to 1/3.  There was no observation of growing number of\nunmovable pageblocks over time, and also not of increased movable\nallocation fallbacks.\n\nSigned-off-by: Vlastimil Babka <vbabka@suse.cz>\nAcked-by: Mel Gorman <mgorman@suse.de>\nCc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>\nCc: Minchan Kim <minchan@kernel.org>\nCc: David Rientjes <rientjes@google.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: \"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>\nCc: \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Joonsoo Kim <iamjoonsoo.kim@lge.com>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nBug: 26295735\nBug: 26412925\nBug: 26379045\nChange-Id: Ib78273cdab5435bc730bb70c517de425f42252d3","distinct":true,"url":"https://api.github.com/repos/kykdev/caf-msm-3.10/commits/f95365e303fbc5b27600d8448afb7e687f1393bc"}]}