{"push_id":636519474,"size":1,"distinct_size":1,"ref":"refs/heads/cm-12.0","head":"486e7521ced1e1f0bc000d00dcc3f4488b3cd78a","before":"964ca2f220f73121c4fe2dbe27d4f1d8679c7882","commits":[{"sha":"486e7521ced1e1f0bc000d00dcc3f4488b3cd78a","author":{"email":"849f368743b57af758161ca304c5f5e29f8a3237@yahoo.com","name":"evildemon0s"},"message":"cgroup: remove synchronize_rcu() from cgroup_attach_{task|proc}()\n\nThese 2 syncronize_rcu()s make attaching a task to a cgroup\r\nquite slow, and it can't be ignored in some situations.\r\n\r\nA real case from Colin Cross: Android uses cgroups heavily to\r\nmanage thread priorities, putting threads in a background group\r\nwith reduced cpu.shares when they are not visible to the user,\r\nand in a foreground group when they are. Some RPCs from foreground\r\nthreads to background threads will temporarily move the background\r\nthread into the foreground group for the duration of the RPC.\r\nThis results in many calls to cgroup_attach_task.\r\n\r\nIn cgroup_attach_task() it's task->cgroups that is protected by RCU,\r\nand put_css_set() calls kfree_rcu() to free it.\r\n\r\nIf we remove this synchronize_rcu(), there can be threads in RCU-read\r\nsections accessing their old cgroup via current->cgroups with\r\nconcurrent rmdir operation, but this is safe.\r\n\r\n # time for ((i=0; i<50; i++)) { echo $$ > /mnt/sub/tasks; echo $$ > /mnt/tasks; }\r\n\r\nreal    0m2.524s\r\nuser    0m0.008s\r\nsys     0m0.004s\r\n\r\nWith this patch:\r\nreal    0m0.004s\r\nuser    0m0.004s\r\nsys     0m0.000s\r\n\r\ntj: These synchronize_rcu()s are utterly confused.  synchornize_rcu()\r\n    necessarily has to come between two operations to guarantee that\r\n    the changes made by the former operation are visible to all rcu\r\n    readers before proceeding to the latter operation.  Here,\r\n    synchornize_rcu() are at the end of attach operations with nothing\r\n    beyond it.  Its only effect would be delaying completion of\r\n    write(2) to sysfs tasks/procs files until all rcu readers see the\r\n    change, which doesn't mean anything.\r\n\r\ncherry-picked from:\r\nhttps://android.googlesource.com/kernel/common/+/5d65bc0ca1bceb73204dab943922ba3c83276a8c\r\n\r\nBug: 17709419\r\n\r\nChange-Id: I98dacd6c13da27cb3496fe4a24a24084e46bdd9c\r\nSigned-off-by: Li Zefan <lizefan@huawei.com>\r\nSigned-off-by: Tejun Heo <tj@kernel.org>\r\nReported-by: Colin Cross <ccross@google.com>\r\nSigned-off-by: Devin Kim <dojip.kim@lge.com>","distinct":true,"url":"https://api.github.com/repos/evildemon0s/android_kernel_semc_msm7x30/commits/486e7521ced1e1f0bc000d00dcc3f4488b3cd78a"}]}