{"push_id":3020459227,"size":13,"distinct_size":13,"ref":"refs/heads/Artemis","head":"e5eb97aa0544f1b65398cf22cc3e1f97dbbad367","before":"de3f91ba4ff973b3a8c324df579da97446683586","commits":[{"sha":"f1392dc7d5ca7b328157340e71837db1dc9864ce","author":{"name":"Michal Hocko","email":"829500b200af6c2a0eca4dfd5c388e6b8fbe8dc6@suse.com"},"message":"proc, oom: drop bogus task_lock and mm check\n\nSeries \"Handle oom bypass more gracefully\", V5\n\nThe following 10 patches should put some order to very rare cases of mm\nshared between processes and make the paths which bypass the oom killer\noom reapable and therefore much more reliable finally.  Even though mm\nshared outside of thread group is rare (either vforked tasks for a short\nperiod, use_mm by kernel threads or exotic thread model of\nclone(CLONE_VM) without CLONE_SIGHAND) it is better to cover them.  Not\nonly it makes the current oom killer logic quite hard to follow and\nreason about it can lead to weird corner cases.  E.g.  it is possible to\nselect an oom victim which shares the mm with unkillable process or\nbypass the oom killer even when other processes sharing the mm are still\nalive and other weird cases.\n\nPatch 1 drops bogus task_lock and mm check from oom_{score_}adj_write.\nThis can be considered a bug fix with a low impact as nobody has noticed\nfor years.\n\nPatch 2 drops sighand lock because it is not needed anymore as pointed\nby Oleg.\n\nPatch 3 is a clean up of oom_score_adj handling and a preparatory work\nfor later patches.\n\nPatch 4 enforces oom_adj_score to be consistent between processes\nsharing the mm to behave consistently with the regular thread groups.\nThis can be considered a user visible behavior change because one thread\ngroup updating oom_score_adj will affect others which share the same mm\nvia clone(CLONE_VM).  I argue that this should be acceptable because we\nalready have the same behavior for threads in the same thread group and\nsharing the mm without signal struct is just a different model of\nthreading.  This is probably the most controversial part of the series,\nI would like to find some consensus here.  There were some suggestions\nto hook some counter/oom_score_adj into the mm_struct but I feel that\nthis is not necessary right now and we can rely on proc handler +\noom_kill_process to DTRT.  I can be convinced otherwise but I strongly\nthink that whatever we do the userspace has to have a way to see the\ncurrent oom priority as consistently as possible.\n\nPatch 5 makes sure that no vforked task is selected if it is sharing the\nmm with oom unkillable task.\n\nPatch 6 ensures that all user tasks sharing the mm are killed which in\nturn makes sure that all oom victims are oom reapable.\n\nPatch 7 guarantees that task_will_free_mem will always imply reapable\nbypass of the oom killer.\n\nPatch 8 is new in this version and it addresses an issue pointed out by\n0-day OOM report where an oom victim was reaped several times.\n\nPatch 9 puts an upper bound on how many times oom_reaper tries to reap a\ntask and hides it from the oom killer to move on when no progress can be\nmade.  This will give an upper bound to how long an oom_reapable task\ncan block the oom killer from selecting another victim if the oom_reaper\nis not able to reap the victim.\n\nPatch 10 tries to plug the (hopefully) last hole when we can still lock\nup when the oom victim is shared with oom unkillable tasks (kthreads and\nglobal init).  We just try to be best effort in that case and rather\nfallback to kill something else than risk a lockup.\n\nThis patch (of 10):\n\nBoth oom_adj_write and oom_score_adj_write are using task_lock, check for\ntask->mm and fail if it is NULL.  This is not needed because the\noom_score_adj is per signal struct so we do not need mm at all.  The code\nhas been introduced by 3d5992d2ac7d (\"oom: add per-mm oom disable count\")\nbut we do not do per-mm oom disable since c9f01245b6a7 (\"oom: remove\noom_disable_count\").\n\nThe task->mm check is even not correct because the current thread might\nhave exited but the thread group might be still alive - e.g.  thread group\nleader would lead that echo $VAL > /proc/pid/oom_score_adj would always\nfail with EINVAL while /proc/pid/task/$other_tid/oom_score_adj would\nsucceed.  This is unexpected at best.\n\nRemove the lock along with the check to fix the unexpected behavior and\nalso because there is not real need for the lock in the first place.\n\nLink: http://lkml.kernel.org/r/1466426628-15074-2-git-send-email-mhocko@kernel.org\nSigned-off-by: Michal Hocko <mhocko@suse.com>\nReviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>\nAcked-by: Oleg Nesterov <oleg@redhat.com>\nCc: David Rientjes <rientjes@google.com>\nCc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/f1392dc7d5ca7b328157340e71837db1dc9864ce"},{"sha":"9752f301792dfc3e365465c525a29074f3b027dd","author":{"name":"Michal Hocko","email":"829500b200af6c2a0eca4dfd5c388e6b8fbe8dc6@suse.com"},"message":"proc, oom: drop bogus sighand lock\n\nOleg has pointed out that can simplify both oom_adj_{read,write} and\noom_score_adj_{read,write} even further and drop the sighand lock.  The\nmain purpose of the lock was to protect p->signal from going away but this\nwill not happen since ea6d290ca34c (\"signals: make task_struct->signal\nimmutable/refcountable\").\n\nThe other role of the lock was to synchronize different writers,\nespecially those with CAP_SYS_RESOURCE.  Introduce a mutex for this\npurpose.  Later patches will need this lock anyway.\n\nSuggested-by: Oleg Nesterov <oleg@redhat.com>\nLink: http://lkml.kernel.org/r/1466426628-15074-3-git-send-email-mhocko@kernel.org\nSigned-off-by: Michal Hocko <mhocko@suse.com>\nAcked-by: Oleg Nesterov <oleg@redhat.com>\nCc: Vladimir Davydov <vdavydov@virtuozzo.com>\nCc: David Rientjes <rientjes@google.com>\nCc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/9752f301792dfc3e365465c525a29074f3b027dd"},{"sha":"85e9b6d90fe6efa37fa05e4723ef995deaac5db3","author":{"name":"Michal Hocko","email":"829500b200af6c2a0eca4dfd5c388e6b8fbe8dc6@suse.com"},"message":"proc, oom_adj: extract oom_score_adj setting into a helper\n\nCurrently we have two proc interfaces to set oom_score_adj.  The legacy\n/proc/<pid>/oom_adj and /proc/<pid>/oom_score_adj which both have their\nspecific handlers.  Big part of the logic is duplicated so extract the\ncommon code into __set_oom_adj helper.  Legacy knob still expects some\ndetails slightly different so make sure those are handled same way - e.g.\nthe legacy mode ignores oom_score_adj_min and it warns about the usage.\n\nThis patch shouldn't introduce any functional changes.\n\nLink: http://lkml.kernel.org/r/1466426628-15074-4-git-send-email-mhocko@kernel.org\nSigned-off-by: Michal Hocko <mhocko@suse.com>\nAcked-by: Oleg Nesterov <oleg@redhat.com>\nCc: Vladimir Davydov <vdavydov@virtuozzo.com>\nCc: David Rientjes <rientjes@google.com>\nCc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/85e9b6d90fe6efa37fa05e4723ef995deaac5db3"},{"sha":"c5c83dc1967d188f4f23f0c35204712d2bca7d34","author":{"name":"Michal Hocko","email":"829500b200af6c2a0eca4dfd5c388e6b8fbe8dc6@suse.com"},"message":"mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj\n\noom_score_adj is shared for the thread groups (via struct signal) but this\nis not sufficient to cover processes sharing mm (CLONE_VM without\nCLONE_SIGHAND) and so we can easily end up in a situation when some\nprocesses update their oom_score_adj and confuse the oom killer.  In the\nworst case some of those processes might hide from the oom killer\naltogether via OOM_SCORE_ADJ_MIN while others are eligible.  OOM killer\nwould then pick up those eligible but won't be allowed to kill others\nsharing the same mm so the mm wouldn't release the mm and so the memory.\n\nIt would be ideal to have the oom_score_adj per mm_struct because that is\nthe natural entity OOM killer considers.  But this will not work because\nsome programs are doing\n\n\tvfork()\n\tset_oom_adj()\n\texec()\n\nWe can achieve the same though.  oom_score_adj write handler can set the\noom_score_adj for all processes sharing the same mm if the task is not in\nthe middle of vfork.  As a result all the processes will share the same\noom_score_adj.  The current implementation is rather pessimistic and\nchecks all the existing processes by default if there is more than 1\nholder of the mm but we do not have any reliable way to check for external\nusers yet.\n\nLink: http://lkml.kernel.org/r/1466426628-15074-5-git-send-email-mhocko@kernel.org\nSigned-off-by: Michal Hocko <mhocko@suse.com>\nAcked-by: Oleg Nesterov <oleg@redhat.com>\nCc: Vladimir Davydov <vdavydov@virtuozzo.com>\nCc: David Rientjes <rientjes@google.com>\nCc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/c5c83dc1967d188f4f23f0c35204712d2bca7d34"},{"sha":"6a5dcf8778401ea7bb5f6cdb5cb6ef259447b643","author":{"name":"celtare21","email":"bb9a8ddb83c265dd39ba85e9ce02f808ce804271@gmail.com"},"message":"mm: Checkout oom_kill to Pixel 3 driver\n\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/6a5dcf8778401ea7bb5f6cdb5cb6ef259447b643"},{"sha":"6f426231394d6e51c6989175d712ab3386712d1a","author":{"name":"Vinayak Menon","email":"db18ceb40708dab5e9bcdbeb620f7eed18da08e5@codeaurora.org"},"message":"mm: ratelimit swap write errors\n\nRatelimit the swap write errors to avoid logbuf getting\nfilled up by these messages. These pages remove the useful\npage allocation failure messages (when zram is used as swap)\nfrom logbuf, thus making the debugging difficult.\n\nChange-Id: I9d4229a76b2551d7baca603112d53012d8722415\nSigned-off-by: Vinayak Menon <vinmenon@codeaurora.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/6f426231394d6e51c6989175d712ab3386712d1a"},{"sha":"db07f99691a0c98cfff27e85744acca0861fc69e","author":{"name":"Minchan Kim","email":"eee62f459f15dcddf87a8df69e8328e2a2562028@kernel.org"},"message":"zram: revive swap_slot_free_notify\n\nCommit b430e9d1c6d4 (\"remove compressed copy from zram in-memory\")\napplied swap_slot_free_notify call in *end_swap_bio_read* to remove\nduplicated memory between zram and memory.\n\nHowever, with the introduction of rw_page in zram: 8c7f01025f7b (\"zram:\nimplement rw_page operation of zram\"), it became void because rw_page\ndoesn't need bio.\n\nMemory footprint is really important in embedded platforms which have\nsmall memory, for example, 512M) recently because it could start to kill\nprocesses if memory footprint exceeds some threshold by LMK or some\nsimilar memory management modules.\n\nThis patch restores the function for rw_page, thereby eliminating this\nduplication.\n\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nCc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>\nCc: karam.lee <karam.lee@lge.com>\nCc: <sangseok.lee@lge.com>\nCc: Chan Jeong <chan.jeong@lge.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/db07f99691a0c98cfff27e85744acca0861fc69e"},{"sha":"3ab771fead24839a479c05284c9ea6f2d46e85ba","author":{"name":"Jens Axboe","email":"cd8c6775e60d6f67a6984377324e5290df3d5358@fb.com"},"message":"mm: make __swap_writepage() use bio_set_op_attrs()\n\nCleaner than manipulating bio->bi_rw flags directly.\n\nSigned-off-by: Jens Axboe <axboe@fb.com>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/3ab771fead24839a479c05284c9ea6f2d46e85ba"},{"sha":"9be122bd13311b51550fcf2496384fb16f024420","author":{"name":"Minchan Kim","email":"eee62f459f15dcddf87a8df69e8328e2a2562028@kernel.org"},"message":"mm: call swap_slot_free_notify() with page lock held\n\nKyeongdon reported below error which is BUG_ON(!PageSwapCache(page)) in\npage_swap_info.  The reason is that page_endio in rw_page unlocks the\npage if read I/O is completed so we need to hold a PG_lock again to\ncheck PageSwapCache.  Otherwise, the page can be removed from swapcache.\n\n  Kernel BUG at c00f9040 [verbose debug info unavailable]\n  Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM\n  Modules linked in:\n  CPU: 4 PID: 13446 Comm: RenderThread Tainted: G        W 3.10.84-g9f14aec-dirty #73\n  task: c3b73200 ti: dd192000 task.ti: dd192000\n  PC is at page_swap_info+0x10/0x2c\n  LR is at swap_slot_free_notify+0x18/0x6c\n  pc : [<c00f9040>]    lr : [<c00f5560>]    psr: 400f0113\n  sp : dd193d78  ip : c2deb1e4  fp : da015180\n  r10: 00000000  r9 : 000200da  r8 : c120fe08\n  r7 : 00000000  r6 : 00000000  r5 : c249a6c0  r4 : = c249a6c0\n  r3 : 00000000  r2 : 40080009  r1 : 200f0113  r0 : = c249a6c0\n  ..<snip> ..\n  Call Trace:\n    page_swap_info+0x10/0x2c\n    swap_slot_free_notify+0x18/0x6c\n    swap_readpage+0x90/0x11c\n    read_swap_cache_async+0x134/0x1ac\n    swapin_readahead+0x70/0xb0\n    handle_pte_fault+0x320/0x6fc\n    handle_mm_fault+0xc0/0xf0\n    do_page_fault+0x11c/0x36c\n    do_DataAbort+0x34/0x118\n\nFixes: 3f2b1a04f44933f2 (\"zram: revive swap_slot_free_notify\")\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nTested-by: Kyeongdon Kim <kyeongdon.kim@lge.com>\nCc: Hugh Dickins <hughd@google.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/9be122bd13311b51550fcf2496384fb16f024420"},{"sha":"8a76ec0d39afaa843bed78344aa854a20d53accb","author":{"name":"Andrew Morton","email":"5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org"},"message":"include/linux/nodemask.h: create next_node_in() helper\n\nLots of code does\n\n\tnode = next_node(node, XXX);\n\tif (node == MAX_NUMNODES)\n\t\tnode = first_node(XXX);\n\nso create next_node_in() to do this and use it in various places.\n\n[mhocko@suse.com: use next_node_in() helper]\nAcked-by: Vlastimil Babka <vbabka@suse.cz>\nAcked-by: Michal Hocko <mhocko@kernel.org>\nSigned-off-by: Michal Hocko <mhocko@suse.com>\nCc: Xishi Qiu <qiuxishi@huawei.com>\nCc: Joonsoo Kim <js1304@gmail.com>\nCc: David Rientjes <rientjes@google.com>\nCc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>\nCc: Laura Abbott <lauraa@codeaurora.org>\nCc: Hui Zhu <zhuhui@xiaomi.com>\nCc: Wang Xiaoqiang <wangxq10@lzu.edu.cn>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/8a76ec0d39afaa843bed78344aa854a20d53accb"},{"sha":"d09f7b0dfcaee31ae2010c48813c970ed970ee38","author":{"name":"Liang Chen","email":"31657768478aac2ec9d18b8c37d622da3ab83e75@gmail.com"},"message":"mm: mempolicy: skip non-migratable VMAs when setting MPOL_MF_LAZY\n\nMPOL_MF_LAZY is not visible from userspace since a720094ded8c (\"mm:\nmempolicy: Hide MPOL_NOOP and MPOL_MF_LAZY from userspace for now\"), but\nit should still skip non-migratable VMAs such as VM_IO, VM_PFNMAP, and\nVM_HUGETLB VMAs, and avoid useless overhead of minor faults.\n\nSigned-off-by: Liang Chen <liangchen.linux@gmail.com>\nSigned-off-by: Gavin Guo <gavin.guo@canonical.com>\nAcked-by: Rik van Riel <riel@redhat.com>\nCc: Mel Gorman <mgorman@suse.de>\nCc: Andi Kleen <andi@firstfloor.org>\nCc: Vlastimil Babka <vbabka@suse.cz>\nCc: David Rientjes <rientjes@google.com>\nCc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/d09f7b0dfcaee31ae2010c48813c970ed970ee38"},{"sha":"22461ea7c864b66e4c220d17f62acd32cbff9fa5","author":{"name":"Kirill A. Shutemov","email":"eec72676ad9a62f2727dfed6d270d98c0d02adec@linux.intel.com"},"message":"mempolicy: do not try to queue pages from !vma_migratable()\n\nMaybe I miss some point, but I don't see a reason why we try to queue\npages from non migratable VMAs.\n\nThis testcase steps on VM_BUG_ON_PAGE() in isolate_lru_page():\n\n    #include <fcntl.h>\n    #include <unistd.h>\n    #include <stdio.h>\n    #include <sys/mman.h>\n    #include <numaif.h>\n\n    #define SIZE 0x2000\n\n    int foo;\n\n    int main()\n    {\n        int fd;\n        char *p;\n        unsigned long mask = 2;\n\n        fd = open(\"/dev/sg0\", O_RDWR);\n        p = mmap(NULL, SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);\n        /* Faultin pages */\n        foo = p[0] + p[0x1000];\n        mbind(p, SIZE, MPOL_BIND, &mask, 4, MPOL_MF_MOVE | MPOL_MF_STRICT);\n        return 0;\n    }\n\nThe only case when we can queue pages from such VMA is MPOL_MF_STRICT\nplus MPOL_MF_MOVE or MPOL_MF_MOVE_ALL for VMA which has pages on LRU,\nbut gfp mask is not sutable for migaration (see mapping_gfp_mask() check\nin vma_migratable()).  That's looks like a bug to me.\n\nLet's filter out non-migratable vma at start of queue_pages_test_walk()\nand go to queue_pages_pte_range() only if MPOL_MF_MOVE or\nMPOL_MF_MOVE_ALL flag is set.\n\nSigned-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\nSigned-off-by: Dmitry Vyukov <dvyukov@google.com>\nCc: Vlastimil Babka <vbabka@suse.cz>\nCc: David Rientjes <rientjes@google.com>\nCc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>\nCc: Michal Hocko <mhocko@suse.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/22461ea7c864b66e4c220d17f62acd32cbff9fa5"},{"sha":"e5eb97aa0544f1b65398cf22cc3e1f97dbbad367","author":{"name":"celtare21","email":"bb9a8ddb83c265dd39ba85e9ce02f808ce804271@gmail.com"},"message":"Defconfig: Go back to Android LMK and regen\n\nSigned-off-by: celtare21 <celtare21@gmail.com>","distinct":true,"url":"https://api.github.com/repos/celtare21/kernel_essential_msm8998-1/commits/e5eb97aa0544f1b65398cf22cc3e1f97dbbad367"}]}
{"actor":{"display_login":"celtare21"}}