{"push_id":565841913,"size":53,"distinct_size":1,"ref":"refs/heads/aod-sabermod","head":"3e70513074a795233aae5808533cb0a3f79bdcf5","before":"d4f2c37fc2453184f6a4cb5fbda6289dbeedf22c","commits":[{"sha":"8fef4175839b2a6b6f969700e15189783518cd90","author":{"email":"42480b5f4d505650064e5081b85d867a03559887@gmail.com","name":"franciscofranco"},"message":"selinux: just shut up\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/8fef4175839b2a6b6f969700e15189783518cd90"},{"sha":"246d261c12021cde1253a23b93664acd30aa1eae","author":{"email":"1a2f18c7887fc8d384193bb926e616097dea5b69@google.com","name":"JP Abgrall"},"message":"netfilter: IDLETIMER: fix invalid deference of timer\n\n\"timer\" was checked for null, but used later without being re-checked.\n\nChange-Id: Ib4d08cd49860c9f157d1cac556705ba85cd44f4e\nReported-by: dan.carpenter@oracle.com\nSigned-off-by: JP Abgrall <jpa@google.com>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/246d261c12021cde1253a23b93664acd30aa1eae"},{"sha":"3e5d8ce3b7f2218a1247b8aebf6360d666f61322","author":{"email":"0898c4e5c8d849879fa65e9f23cfa9cb45bd5a93@codeaurora.org","name":"Phani Kumar Uppalapati"},"message":"ASoC: wcd9xxx: Avoid micbias glitches during audio playback\n\nDuring audio playback over headset, micbias output is switched\nto vddio and it's parameters are programmed so that it will do\nbutton polling with a voltage equal to vddio (1.8v). It is observed\nthat during this polling interval there is a drop in micbias\nvoltage which would cause issues with button press. Avoid this\nvoltage drop by disabling mbhc micbias when vddio switch is enabled.\n\nCRs-Fixed: 705060\nChange-Id: I0c2f6a0224760aef1f8e51b1ae34c77fc9863b52\nSigned-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/3e5d8ce3b7f2218a1247b8aebf6360d666f61322"},{"sha":"67fc3a199f5e172c3f251cab53d4b93933d8d5d8","author":{"email":"dc52ee68987da08f5efe89343ce8890f99ade5ef@codeaurora.org","name":"Evgeniy Borisov"},"message":"msm: camera: add check for csid_cid to prevent of overwrite memory\n\nadd sanity check for csid cid to ensute that we never read or write\noutside csid_dev->mem buffer\n\nCRs-Fixed: 765558\nChange-Id: Ic8f0d689fa176720ae3a3316f2ad27556ae7bde5\nSigned-off-by: Vasko Kalanoski <vaskok@codeaurora.org>\nSigned-off-by: Evgeniy Borisov <eborisov@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/67fc3a199f5e172c3f251cab53d4b93933d8d5d8"},{"sha":"ea1f395599af52c37b7d34377fcacfb1bf795358","author":{"email":"aefa15d13b6a697c530b79607ff07b1c0c79ef64@codeaurora.org","name":"Sreesudhan Ramakrish Ramkumar"},"message":"msm: camera: isp: Validate reg_offset and len parameters\n\nValidate reg_offset and len parameters before consuming to\navoid invalid register access.\n\nChange-Id: I07676a6d10a9945fb0b99ebfd147075f896fbfab\nSigned-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/ea1f395599af52c37b7d34377fcacfb1bf795358"},{"sha":"26fde31236349bc8de8eb5385e62d9973fb9deac","author":{"email":"a90a680fc254d136e5e0c1b07e0dfa8a9cd5d3cb@codeaurora.org","name":"Sunil Khatri"},"message":"msm: kgsl: Wake up GPU only for touch events\n\nRegister the KGSL input event handler only for\ntouch input events to make sure input event handler\nis called only for touch input events.\n\nChange-Id: I68938fbbf870bd3bce83cb057b504674753d6de8\nSigned-off-by: Sunil Khatri <sunilkh@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/26fde31236349bc8de8eb5385e62d9973fb9deac"},{"sha":"73fd54a04d31e88a3ade162908119d0ef58007a4","author":{"email":"39ea6a09710987173e32e37c86918024a0f441c1@suse.de","name":"Mel Gorman"},"message":"mm: vmscan: limit the number of pages kswapd reclaims at each priority\n\nThis series does not fix all the current known problems with reclaim but\nit addresses one important swapping bug when there is background IO.\n\nChangelog since V3\n - Drop the slab shrink changes in light of Glaubers series and\n   discussions highlighted that there were a number of potential\n   problems with the patch.\t\t\t\t\t(mel)\n - Rebased to 3.10-rc1\n\nChangelog since V2\n - Preserve ratio properly for proportional scanning\t\t(kamezawa)\n\nChangelog since V1\n - Rename ZONE_DIRTY to ZONE_TAIL_LRU_DIRTY\t\t\t(andi)\n - Reformat comment in shrink_page_list\t\t\t\t(andi)\n - Clarify some comments\t\t\t\t\t(dhillf)\n - Rework how the proportional scanning is preserved\n - Add PageReclaim check before kswapd starts writeback\n - Reset sc.nr_reclaimed on every full zone scan\n\nKswapd and page reclaim behaviour has been screwy in one way or the\nother for a long time.  Very broadly speaking it worked in the far past\nbecause machines were limited in memory so it did not have that many\npages to scan and it stalled congestion_wait() frequently to prevent it\ngoing completely nuts.  In recent times it has behaved very\nunsatisfactorily with some of the problems compounded by the removal of\nstall logic and the introduction of transparent hugepage support with\nhigh-order reclaims.\n\nThere are many variations of bugs that are rooted in this area.  One\nexample is reports of a large copy operations or backup causing the\nmachine to grind to a halt or applications pushed to swap.  Sometimes in\nlow memory situations a large percentage of memory suddenly gets\nreclaimed.  In other cases an application starts and kswapd hits 100%\nCPU usage for prolonged periods of time and so on.  There is now talk of\nintroducing features like an extra free kbytes tunable to work around\naspects of the problem instead of trying to deal with it.  It's\ncompounded by the problem that it can be very workload and machine\nspecific.\n\nThis series aims at addressing some of the worst of these problems\nwithout attempting to fundmentally alter how page reclaim works.\n\nPatches 1-2 limits the number of pages kswapd reclaims while still obeying\n\tthe anon/file proportion of the LRUs it should be scanning.\n\nPatches 3-4 control how and when kswapd raises its scanning priority and\n\tdeletes the scanning restart logic which is tricky to follow.\n\nPatch 5 notes that it is too easy for kswapd to reach priority 0 when\n\tscanning and then reclaim the world. Down with that sort of thing.\n\nPatch 6 notes that kswapd starts writeback based on scanning priority which\n\tis not necessarily related to dirty pages. It will have kswapd\n\twriteback pages if a number of unqueued dirty pages have been\n\trecently encountered at the tail of the LRU.\n\nPatch 7 notes that sometimes kswapd should stall waiting on IO to complete\n\tto reduce LRU churn and the likelihood that it'll reclaim young\n\tclean pages or push applications to swap. It will cause kswapd\n\tto block on IO if it detects that pages being reclaimed under\n\twriteback are recycling through the LRU before the IO completes.\n\nPatchies 8-9 are cosmetic but balance_pgdat() is easier to follow after they\n\tare applied.\n\nThis was tested using memcached+memcachetest while some background IO\nwas in progress as implemented by the parallel IO tests implement in MM\nTests.\n\nmemcachetest benchmarks how many operations/second memcached can service\nand it is run multiple times.  It starts with no background IO and then\nre-runs the test with larger amounts of IO in the background to roughly\nsimulate a large copy in progress.  The expectation is that the IO\nshould have little or no impact on memcachetest which is running\nentirely in memory.\n\n                                        3.10.0-rc1                  3.10.0-rc1\n                                           vanilla            lessdisrupt-v4\nOps memcachetest-0M             22155.00 (  0.00%)          22180.00 (  0.11%)\nOps memcachetest-715M           22720.00 (  0.00%)          22355.00 ( -1.61%)\nOps memcachetest-2385M           3939.00 (  0.00%)          23450.00 (495.33%)\nOps memcachetest-4055M           3628.00 (  0.00%)          24341.00 (570.92%)\nOps io-duration-0M                  0.00 (  0.00%)              0.00 (  0.00%)\nOps io-duration-715M               12.00 (  0.00%)              7.00 ( 41.67%)\nOps io-duration-2385M             118.00 (  0.00%)             21.00 ( 82.20%)\nOps io-duration-4055M             162.00 (  0.00%)             36.00 ( 77.78%)\nOps swaptotal-0M                    0.00 (  0.00%)              0.00 (  0.00%)\nOps swaptotal-715M             140134.00 (  0.00%)             18.00 ( 99.99%)\nOps swaptotal-2385M            392438.00 (  0.00%)              0.00 (  0.00%)\nOps swaptotal-4055M            449037.00 (  0.00%)          27864.00 ( 93.79%)\nOps swapin-0M                       0.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-715M                     0.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-2385M               148031.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-4055M               135109.00 (  0.00%)              0.00 (  0.00%)\nOps minorfaults-0M            1529984.00 (  0.00%)        1530235.00 ( -0.02%)\nOps minorfaults-715M          1794168.00 (  0.00%)        1613750.00 ( 10.06%)\nOps minorfaults-2385M         1739813.00 (  0.00%)        1609396.00 (  7.50%)\nOps minorfaults-4055M         1754460.00 (  0.00%)        1614810.00 (  7.96%)\nOps majorfaults-0M                  0.00 (  0.00%)              0.00 (  0.00%)\nOps majorfaults-715M              185.00 (  0.00%)            180.00 (  2.70%)\nOps majorfaults-2385M           24472.00 (  0.00%)            101.00 ( 99.59%)\nOps majorfaults-4055M           22302.00 (  0.00%)            229.00 ( 98.97%)\n\nNote how the vanilla kernels performance collapses when there is enough\nIO taking place in the background.  This drop in performance is part of\nwhat users complain of when they start backups.  Note how the swapin and\nmajor fault figures indicate that processes were being pushed to swap\nprematurely.  With the series applied, there is no noticable performance\ndrop and while there is still some swap activity, it's tiny.\n\n20 iterations of this test were run in total and averaged.  Every 5\niterations, additional IO was generated in the background using dd to\nmeasure how the workload was impacted.  The 0M, 715M, 2385M and 4055M\nsubblock refer to the amount of IO going on in the background at each\niteration.  So memcachetest-2385M is reporting how many\ntransactions/second memcachetest recorded on average over 5 iterations\nwhile there was 2385M of IO going on in the ground.  There are six\nblocks of information reported here\n\nmemcachetest is the transactions/second reported by memcachetest. In\n\tthe vanilla kernel note that performance drops from around\n\t22K/sec to just under 4K/second when there is 2385M of IO going\n\ton in the background. This is one type of performance collapse\n\tusers complain about if a large cp or backup starts in the\n\tbackground\n\nio-duration refers to how long it takes for the background IO to\n\tcomplete. It's showing that with the patched kernel that the IO\n\tcompletes faster while not interfering with the memcache\n\tworkload\n\nswaptotal is the total amount of swap traffic. With the patched kernel,\n\tthe total amount of swapping is much reduced although it is\n\tstill not zero.\n\nswapin in this case is an indication as to whether we are swap trashing.\n\tThe closer the swapin/swapout ratio is to 1, the worse the\n\ttrashing is.  Note with the patched kernel that there is no swapin\n\tactivity indicating that all the pages swapped were really inactive\n\tunused pages.\n\nminorfaults are just minor faults. An increased number of minor faults\n\tcan indicate that page reclaim is unmapping the pages but not\n\tswapping them out before they are faulted back in. With the\n\tpatched kernel, there is only a small change in minor faults\n\nmajorfaults are just major faults in the target workload and a high\n\tnumber can indicate that a workload is being prematurely\n\tswapped. With the patched kernel, major faults are much reduced. As\n\tthere are no swapin's recorded so it's not being swapped. The likely\n\texplanation is that that libraries or configuration files used by\n\tthe workload during startup get paged out by the background IO.\n\nOverall with the series applied, there is no noticable performance drop\ndue to background IO and while there is still some swap activity, it's\ntiny and the lack of swapins imply that the swapped pages were inactive\nand unused.\n\n                            3.10.0-rc1  3.10.0-rc1\n                               vanilla lessdisrupt-v4\nPage Ins                       1234608      101892\nPage Outs                     12446272    11810468\nSwap Ins                        283406           0\nSwap Outs                       698469       27882\nDirect pages scanned                 0      136480\nKswapd pages scanned           6266537     5369364\nKswapd pages reclaimed         1088989      930832\nDirect pages reclaimed               0      120901\nKswapd efficiency                  17%         17%\nKswapd velocity               5398.371    4635.115\nDirect efficiency                 100%         88%\nDirect velocity                  0.000     117.817\nPercentage direct scans             0%          2%\nPage writes by reclaim         1655843     4009929\nPage writes file                957374     3982047\nPage writes anon                698469       27882\nPage reclaim immediate            5245        1745\nPage rescued immediate               0           0\nSlabs scanned                    33664       25216\nDirect inode steals                  0           0\nKswapd inode steals              19409         778\nKswapd skipped wait                  0           0\nTHP fault alloc                     35          30\nTHP collapse alloc                 472         401\nTHP splits                          27          22\nTHP fault fallback                   0           0\nTHP collapse fail                    0           1\nCompaction stalls                    0           4\nCompaction success                   0           0\nCompaction failures                  0           4\nPage migrate success                 0           0\nPage migrate failure                 0           0\nCompaction pages isolated            0           0\nCompaction migrate scanned           0           0\nCompaction free scanned              0           0\nCompaction cost                      0           0\nNUMA PTE updates                     0           0\nNUMA hint faults                     0           0\nNUMA hint local faults               0           0\nNUMA pages migrated                  0           0\nAutoNUMA cost                        0           0\n\nUnfortunately, note that there is a small amount of direct reclaim due to\nkswapd no longer reclaiming the world.  ftrace indicates that the direct\nreclaim stalls are mostly harmless with the vast bulk of the stalls\nincurred by dd\n\n     23 tclsh-3367\n     38 memcachetest-13733\n     49 memcachetest-12443\n     57 tee-3368\n   1541 dd-13826\n   1981 dd-12539\n\nA consequence of the direct reclaim for dd is that the processes for the\nIO workload may show a higher system CPU usage.  There is also a risk that\nkswapd not reclaiming the world may mean that it stays awake balancing\nzones, does not stall on the appropriate events and continually scans\npages it cannot reclaim consuming CPU.  This will be visible as continued\nhigh CPU usage but in my own tests I only saw a single spike lasting less\nthan a second and I did not observe any problems related to reclaim while\nrunning the series on my desktop.\n\nThis patch:\n\nThe number of pages kswapd can reclaim is bound by the number of pages it\nscans which is related to the size of the zone and the scanning priority.\nIn many cases the priority remains low because it's reset every\nSWAP_CLUSTER_MAX reclaimed pages but in the event kswapd scans a large\nnumber of pages it cannot reclaim, it will raise the priority and\npotentially discard a large percentage of the zone as sc->nr_to_reclaim is\nULONG_MAX.  The user-visible effect is a reclaim \"spike\" where a large\npercentage of memory is suddenly freed.  It would be bad enough if this\nwas just unused memory but because of how anon/file pages are balanced it\nis possible that applications get pushed to swap unnecessarily.\n\nThis patch limits the number of pages kswapd will reclaim to the high\nwatermark.  Reclaim will still overshoot due to it not being a hard limit\nas shrink_lruvec() will ignore the sc.nr_to_reclaim at DEF_PRIORITY but it\nprevents kswapd reclaiming the world at higher priorities.  The number of\npages it reclaims is not adjusted for high-order allocations as kswapd\nwill reclaim excessively if it is to balance zones for high-order\nallocations.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nReviewed-by: Rik van Riel <riel@redhat.com>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nAcked-by: Johannes Weiner <hannes@cmpxchg.org>\nAcked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 75485363ce8552698bfb9970d901f755d5713cca\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n[vinmenon@codeaurora.org: resolve trivial merge conflicts]\nChange-Id: Idfce2d7ebe6a809f47ce88344a4954a634e9470e\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: obey proportional scanning requirements for kswapd\n\nSimplistically, the anon and file LRU lists are scanned proportionally\ndepending on the value of vm.swappiness although there are other factors\ntaken into account by get_scan_count().  The patch \"mm: vmscan: Limit\nthe number of pages kswapd reclaims\" limits the number of pages kswapd\nreclaims but it breaks this proportional scanning and may evenly shrink\nanon/file LRUs regardless of vm.swappiness.\n\nThis patch preserves the proportional scanning and reclaim.  It does\nmean that kswapd will reclaim more than requested but the number of\npages will be related to the high watermark.\n\n[mhocko@suse.cz: Correct proportional reclaim for memcg and simplify]\n[kamezawa.hiroyu@jp.fujitsu.com: Recalculate scan based on target]\n[hannes@cmpxchg.org: Account for already scanned pages properly]\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Rik van Riel <riel@redhat.com>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nAcked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: e82e0561dae9f3ae5a21fc2d3d3ccbe69d90be46\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I9dc9b73c0d73c27cda72181b4eb3f625e491f114\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: flatten kswapd priority loop\n\nkswapd stops raising the scanning priority when at least\nSWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered\nbalanced.  It then rechecks if it needs to restart at DEF_PRIORITY and\nwhether high-order reclaim needs to be reset.  This is not wrong per-se\nbut it is confusing to follow and forcing kswapd to stay at DEF_PRIORITY\nmay require several restarts before it has scanned enough pages to meet\nthe high watermark even at 100% efficiency.  This patch irons out the\nlogic a bit by controlling when priority is raised and removing the\n\"goto loop_again\".\n\nThis patch has kswapd raise the scanning priority until it is scanning\nenough pages that it could meet the high watermark in one shrink of the\nLRU lists if it is able to reclaim at 100% efficiency.  It will not\nraise the scanning prioirty higher unless it is failing to reclaim any\npages.\n\nTo avoid infinite looping for high-order allocation requests kswapd will\nnot reclaim for high-order allocations when it has reclaimed at least\ntwice the number of pages as the allocation request.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Johannes Weiner <hannes@cmpxchg.org>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: b8e83b942a16eb73e63406592d3178207a4f07a1\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I93ee675006800f2805408f2865150182bfd4b22b\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: decide whether to compact the pgdat based on reclaim progress\n\nIn the past, kswapd makes a decision on whether to compact memory after\nthe pgdat was considered balanced.  This more or less worked but it is\nlate to make such a decision and does not fit well now that kswapd makes\na decision whether to exit the zone scanning loop depending on reclaim\nprogress.\n\nThis patch will compact a pgdat if at least the requested number of\npages were reclaimed from unbalanced zones for a given priority.  If any\nzone is currently balanced, kswapd will not call compaction as it is\nexpected the necessary pages are already available.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Johannes Weiner <hannes@cmpxchg.org>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 2ab44f434586b8ccb11f781b4c2730492e6628f5\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: Ie490e6df9576de1de1bc0c3c1b634618394dcf8e\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: do not allow kswapd to scan at maximum priority\n\nPage reclaim at priority 0 will scan the entire LRU as priority 0 is\nconsidered to be a near OOM condition.  Kswapd can reach priority 0\nquite easily if it is encountering a large number of pages it cannot\nreclaim such as pages under writeback.  When this happens, kswapd\nreclaims very aggressively even though there may be no real risk of\nallocation failure or OOM.\n\nThis patch prevents kswapd reaching priority 0 and trying to reclaim the\nworld.  Direct reclaimers will still reach priority 0 in the event of an\nOOM situation.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Rik van Riel <riel@redhat.com>\nAcked-by: Johannes Weiner <hannes@cmpxchg.org>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 9aa41348a8d11427feec350b21dcdd4330fd20c4\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I6bd5891e9f2b670b3c495cfad26d69af92e6d856\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: have kswapd writeback pages based on dirty pages encountered, not priority\n\nCurrently kswapd queues dirty pages for writeback if scanning at an\nelevated priority but the priority kswapd scans at is not related to the\nnumber of unqueued dirty encountered.  Since commit \"mm: vmscan: Flatten\nkswapd priority loop\", the priority is related to the size of the LRU\nand the zone watermark which is no indication as to whether kswapd\nshould write pages or not.\n\nThis patch tracks if an excessive number of unqueued dirty pages are\nbeing encountered at the end of the LRU.  If so, it indicates that dirty\npages are being recycled before flusher threads can clean them and flags\nthe zone so that kswapd will start writing pages until the zone is\nbalanced.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Johannes Weiner <hannes@cmpxchg.org>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: d43006d503ac921c7df4f94d13c17db6f13c9d26\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I565caf3aef9f3e5f59cda1adc70207412719a2ed\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: block kswapd if it is encountering pages under writeback\n\nHistorically, kswapd used to congestion_wait() at higher priorities if\nit was not making forward progress.  This made no sense as the failure\nto make progress could be completely independent of IO.  It was later\nreplaced by wait_iff_congested() and removed entirely by commit 258401a6\n(mm: don't wait on congested zones in balance_pgdat()) as it was\nduplicating logic in shrink_inactive_list().\n\nThis is problematic.  If kswapd encounters many pages under writeback\nand it continues to scan until it reaches the high watermark then it\nwill quickly skip over the pages under writeback and reclaim clean young\npages or push applications out to swap.\n\nThe use of wait_iff_congested() is not suited to kswapd as it will only\nstall if the underlying BDI is really congested or a direct reclaimer\nwas unable to write to the underlying BDI.  kswapd bypasses the BDI\ncongestion as it sets PF_SWAPWRITE but even if this was taken into\naccount then it would cause direct reclaimers to stall on writeback\nwhich is not desirable.\n\nThis patch sets a ZONE_WRITEBACK flag if direct reclaim or kswapd is\nencountering too many pages under writeback.  If this flag is set and\nkswapd encounters a PageReclaim page under writeback then it'll assume\nthat the LRU lists are being recycled too quickly before IO can complete\nand block waiting for some IO to complete.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nAcked-by: Rik van Riel <riel@redhat.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 283aba9f9e0e4882bf09bd37a2983379a6fae805\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: Ib34f1959c0e5265242152f98cc52c62ab7015993\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: check if kswapd should writepage once per pgdat scan\n\nCurrently kswapd checks if it should start writepage as it shrinks each\nzone without taking into consideration if the zone is balanced or not.\nThis is not wrong as such but it does not make much sense either.  This\npatch checks once per pgdat scan if kswapd should be writing pages.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nAcked-by: Rik van Riel <riel@redhat.com>\nAcked-by: Johannes Weiner <hannes@cmpxchg.org>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: b7ea3c417b6c2e74ca1cb051568f60377908928d\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n[vinmenon@codeaurora.org: resolve trivial merge conflicts]\nChange-Id: I7cb0fb685f8346f07d0fc4810f6c593334cd1590\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: move logic from balance_pgdat() to kswapd_shrink_zone()\n\nbalance_pgdat() is very long and some of the logic can and should be\ninternal to kswapd_shrink_zone().  Move it so the flow of\nbalance_pgdat() is marginally easier to follow.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nAcked-by: Johannes Weiner <hannes@cmpxchg.org>\nReviewed-by: Michal Hocko <mhocko@suse.cz>\nAcked-by: Rik van Riel <riel@redhat.com>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nTested-by: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 7c954f6de6b630de30f265a079aad359f159ebe9\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I6c4e76e6e132c5982c228863c99195d7ad7768bc\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: stall page reclaim and writeback pages based on dirty/writepage pages encountered\n\nFurther testing of the \"Reduce system disruption due to kswapd\"\ndiscovered a few problems.  First and foremost, it's possible for pages\nunder writeback to be freed which will lead to badness.  Second, as\npages were not being swapped the file LRU was being scanned faster and\nclean file pages were being reclaimed.  In some cases this results in\nincreased read IO to re-read data from disk.  Third, more pages were\nbeing written from kswapd context which can adversly affect IO\nperformance.  Lastly, it was observed that PageDirty pages are not\nnecessarily dirty on all filesystems (buffers can be clean while\nPageDirty is set and ->writepage generates no IO) and not all\nfilesystems set PageWriteback when the page is being written (e.g.\next3).  This disconnect confuses the reclaim stalling logic.  This\nfollow-up series is aimed at these problems.\n\nThe tests were based on three kernels\n\nvanilla:\tkernel 3.9 as that is what the current mmotm uses as a baseline\nmmotm-20130522\tis mmotm as of 22nd May with \"Reduce system disruption due to\n\t\tkswapd\" applied on top as per what should be in Andrew's tree\n\t\tright now\nlessdisrupt-v7r10 is this follow-up series on top of the mmotm kernel\n\nThe first test used memcached+memcachetest while some background IO was\nin progress as implemented by the parallel IO tests implement in MM\nTests.  memcachetest benchmarks how many operations/second memcached can\nservice.  It starts with no background IO on a freshly created ext4\nfilesystem and then re-runs the test with larger amounts of IO in the\nbackground to roughly simulate a large copy in progress.  The\nexpectation is that the IO should have little or no impact on\nmemcachetest which is running entirely in memory.\n\nparallelio\n                                             3.9.0                       3.9.0                       3.9.0\n                                           vanilla          mm1-mmotm-20130522       mm1-lessdisrupt-v7r10\nOps memcachetest-0M             23117.00 (  0.00%)          22780.00 ( -1.46%)          22763.00 ( -1.53%)\nOps memcachetest-715M           23774.00 (  0.00%)          23299.00 ( -2.00%)          22934.00 ( -3.53%)\nOps memcachetest-2385M           4208.00 (  0.00%)          24154.00 (474.00%)          23765.00 (464.76%)\nOps memcachetest-4055M           4104.00 (  0.00%)          25130.00 (512.33%)          24614.00 (499.76%)\nOps io-duration-0M                  0.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps io-duration-715M               12.00 (  0.00%)              7.00 ( 41.67%)              6.00 ( 50.00%)\nOps io-duration-2385M             116.00 (  0.00%)             21.00 ( 81.90%)             21.00 ( 81.90%)\nOps io-duration-4055M             160.00 (  0.00%)             36.00 ( 77.50%)             35.00 ( 78.12%)\nOps swaptotal-0M                    0.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swaptotal-715M             140138.00 (  0.00%)             18.00 ( 99.99%)             18.00 ( 99.99%)\nOps swaptotal-2385M            385682.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swaptotal-4055M            418029.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-0M                       0.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-715M                   144.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-2385M               134227.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-4055M               125618.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps minorfaults-0M            1536429.00 (  0.00%)        1531632.00 (  0.31%)        1533541.00 (  0.19%)\nOps minorfaults-715M          1786996.00 (  0.00%)        1612148.00 (  9.78%)        1608832.00 (  9.97%)\nOps minorfaults-2385M         1757952.00 (  0.00%)        1614874.00 (  8.14%)        1613541.00 (  8.21%)\nOps minorfaults-4055M         1774460.00 (  0.00%)        1633400.00 (  7.95%)        1630881.00 (  8.09%)\nOps majorfaults-0M                  1.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps majorfaults-715M              184.00 (  0.00%)            167.00 (  9.24%)            166.00 (  9.78%)\nOps majorfaults-2385M           24444.00 (  0.00%)            155.00 ( 99.37%)             93.00 ( 99.62%)\nOps majorfaults-4055M           21357.00 (  0.00%)            147.00 ( 99.31%)            134.00 ( 99.37%)\n\nmemcachetest is the transactions/second reported by memcachetest. In\n        the vanilla kernel note that performance drops from around\n        23K/sec to just over 4K/second when there is 2385M of IO going\n        on in the background. With current mmotm, there is no collapse\n\tin performance and with this follow-up series there is little\n\tchange.\n\nswaptotal is the total amount of swap traffic. With mmotm and the follow-up\n\tseries, the total amount of swapping is much reduced.\n\n                                 3.9.0       3.9.0       3.9.0\n                               vanillamm1-mmotm-20130522mm1-lessdisrupt-v7r10\nMinor Faults                  11160152    10706748    10622316\nMajor Faults                     46305         755         678\nSwap Ins                        260249           0           0\nSwap Outs                       683860          18          18\nDirect pages scanned                 0         678        2520\nKswapd pages scanned           6046108     8814900     1639279\nKswapd pages reclaimed         1081954     1172267     1094635\nDirect pages reclaimed               0         566        2304\nKswapd efficiency                  17%         13%         66%\nKswapd velocity               5217.560    7618.953    1414.879\nDirect efficiency                 100%         83%         91%\nDirect velocity                  0.000       0.586       2.175\nPercentage direct scans             0%          0%          0%\nZone normal velocity          5105.086    6824.681     671.158\nZone dma32 velocity            112.473     794.858     745.896\nZone dma velocity                0.000       0.000       0.000\nPage writes by reclaim     1929612.000 6861768.000   32821.000\nPage writes file               1245752     6861750       32803\nPage writes anon                683860          18          18\nPage reclaim immediate            7484          40         239\nSector Reads                   1130320       93996       86900\nSector Writes                 13508052    10823500    11804436\nPage rescued immediate               0           0           0\nSlabs scanned                    33536       27136       18560\nDirect inode steals                  0           0           0\nKswapd inode steals               8641        1035           0\nKswapd skipped wait                  0           0           0\nTHP fault alloc                      8          37          33\nTHP collapse alloc                 508         552         515\nTHP splits                          24           1           1\nTHP fault fallback                   0           0           0\nTHP collapse fail                    0           0           0\n\nThere are a number of observations to make here\n\n1. Swap outs are almost eliminated. Swap ins are 0 indicating that the\n   pages swapped were really unused anonymous pages. Related to that,\n   major faults are much reduced.\n\n2. kswapd efficiency was impacted by the initial series but with these\n   follow-up patches, the efficiency is now at 66% indicating that far\n   fewer pages were skipped during scanning due to dirty or writeback\n   pages.\n\n3. kswapd velocity is reduced indicating that fewer pages are being scanned\n   with the follow-up series as kswapd now stalls when the tail of the\n   LRU queue is full of unqueued dirty pages. The stall gives flushers a\n   chance to catch-up so kswapd can reclaim clean pages when it wakes\n\n4. In light of Zlatko's recent reports about zone scanning imbalances,\n   mmtests now reports scanning velocity on a per-zone basis. With mainline,\n   you can see that the scanning activity is dominated by the Normal\n   zone with over 45 times more scanning in Normal than the DMA32 zone.\n   With the series currently in mmotm, the ratio is slightly better but it\n   is still the case that the bulk of scanning is in the highest zone. With\n   this follow-up series, the ratio of scanning between the Normal and\n   DMA32 zone is roughly equal.\n\n5. As Dave Chinner observed, the current patches in mmotm increased the\n   number of pages written from kswapd context which is expected to adversly\n   impact IO performance. With the follow-up patches, far fewer pages are\n   written from kswapd context than the mainline kernel\n\n6. With the series in mmotm, fewer inodes were reclaimed by kswapd. With\n   the follow-up series, there is less slab shrinking activity and no inodes\n   were reclaimed.\n\n7. Note that \"Sectors Read\" is drastically reduced implying that the source\n   data being used for the IO is not being aggressively discarded due to\n   page reclaim skipping over dirty pages and reclaiming clean pages. Note\n   that the reducion in reads could also be due to inode data not being\n   re-read from disk after a slab shrink.\n\n                       3.9.0       3.9.0       3.9.0\n                     vanillamm1-mmotm-20130522mm1-lessdisrupt-v7r10\nMean sda-avgqz        166.99       32.09       33.44\nMean sda-await        853.64      192.76      185.43\nMean sda-r_await        6.31        9.24        5.97\nMean sda-w_await     2992.81      202.65      192.43\nMax  sda-avgqz       1409.91      718.75      698.98\nMax  sda-await       6665.74     3538.00     3124.23\nMax  sda-r_await       58.96      111.95       58.00\nMax  sda-w_await    28458.94     3977.29     3148.61\n\nIn light of the changes in writes from reclaim context, the number of\nreads and Dave Chinner's concerns about IO performance I took a closer\nlook at the IO stats for the test disk. Few observations\n\n1. The average queue size is reduced by the initial series and roughly\n   the same with this follow up.\n\n2. Average wait times for writes are reduced and as the IO\n   is completing faster it at least implies that the gain is because\n   flushers are writing the files efficiently instead of page reclaim\n   getting in the way.\n\n3. The reduction in maximum write latency is staggering. 28 seconds down\n   to 3 seconds.\n\nJan Kara asked how NFS is affected by all of this. Unstable pages can\nbe taken into account as one of the patches in the series shows but it\nis still the case that filesystems with unusual handling of dirty or\nwriteback could still be treated better.\n\nTests like postmark, fsmark and largedd showed up nothing useful. On my test\nsetup, pages are simply not being written back from reclaim context with or\nwithout the patches and there are no changes in performance. My test setup\nprobably is just not strong enough network-wise to be really interesting.\n\nI ran a longer-lived memcached test with IO going to NFS instead of a local disk\n\nparallelio\n                                             3.9.0                       3.9.0                       3.9.0\n                                           vanilla          mm1-mmotm-20130522       mm1-lessdisrupt-v7r10\nOps memcachetest-0M             23323.00 (  0.00%)          23241.00 ( -0.35%)          23321.00 ( -0.01%)\nOps memcachetest-715M           25526.00 (  0.00%)          24763.00 ( -2.99%)          23242.00 ( -8.95%)\nOps memcachetest-2385M           8814.00 (  0.00%)          26924.00 (205.47%)          23521.00 (166.86%)\nOps memcachetest-4055M           5835.00 (  0.00%)          26827.00 (359.76%)          25560.00 (338.05%)\nOps io-duration-0M                  0.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps io-duration-715M               65.00 (  0.00%)             71.00 ( -9.23%)             11.00 ( 83.08%)\nOps io-duration-2385M             129.00 (  0.00%)             94.00 ( 27.13%)             53.00 ( 58.91%)\nOps io-duration-4055M             301.00 (  0.00%)            100.00 ( 66.78%)            108.00 ( 64.12%)\nOps swaptotal-0M                    0.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swaptotal-715M              14394.00 (  0.00%)            949.00 ( 93.41%)             63.00 ( 99.56%)\nOps swaptotal-2385M            401483.00 (  0.00%)          24437.00 ( 93.91%)          30118.00 ( 92.50%)\nOps swaptotal-4055M            554123.00 (  0.00%)          35688.00 ( 93.56%)          63082.00 ( 88.62%)\nOps swapin-0M                       0.00 (  0.00%)              0.00 (  0.00%)              0.00 (  0.00%)\nOps swapin-715M                  4522.00 (  0.00%)            560.00 ( 87.62%)             63.00 ( 98.61%)\nOps swapin-2385M               169861.00 (  0.00%)           5026.00 ( 97.04%)          13917.00 ( 91.81%)\nOps swapin-4055M               192374.00 (  0.00%)          10056.00 ( 94.77%)          25729.00 ( 86.63%)\nOps minorfaults-0M            1445969.00 (  0.00%)        1520878.00 ( -5.18%)        1454024.00 ( -0.56%)\nOps minorfaults-715M          1557288.00 (  0.00%)        1528482.00 (  1.85%)        1535776.00 (  1.38%)\nOps minorfaults-2385M         1692896.00 (  0.00%)        1570523.00 (  7.23%)        1559622.00 (  7.87%)\nOps minorfaults-4055M         1654985.00 (  0.00%)        1581456.00 (  4.44%)        1596713.00 (  3.52%)\nOps majorfaults-0M                  0.00 (  0.00%)              1.00 (-99.00%)              0.00 (  0.00%)\nOps majorfaults-715M              763.00 (  0.00%)            265.00 ( 65.27%)             75.00 ( 90.17%)\nOps majorfaults-2385M           23861.00 (  0.00%)            894.00 ( 96.25%)           2189.00 ( 90.83%)\nOps majorfaults-4055M           27210.00 (  0.00%)           1569.00 ( 94.23%)           4088.00 ( 84.98%)\n\n1. Performance does not collapse due to IO which is good. IO is also completing\n   faster. Note with mmotm, IO completes in a third of the time and faster again\n   with this series applied\n\n2. Swapping is reduced, although not eliminated. The figures for the follow-up\n   look bad but it does vary a bit as the stalling is not perfect for nfs\n   or filesystems like ext3 with unusual handling of dirty and writeback\n   pages\n\n3. There are swapins, particularly with larger amounts of IO indicating\n   that active pages are being reclaimed. However, the number of much\n   reduced.\n\n                                 3.9.0       3.9.0       3.9.0\n                               vanillamm1-mmotm-20130522mm1-lessdisrupt-v7r10\nMinor Faults                  36339175    35025445    35219699\nMajor Faults                    310964       27108       51887\nSwap Ins                       2176399      173069      333316\nSwap Outs                      3344050      357228      504824\nDirect pages scanned              8972       77283       43242\nKswapd pages scanned          20899983     8939566    14772851\nKswapd pages reclaimed         6193156     5172605     5231026\nDirect pages reclaimed            8450       73802       39514\nKswapd efficiency                  29%         57%         35%\nKswapd velocity               3929.743    1847.499    3058.840\nDirect efficiency                  94%         95%         91%\nDirect velocity                  1.687      15.972       8.954\nPercentage direct scans             0%          0%          0%\nZone normal velocity          3721.907     939.103    2185.142\nZone dma32 velocity            209.522     924.368     882.651\nZone dma velocity                0.000       0.000       0.000\nPage writes by reclaim     4082185.000  526319.000  537114.000\nPage writes file                738135      169091       32290\nPage writes anon               3344050      357228      504824\nPage reclaim immediate            9524         170     5595843\nSector Reads                   8909900      861192     1483680\nSector Writes                 13428980     1488744     2076800\nPage rescued immediate               0           0           0\nSlabs scanned                    38016       31744       28672\nDirect inode steals                  0           0           0\nKswapd inode steals                424           0           0\nKswapd skipped wait                  0           0           0\nTHP fault alloc                     14          15         119\nTHP collapse alloc                1767        1569        1618\nTHP splits                          30          29          25\nTHP fault fallback                   0           0           0\nTHP collapse fail                    8           5           0\nCompaction stalls                   17          41         100\nCompaction success                   7          31          95\nCompaction failures                 10          10           5\nPage migrate success              7083       22157       62217\nPage migrate failure                 0           0           0\nCompaction pages isolated        14847       48758      135830\nCompaction migrate scanned       18328       48398      138929\nCompaction free scanned        2000255      355827     1720269\nCompaction cost                      7          24          68\n\nI guess the main takeaway again is the much reduced page writes\nfrom reclaim context and reduced reads.\n\n                       3.9.0       3.9.0       3.9.0\n                     vanillamm1-mmotm-20130522mm1-lessdisrupt-v7r10\nMean sda-avgqz         23.58        0.35        0.44\nMean sda-await        133.47       15.72       15.46\nMean sda-r_await        4.72        4.69        3.95\nMean sda-w_await      507.69       28.40       33.68\nMax  sda-avgqz        680.60       12.25       23.14\nMax  sda-await       3958.89      221.83      286.22\nMax  sda-r_await       63.86       61.23       67.29\nMax  sda-w_await    11710.38      883.57     1767.28\n\nAnd as before, write wait times are much reduced.\n\nThis patch:\n\nThe patch \"mm: vmscan: Have kswapd writeback pages based on dirty pages\nencountered, not priority\" decides whether to writeback pages from reclaim\ncontext based on the number of dirty pages encountered.  This situation is\nflagged too easily and flushers are not given the chance to catch up\nresulting in more pages being written from reclaim context and potentially\nimpacting IO performance.  The check for PageWriteback is also misplaced\nas it happens within a PageDirty check which is nonsense as the dirty may\nhave been cleared for IO.  The accounting is updated very late and pages\nthat are already under writeback, were reactivated, could not unmapped or\ncould not be released are all missed.  Similarly, a page is considered\ncongested for reasons other than being congested and pages that cannot be\nwritten out in the correct context are skipped.  Finally, it considers\nstalling and writing back filesystem pages due to encountering dirty\nanonymous pages at the tail of the LRU which is dumb.\n\nThis patch causes kswapd to begin writing filesystem pages from reclaim\ncontext only if page reclaim found that all filesystem pages at the tail\nof the LRU were unqueued dirty pages.  Before it starts writing filesystem\npages, it will stall to give flushers a chance to catch up.  The decision\non whether wait_iff_congested is also now determined by dirty filesystem\npages only.  Congested pages are based on whether the underlying BDI is\ncongested regardless of the context of the reclaiming process.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Rik van Riel <riel@redhat.com>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nCc: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nCc: Trond Myklebust <trond.myklebust@fys.uio.no>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: e2be15f6c3eecedfbe1550cca8d72c5057abbbd2\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I2c8aee00da5e3e9562984e792d16f9e11bd4a435\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: stall page reclaim after a list of pages have been processed\n\nCommit \"mm: vmscan: Block kswapd if it is encountering pages under\nwriteback\" blocks page reclaim if it encounters pages under writeback\nmarked for immediate reclaim.  It blocks while pages are still isolated\nfrom the LRU which is unnecessary.  This patch defers the blocking until\nafter the isolated pages have been processed and tidies up some of the\ncomments.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Rik van Riel <riel@redhat.com>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nCc: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nCc: Trond Myklebust <trond.myklebust@fys.uio.no>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: b1a6f21e3b2315d46ae8af88a8f4eb8ea2763107\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: Ia6da0949d7bf81cd7c8d3951a7f9c723131b9037\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: set zone flags before blocking\n\nIn shrink_page_list a decision may be made to stall and flag a zone as\nZONE_WRITEBACK so that if a large number of unqueued dirty pages are\nencountered later then the reclaimer will stall.  Set ZONE_WRITEBACK\nbefore potentially going to sleep so it is noticed sooner.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Rik van Riel <riel@redhat.com>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nCc: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nCc: Trond Myklebust <trond.myklebust@fys.uio.no>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: f7ab8db791a8692f5ed4201dbae25722c1732a8d\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I32b015f56fb76c2c2f15163659eda478f63e4b5e\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: move direct reclaim wait_iff_congested into shrink_list\n\nshrink_inactive_list makes decisions on whether to stall based on the\nnumber of dirty pages encountered.  The wait_iff_congested() call in\nshrink_page_list does no such thing and it's arbitrary.\n\nThis patch moves the decision on whether to set ZONE_CONGESTED and the\nwait_iff_congested call into shrink_page_list.  This keeps all the\ndecisions on whether to stall or not in the one place.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Rik van Riel <riel@redhat.com>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nCc: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nCc: Trond Myklebust <trond.myklebust@fys.uio.no>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 8e950282804558e4605401b9c79c1d34f0d73507\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: Ie73206306ff0589877cab6d1a4ec510d88088403\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: treat pages marked for immediate reclaim as zone congestion\n\nCurrently a zone will only be marked congested if the underlying BDI is\ncongested but if dirty pages are spread across zones it is possible that\nan individual zone is full of dirty pages without being congested.  The\nimpact is that zone gets scanned very quickly potentially reclaiming\nreally clean pages.  This patch treats pages marked for immediate\nreclaim as congested for the purposes of marking a zone ZONE_CONGESTED\nand stalling in wait_iff_congested.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Rik van Riel <riel@redhat.com>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nCc: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nCc: Trond Myklebust <trond.myklebust@fys.uio.no>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: d04e8acd03e5c3421ef18e3da7bc88d56179ca42\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I321615bb32c4efe5889df9ce6482c825d7a816e6\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: take page buffers dirty and locked state into account\n\nPage reclaim keeps track of dirty and under writeback pages and uses it\nto determine if wait_iff_congested() should stall or if kswapd should\nbegin writing back pages.  This fails to account for buffer pages that\ncan be under writeback but not PageWriteback which is the case for\nfilesystems like ext3 ordered mode.  Furthermore, PageDirty buffer pages\ncan have all the buffers clean and writepage does no IO so it should not\nbe accounted as congested.\n\nThis patch adds an address_space operation that filesystems may\noptionally use to check if a page is really dirty or really under\nwriteback.  An implementation is provided for for buffer_heads is added\nand used for block operations and ext3 in ordered mode.  By default the\npage flags are obeyed.\n\nCredit goes to Jan Kara for identifying that the page flags alone are\nnot sufficient for ext3 and sanity checking a number of ideas on how the\nproblem could be addressed.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Rik van Riel <riel@redhat.com>\nCc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>\nCc: Zlatko Calusic <zcalusic@bitsync.net>\nCc: dormando <dormando@rydia.net>\nCc: Trond Myklebust <trond.myklebust@fys.uio.no>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: b45972265f823ed01eae0867a176320071665787\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: Idabea6f388eddcf5acf4725975d51119169da211\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: do not continue scanning if reclaim was aborted for compaction\n\nDirect reclaim is not aborting to allow compaction to go ahead properly.\ndo_try_to_free_pages is told to abort reclaim which is happily ignores\nand instead increases priority instead until it reaches 0 and starts\nshrinking file/anon equally.  This patch corrects the situation by\naborting reclaim when requested instead of raising priority.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Rik van Riel <riel@redhat.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Dave Chinner <david@fromorbit.com>\nCc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 5a1c9cbc1550f93335d7c03eb6c271e642deff04\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I1e3fc6b2fea5d5a06edf5c682caffa3a7907a7ad\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: do not scale writeback pages when deciding whether to set ZONE_WRITEBACK\n\nAfter the patch \"mm: vmscan: Flatten kswapd priority loop\" was merged\nthe scanning priority of kswapd changed.\n\nThe priority now rises until it is scanning enough pages to meet the\nhigh watermark.  shrink_inactive_list sets ZONE_WRITEBACK if a number of\npages were encountered under writeback but this value is scaled based on\nthe priority.  As kswapd frequently scans with a higher priority now it\nis relatively easy to set ZONE_WRITEBACK.  This patch removes the\nscaling and treates writeback pages similar to how it treats unqueued\ndirty pages and congested pages.  The user-visible effect should be that\nkswapd will writeback fewer pages from reclaim context.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Rik van Riel <riel@redhat.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Dave Chinner <david@fromorbit.com>\nCc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 918fc718c5922520c499ad60f61b8df86b998ae9\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I5f75351d845ab0de4ca1c22ffba10e06ea45d111\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: use proportional scanning during direct reclaim and full scan at DEF_PRIORITY\n\nCommit \"mm: vmscan: obey proportional scanning requirements for kswapd\"\nensured that file/anon lists were scanned proportionally for reclaim from\nkswapd but ignored it for direct reclaim.  The intent was to minimse\ndirect reclaim latency but Yuanhan Liu pointer out that it substitutes one\nlong stall for many small stalls and distorts aging for normal workloads\nlike streaming readers/writers.  Hugh Dickins pointed out that a\nside-effect of the same commit was that when one LRU list dropped to zero\nthat the entirety of the other list was shrunk leading to excessive\nreclaim in memcgs.  This patch scans the file/anon lists proportionally\nfor direct reclaim to similarly age page whether reclaimed by kswapd or\ndirect reclaim but takes care to abort reclaim if one LRU drops to zero\nafter reclaiming the requested number of pages.\n\nBased on ext4 and using the Intel VM scalability test\n\n                                              3.15.0-rc5            3.15.0-rc5\n                                                shrinker            proportion\nUnit  lru-file-readonce    elapsed      5.3500 (  0.00%)      5.4200 ( -1.31%)\nUnit  lru-file-readonce time_range      0.2700 (  0.00%)      0.1400 ( 48.15%)\nUnit  lru-file-readonce time_stddv      0.1148 (  0.00%)      0.0536 ( 53.33%)\nUnit lru-file-readtwice    elapsed      8.1700 (  0.00%)      8.1700 (  0.00%)\nUnit lru-file-readtwice time_range      0.4300 (  0.00%)      0.2300 ( 46.51%)\nUnit lru-file-readtwice time_stddv      0.1650 (  0.00%)      0.0971 ( 41.16%)\n\nThe test cases are running multiple dd instances reading sparse files. The results are within\nthe noise for the small test machine. The impact of the patch is more noticable from the vmstats\n\n                            3.15.0-rc5  3.15.0-rc5\n                              shrinker  proportion\nMinor Faults                     35154       36784\nMajor Faults                       611        1305\nSwap Ins                           394        1651\nSwap Outs                         4394        5891\nAllocation stalls               118616       44781\nDirect pages scanned           4935171     4602313\nKswapd pages scanned          15921292    16258483\nKswapd pages reclaimed        15913301    16248305\nDirect pages reclaimed         4933368     4601133\nKswapd efficiency                  99%         99%\nKswapd velocity             670088.047  682555.961\nDirect efficiency                  99%         99%\nDirect velocity             207709.217  193212.133\nPercentage direct scans            23%         22%\nPage writes by reclaim        4858.000    6232.000\nPage writes file                   464         341\nPage writes anon                  4394        5891\n\nNote that there are fewer allocation stalls even though the amount\nof direct reclaim scanning is very approximately the same.\n\nSigned-off-by: Mel Gorman <mgorman@suse.de>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Hugh Dickins <hughd@google.com>\nCc: Tim Chen <tim.c.chen@linux.intel.com>\nCc: Dave Chinner <david@fromorbit.com>\nTested-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>\nCc: Bob Liu <bob.liu@oracle.com>\nCc: Jan Kara <jack@suse.cz>\nCc: Rik van Riel <riel@redhat.com>\nCc: Al Viro <viro@zeniv.linux.org.uk>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: 1a501907bbea8e6ebb0b16cf6db9e9cbf1d2c813\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\nChange-Id: I93acb1ea93d90afca35f3db2a350f2e6589e7c64\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nDon't trigger congestion wait on dirty-but-not-writeout pages\n\nshrink_inactive_list() used to wait 0.1s to avoid congestion when all\nthe pages that were isolated from the inactive list were dirty but not\nunder active writeback.  That makes no real sense, and apparently causes\nmajor interactivity issues under some loads since 3.11.\n\nThe ostensible reason for it was to wait for kswapd to start writing\npages, but that seems questionable as well, since the congestion wait\ncode seems to trigger for kswapd itself as well.  Also, the logic behind\ndelaying anything when we haven't actually started writeback is not\nclear - it only delays actually starting that writeback.\n\nWe'll still trigger the congestion waiting if\n\n (a) the process is kswapd, and we hit pages flagged for immediate\n     reclaim\n\n (b) the process is not kswapd, and the zone backing dev writeback is\n     actually congested.\n\nThis probably needs to be revisited, but as it is this fixes a reported\nregression.\n\nReported-by: Felipe Contreras <felipe.contreras@gmail.com>\nPinpointed-by: Hillf Danton <dhillf@gmail.com>\nCc: Michal Hocko <mhocko@suse.cz>\nCc: Andrew Morton <akpm@linux-foundation.org>\nCc: Mel Gorman <mgorman@suse.de>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nGit-commit: b738d764652dc5aab1c8939f637112981fce9e0e\nGit-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n[vinmenon@codeaurora.org: resolve trivial merge conflicts]\nChange-Id: I4fbcbb10d7ba242caf80da06bd8ed11770571cff\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nmm: vmscan: fix the page state calculation in too_many_isolated\n\nIt is observed that sometimes multiple tasks get blocked in\nthe congestion_wait loop below, in shrink_inactive_list.\n\n(__schedule) from [<c0a03328>]\n(schedule_timeout) from [<c0a04940>]\n(io_schedule_timeout) from [<c01d585c>]\n(congestion_wait) from [<c01cc9d8>]\n(shrink_inactive_list) from [<c01cd034>]\n(shrink_zone) from [<c01cdd08>]\n(try_to_free_pages) from [<c01c442c>]\n(__alloc_pages_nodemask) from [<c01f1884>]\n(new_slab) from [<c09fcf60>]\n(__slab_alloc) from [<c01f1a6c>]\n\nIn one such instance, zone_page_state(zone, NR_ISOLATED_FILE)\nhad returned 14, zone_page_state(zone, NR_INACTIVE_FILE)\nreturned 92, and the gfp_flag was GFP_KERNEL which resulted\nin too_many_isolated to return true. But one of the CPU pageset\nvmstat diff had NR_ISOLATED_FILE as -14. As there weren't any more\nupdate to per cpu pageset, the threshold wasn't met, and the\ntasks were blocked in the congestion wait.\n\nThis patch uses zone_page_state_snapshot instead, but restricts\nits usage to avoid performance penalty.\n\nChange-Id: Iec767a548e524729c7ed79a92fe4718cdd08ce69\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/73fd54a04d31e88a3ade162908119d0ef58007a4"},{"sha":"76a5a176e6c073e2300423f8533a7b0798856d60","author":{"email":"51907cac86db5f2ed57a4ac58c042ecc27c0b352@codeaurora.org","name":"Manu Gautam"},"message":"USB: android: Fix synchronization between ffs_enable and ffs_close\n\nFFS function relies on userspace client (or driver) to pass USB\ndescriptors. It also notifies android composite driver of userspace\nclient's open and close using android.c's ready and closed callbacks.\nIdeally, userspace makes sure to do ffs_close (stop adbd) before moving\nto another USB composition which is followed by ffs_open (start adbd).\nBut, in case of quick composition switch, there is a possibility of\nffs_close and ffs_enable racing with each other. Though there a\nprotection in place using android_dev->mutex, but closed callback drops\nmutex too early. This allows a race between ffs_enable that finds\nconfig->opened as TRUE and enables pull-up, and closed_callback calling\nfunctionfs_unbind. This results in a crash in ffs->set_alt as pull-up\nshould be allowed only after ffs_open happens.\nSince, both ffs_enable/disable and closed/ready_callbacks use same\ndev->mutex, we can not enforce ffs_enable to wait until closed_callback\n(stop adbd) finishes. Hence, we have to live with this race and fix the\nsynchronization issue by correcting use of mutex in closed_callback.\n\nChange-Id: I24cdbc55466c97a05341fa9e394f93fd49dd5d5c\nSigned-off-by: Manu Gautam <mgautam@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/76a5a176e6c073e2300423f8533a7b0798856d60"},{"sha":"d6574e9e44f9ea5f0fe22801b2820715f5d19826","author":{"email":"51907cac86db5f2ed57a4ac58c042ecc27c0b352@codeaurora.org","name":"Manu Gautam"},"message":"USB: android: Fix mutex issue if ffs_close runs after ADB disable\n\nWhile switching from ADB to non-ADB composition, adbd is also\nstopped. Since, stop adbd happens asynchronously, there is a\npossibility that closed_callback gets called after ADB is\ndisabled. In that scenario, closed_callback wouldn't be able to\nuse android_dev->mutex and may race with ffs_enable resulting in\ndifferent issues/crashes.\n\nChange-Id: I7941bbea72139b22eb0ec785c29e9bdb76b6f6a3\nSigned-off-by: Manu Gautam <mgautam@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/d6574e9e44f9ea5f0fe22801b2820715f5d19826"},{"sha":"68e4f25d395da1c41ab03b1d54cbdc817b28904b","author":{"email":"51907cac86db5f2ed57a4ac58c042ecc27c0b352@codeaurora.org","name":"Manu Gautam"},"message":"USB: android: Fail ffs_ready (i.e. start adbd) if ADB not enabled\n\nF_FS function notifies android composite driver of userspace client's\nopen and close (start/stop adbd) using android.c's ready and closed\ncallbacks. Typically userspace starts adbd only in ADB composition as\nfunctionfs_bind from ready_callback happens only if ADB is enabled.\nCurrent design has couple of issues:\n1) If adbd is started before enabling ADB then USB composition gets\nenabled without functionfs_bind resulting a crash in ffs_func->set_alt.\n2) Additionally, even if userspace script for composition switch performs\n\"stop adbd\" before enabling new composition, there is a possibility that\nclosed_callback runs in parallel with ffs_enable/disable as adb daemon\nis stopped asynchronously. Even though these functions use android_dev\nmutex but closed callback may not use this mutex if ready_callback\ngets called before ADB/FFS is enabled, resulting in different crashes.\nThis is possible mainly due to above 1st issue or during quick\ncomposition switches from ADB to non-ADB to ADB and by the time adb got\nstarted, userspace enabled non-ADB composition.\n\nTo fix both of the above issues only option is to fail ffs_ready\ncallback (start adbd) if ADB is not enabled. This restriction clearly\navoid 1st issue, and for 2nd: closed callback would always use mutex\nto avoid any potential synchronization issues. While we are at this,\nalso fix config->opened getting cleared twice from disabled_callback.\n\nChange-Id: I9fe80d09b9eefaa87e396ff451a71026b798175b\nSigned-off-by: Manu Gautam <mgautam@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/68e4f25d395da1c41ab03b1d54cbdc817b28904b"},{"sha":"a9b901ae36e8ef6e2e41531128cdf65093077e48","author":{"email":"aa3210a89d655a9fa3f729366f4d5a1b8908c2e8@codeaurora.org","name":"Ravi Aravamudhan"},"message":"diag: dci: Send mode reset command to the apps processor\n\nDiag driver was sending all mode commands to the apps processor while\nonly mode reset command was handled on the apps processor. This patch\nmakes an exception for mode reset command.\n\nChange-Id: I51e4971cbffcc8fedd68090cb5a15c4c67363c57\nSigned-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/a9b901ae36e8ef6e2e41531128cdf65093077e48"},{"sha":"0377550c5c96ea25b6927801ab0c3438bcfbf332","author":{"email":"0634a331ed6e3ea89a75ec179644d19d783e7f4f@codeaurora.org","name":"Azhar Shaikh"},"message":"usb: misc: Resume mdm interface on receiving notification available cb\n\nusb_autopm_get_interface_no_resume() called from notification available\ncallback only increments PM usage count but does not change the runtime\nPM status.\nConsider a case where notification available callback is called and at the\nsame time usb_runtime_idle() for USB device is called after all interfaces\nare suspended. usb_runtime_idle() will return -EBUSY as the PM usage count\nis non-zero.\nWhen the mdm bridge driver finishes with the read URB, it calls\nusb_autopm_put_interface_async() which returns -EAGAIN, as mdm\ninterface runtime PM status is already RPM_SUSPENDED. Since the\nusb_runtime_idle() call fails, the autosuspend timer will not be re-armed\nand hence the idle() callback for the USB device will never be called.\nSo to fix this, in notification available callback, replace\nusb_autopm_get_interface_no_resume() with usb_autopm_get_interface_async()\nwhich will not only increment the PM usage count but also change the\nruntime PM status of mdm interface and if there is a suspend\nin progress, as this is an asynchronous call, it just returns -EINPROGRESS\nand the mdm bridge RX state machine ensures that the suspend is aborted.\n\nCRs-Fixed: 718574\nChange-Id: I61e6fa7b41b46318229d180b7c098c94d0409605\nSigned-off-by: Azhar Shaikh <azhars@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/0377550c5c96ea25b6927801ab0c3438bcfbf332"},{"sha":"bab5791483a4b26e4ddabaf86c8d6cfa6546eefc","author":{"email":"287e02744ae7c802bbb99a60be19e5052bdd29c3@codeaurora.org","name":"Banajit Goswami"},"message":"ASoC: dapm: Do not process cpu_dai widgets in bias changes\n\nKernel 3.10 has cpu dai widgets in the list of card\nwidgets in addition to platform and codec widgets.\nThis is causing a delay in device switch because cpu\ndai widgets increase the number of widgets to be\nprocessed for bias changes by a factor of five, however\nthey are not required to be processed.\nSkip processing of cpu dai widgets to keep the device\nswitch latency at same level as in kernel 3.4.\n\nCRs-fixed: 699168\nChange-Id: I2d7d9e34dabf2cd25ec5fdd3e58be0fc657c0f6c\nSigned-off-by: Damir Didjusto <damird@codeaurora.org>\nSigned-off-by: Banajit Goswami <bgoswami@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/bab5791483a4b26e4ddabaf86c8d6cfa6546eefc"},{"sha":"eb8ddc43fff61f073d115bf1a04f44b77b721751","author":{"email":"d4b6c51c9a0d66973fb6c9ecdf48c3f781903a82@codeaurora.org","name":"Sagar Dharia"},"message":"ngd_slim: Register with QMI service in the slave-notification thread\n\nSlave notification thread is used to notify slaves when QMI server\n(hosted by slimbus msater driver) on the remote execution environment\nhas come up. Use that thread's entry point to do QMI service\nregistration as well since doing so in probe may trigger another\nprobe by the QMI service leading to boot-up stalling.\n\nChange-Id: I06b1bcfd9aa3d570554971acacd5d7b1dc20fd1c\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_msm: support non-blocking writes from slimbus MSM controller\n\nProvide non-blocking write support so that clients can queue multiple\nwrites, or larger transfers without performance implications.\nTX buffer is created and descriptors out of this buffer\nare submitted to HW to transmit data.\nDescriptor is returned to 'available' pool of TX buffer when HW\ninterrupt for transmission status is recieved.\n\nChange-Id: Icc2af6bf4f770c8cadb9bd2ef7be0f95eb22c5d8\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_msm: fix LPAE builds (64-bit division)\n\nWe can't currently divide 64-bit numbers on LPAE builds. Currently,\nslim-msm.c is using a physical address as part of a division operation,\nresulting in the following linker error:\n\n      LD      init/built-in.o\n    drivers/built-in.o: In function `msm_slim_tx_msg_return':\n    drivers/slimbus/slim-msm.c:432: \\\n        undefined reference to `__aeabi_uldivmod'\n\nFix this by casting the physical address to an unsigned long.\n\nChange-Id: I396697158c57c80240ccd039006422afd684f47d\nSigned-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslimbus: Cleanup dev_list when device is removed\n\nRemove a device's list-entry from controller's\ndevice-list when that device is removed.\n\nSigned-off-by: Naveen Kaje <nkaje@codeaurora.org>\nChange-Id: I068bf34b6692dad33332f4b9baf49e768f5b2736\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_msm: Handle ADSP SSR gracefully for apps-owned data channels\n\nUsually the data channels are owned by codec, or by ADSP itself. If\napps itself is involved in data-transfer on the channels, make sure\nthe BAM pipes, or the port-registers in question are not accessed\nwhile ADSP is restarting.\n\nChange-Id: I9476c7389dbf89d902f0ef6572f3f755f0575f7b\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nngd_slim: Ignore pm_runtime_get error when runtime-pm is not enabled\n\nController power-up uses different code-path when runtime-pm is not\nenabled.\n\nChange-Id: Ibe2f119fd8f43edb657f8f623879dea4730811f4\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_ngd: Use DSP before-shutdown notification for DSP SSR\n\nQMI_SERVER_EXIT notification comes too late (after the DSP has\nshutdown). This can result in unclocked access by BAM if there was\nin-flight transaction. Use BEFORE_SHUTDOWN notification of SSR\nframework instead to make sure in-flight transaction is finished\nbefore DSP turns off its resources.\n\nCRs-Fixed: 730552\nChange-Id: If3c2787c74ffa7743772e5e37eac2f768e239050\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_ngd: Ensure device state consistency with runtime-pm during SSR\n\nDuring ADSP SSR, client's thread calling runtime-pm resume will\nfail since ADSP is unreachable. Make sure such power-up/resume attempt\nis blocked until ADSP comes up by using mutex during device-state\ntransition.\n\nChange-Id: Ie85e52bb2974aaee9654eb8fa1cc60fe37c61b75\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_ngd: Avoid unnecessary pipe connect/disconnect for msg queues\n\nIf slimbus satellite device retains its logical address after power\nvote, it is safe to assume that BAM HW did not get reinitialized.\nUse that logic to disconnect TX/RX message queues to avoid\ndisconnecting and reconnecting them during every power up/down vote\n\nChange-Id: I906c4f5f01ed076066a084a8aa10d8e4d4825e33\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_msm: effective management of data ports\n\nThe current implementaion of data ports management\nassumes that the ports are allocated contiguously,\nwhich is not a correct assumption.\nThis patch addresses this limitation and handles\nthe data ports which are allocated non-contiguously.\n\nChange-Id: I04e83bc525a50db4d0a37028498be848af018bb5\nSigned-off-by: Kiran Gunda <kgunda@codeaurora.org>\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>\n\nslim_ngd: Handle invalid/timeout TX errors gracefully\n\nInvalid transactions can cause timeout or NACK TX errors.\nClear completion object reference for pending TX messages and print\nTX BAM pipe descriptors and status registers for such transactions.\nTX timeouts during connect/disconnect port error conditions should\nclear completion object reference for acklowledgement receipt\nto avoid referring to stale completion object later.\n\nChange-Id: I81018df8cab59b43753c46c8a49a5066b794fda6\nSigned-off-by: Sagar Dharia <sdharia@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/eb8ddc43fff61f073d115bf1a04f44b77b721751"},{"sha":"1b1f783ab0033856ad0821ef38cba32fcdb85505","author":{"email":"f2a4cf793007be8f81a774dc7806c1ffea7b4a2c@intel.com","name":"Zhang Rui"},"message":"PM / sleep: unregister wakeup source when disabling device wakeup\n\nWhen enabling a device' wakeup capability, a wakeup source\nis created for the device automatically. But the wakeup source\nis not unregistered when disabling the device' wakeup capability.\n\nThis results in zombie wakeup sources, after devices/drivers are unregistered.\n\nSigned-off-by: Zhang Rui <rui.zhang@intel.com>\nSigned-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>\nSigned-off-by: flar2 <asegaert@gmail.com>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/1b1f783ab0033856ad0821ef38cba32fcdb85505"},{"sha":"f8800b806823a7205f8154af6a630436189e7bb1","author":{"email":"168a6a722f36cbfb19d9b32bbc952ac3ffb3b983@codeaurora.org","name":"Ujwal Patel"},"message":"msm: mdss: allow unused SMP for targets with high number of SMPs\n\nCurrently MDP driver rejects reusing of a pipe if this reuse results\nin wastage of SMPs. i.e. VIG0 pipe reused from YUV layer to RGB layer.\nIn this case, since RGB layer needs only plane0, plane1 SMPs are unused.\nThis kind of wasting leads to un-necessary GPU fall-backs for composition\nwhen number of SMPs and number of pipes are less. For this reason driver\nused to prohibit such configuration. But in high tier chip-sets, there\nare enough number of SMPs and pipes are available such that these\ntransient wastage of SMPs can be absorbed without much impact.\n\nChange-Id: Ia7baec801add81e5c97bded920ae5bdca5083e0b\nSigned-off-by: Ujwal Patel <ujwalp@codeaurora.org>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/f8800b806823a7205f8154af6a630436189e7bb1"},{"sha":"cdcbf5bc2388df9631cbf71ee80c33c6ece89ec6","author":{"email":"742cc7da48fa788d384ec77ccfb9a4657661404c@gmail.com","name":"imoseyon"},"message":"msm: mdss: we only care about 8084 - rev 103\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/cdcbf5bc2388df9631cbf71ee80c33c6ece89ec6"},{"sha":"ca9eb16a91e8ca98d197fe9de8622a4b82ede452","author":{"email":"42480b5f4d505650064e5081b85d867a03559887@gmail.com","name":"franciscofranco"},"message":"msm: mdss: fix merge derp\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/ca9eb16a91e8ca98d197fe9de8622a4b82ede452"},{"sha":"cc7d0860cd894ba66614c948996e480d506e04bf","author":{"email":"42480b5f4d505650064e5081b85d867a03559887@gmail.com","name":"franciscofranco"},"message":"cpufreq: conservative: change to do micro idle accounting\n\nAdapt for a more sane thresholds.\n\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/cc7d0860cd894ba66614c948996e480d506e04bf"},{"sha":"5ec581e9aff5c97dfa9c85c520e0f2ea4f2b543d","author":{"email":"1f0aa498f7c1bee2bd6061b97aca51d7b122cec0@iki.fi","name":"Jussi Kivilinna"},"message":"ARM: 8120/1: crypto: sha512: add ARM NEON implementation\n\nThis patch adds ARM NEON assembly implementation of SHA-512 and SHA-384\nalgorithms.\n\ntcrypt benchmark results on Cortex-A8, sha512-generic vs sha512-neon-asm:\n\nblock-size      bytes/update    old-vs-new\n16              16              2.99x\n64              16              2.67x\n64              64              3.00x\n256             16              2.64x\n256             64              3.06x\n256             256             3.33x\n1024            16              2.53x\n1024            256             3.39x\n1024            1024            3.52x\n2048            16              2.50x\n2048            256             3.41x\n2048            1024            3.54x\n2048            2048            3.57x\n4096            16              2.49x\n4096            256             3.42x\n4096            1024            3.56x\n4096            4096            3.59x\n8192            16              2.48x\n8192            256             3.42x\n8192            1024            3.56x\n8192            4096            3.60x\n8192            8192            3.60x\n\nAcked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>\nTested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>\nSigned-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>\nSigned-off-by: Russell King <rmk+kernel@arm.linux.org.uk>\nSigned-off-by: franciscofranco <franciscofranco.1990@gmail.com>","distinct":false,"url":"https://api.github.com/repos/N6-Dev-Team/android_kernel_moto_shamu/commits/5ec581e9aff5c97dfa9c85c520e0f2ea4f2b543d"}]}