{"push_id":686321035,"size":37,"distinct_size":37,"ref":"refs/heads/GearKernel_Reborn","head":"a5e998c082a51f8887a33730bfd0c222b90aef64","before":"e23f4b74ff854de4a59e2a95ca5219e451c61654","commits":[{"sha":"9b106f0259bd660858fc3516a0a5dae2fe59dfda","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>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/9b106f0259bd660858fc3516a0a5dae2fe59dfda"},{"sha":"fcb08372308c277e1f0de36a994b47431a0d8cfc","author":{"email":"eb4b5bbb4a6cbf3468229148f167a307303eeb1f@redhat.com","name":"Richard Guy Briggs"},"message":"selinux: call WARN_ONCE() instead of calling audit_log_start()\n\nTwo of the conditions in selinux_audit_rule_match() should never happen and\nthe third indicates a race that should be retried.  Remove the calls to\naudit_log() (which call audit_log_start()) and deal with the errors in the\ncaller, logging only once if the condition is met.  Calling audit_log_start()\nin this location makes buffer allocation and locking more complicated in the\ncalling tree (audit_filter_user()).\n\nChange-Id: If87f4dfee77717df3f4aa58bc1da8dc9459fb224\nSigned-off-by: Richard Guy Briggs <rgb@redhat.com>\nSigned-off-by: Eric Paris <eparis@redhat.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/fcb08372308c277e1f0de36a994b47431a0d8cfc"},{"sha":"2a621745b711c80d44e64e3d55eb27cf25e12e7a","author":{"email":"23256c5b125c18bd580b7fa252de87dcf0c3a427@gmail.com","name":"Himangi Saraogi"},"message":"SELinux: use ARRAY_SIZE\n\nARRAY_SIZE is more concise to use when the size of an array is divided\nby the size of its type or the size of its first element.\n\nThe Coccinelle semantic patch that makes this change is as follows:\n\n// <smpl>\n@@\ntype T;\nT[] E;\n@@\n\n- (sizeof(E)/sizeof(E[...]))\n+ ARRAY_SIZE(E)\n// </smpl>\n\nChange-Id: I5d1e504d50954fc96b25f341c9a7392f033491bb\nSigned-off-by: Himangi Saraogi <himangi774@gmail.com>\nSigned-off-by: Paul Moore <pmoore@redhat.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/2a621745b711c80d44e64e3d55eb27cf25e12e7a"},{"sha":"f9b646a447e00786e2220fdbc05ffc71d3a628a0","author":{"email":"b0b36e3cd9ea4e5739ff430a3056fabf2fdb0376@redhat.com","name":"Eric Paris"},"message":"SELinux: possible NULL deref in context_struct_to_string\n\nIt's possible that the caller passed a NULL for scontext.  However if this\nis a defered mapping we might still attempt to call *scontext=kstrdup().\nThis is bad.  Instead just return the len.\n\nChange-Id: Ic726c69f883ed19fe3319e4a9ef17166f6e4dfec\nSigned-off-by: Eric Paris <eparis@redhat.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/f9b646a447e00786e2220fdbc05ffc71d3a628a0"},{"sha":"0ec6c478d88c93e4cb4f7fdb5c1b063fcbd35bfd","author":{"email":"5c915a589b3ddf58cebf14bec41bcc143b37ac3c@kernel.org","name":"Namhyung Kim"},"message":"selinux: simple cleanup for cond_read_node()\n\nThe node->cur_state and len can be read in a single call of next_entry().\nAnd setting len before reading is a dead write so can be eliminated.\n\nSigned-off-by: Namhyung Kim <namhyung@kernel.org>\n(Minor tweak to the length parameter in the call to next_entry())\nSigned-off-by: Paul Moore <pmoore@redhat.com>\n\nChange-Id: Ia6afdfdc8268a442b74a93479e0191051069515c","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/0ec6c478d88c93e4cb4f7fdb5c1b063fcbd35bfd"},{"sha":"2c27c73b94a2038223098a4265194deadb903d76","author":{"email":"5c915a589b3ddf58cebf14bec41bcc143b37ac3c@kernel.org","name":"Namhyung Kim"},"message":"selinux: fix a possible memory leak in cond_read_node()\n\nThe cond_read_node() should free the given node on error path as it's\nnot linked to p->cond_list yet.  This is done via cond_node_destroy()\nbut it's not called when next_entry() fails before the expr loop.\n\nChange-Id: I8cf4eafcd6e077a46e40393980906a749d80cfd8\nSigned-off-by: Namhyung Kim <namhyung@kernel.org>\nSigned-off-by: Paul Moore <pmoore@redhat.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/2c27c73b94a2038223098a4265194deadb903d76"},{"sha":"c1715b4e4e88a844e5cd66a9ed49f8a480755780","author":{"email":"a123fdd9fb50e93f03393cfddab9c182b4164439@hp.com","name":"Waiman Long"},"message":"selinux: no recursive read_lock of policy_rwlock in security_genfs_sid()\n\nWith the introduction of fair queued rwlock, recursive read_lock()\nmay hang the offending process if there is a write_lock() somewhere\nin between.\n\nWith recursive read_lock checking enabled, the following error was\nreported:\n\n=============================================\n[ INFO: possible recursive locking detected ]\n3.16.0-rc1 #2 Tainted: G            E\n---------------------------------------------\nload_policy/708 is trying to acquire lock:\n (policy_rwlock){.+.+..}, at: [<ffffffff8125b32a>]\nsecurity_genfs_sid+0x3a/0x170\n\nbut task is already holding lock:\n (policy_rwlock){.+.+..}, at: [<ffffffff8125b48c>]\nsecurity_fs_use+0x2c/0x110\n\nother info that might help us debug this:\n Possible unsafe locking scenario:\n\n       CPU0\n       ----\n  lock(policy_rwlock);\n  lock(policy_rwlock);\n\nThis patch fixes the occurrence of recursive read_lock() of\npolicy_rwlock by adding a helper function __security_genfs_sid()\nwhich requires caller to take the lock before calling it. The\nsecurity_fs_use() was then modified to call the new helper function.\n\nChange-Id: I5adc77482947367ff43674e9f68c0d65c0cc8a52\nSigned-off-by: Waiman Long <Waiman.Long@hp.com>\nAcked-by:  Stephen Smalley <sds@tycho.nsa.gov>\nSigned-off-by: Paul Moore <pmoore@redhat.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/c1715b4e4e88a844e5cd66a9ed49f8a480755780"},{"sha":"a55601134379aa82f971aed0a5f44d02fb240c95","author":{"email":"d5ec0d24602845f6f4b6a35ef729998d1fba5507@redhat.com","name":"Dave Jones"},"message":"selinux: conditionally reschedule in mls_convert_context while loading selinux policy\n\nOn a slow machine (with debugging enabled), upgrading selinux policy may take\na considerable amount of time. Long enough that the softlockup detector\ngets triggered.\n\nThe backtrace looks like this..\n\n > BUG: soft lockup - CPU#2 stuck for 23s! [load_policy:19045]\n > Call Trace:\n >  [<ffffffff81221ddf>] symcmp+0xf/0x20\n >  [<ffffffff81221c27>] hashtab_search+0x47/0x80\n >  [<ffffffff8122e96c>] mls_convert_context+0xdc/0x1c0\n >  [<ffffffff812294e8>] convert_context+0x378/0x460\n >  [<ffffffff81229170>] ? security_context_to_sid_core+0x240/0x240\n >  [<ffffffff812221b5>] sidtab_map+0x45/0x80\n >  [<ffffffff8122bb9f>] security_load_policy+0x3ff/0x580\n >  [<ffffffff810788a8>] ? sched_clock_cpu+0xa8/0x100\n >  [<ffffffff810786dd>] ? sched_clock_local+0x1d/0x80\n >  [<ffffffff810788a8>] ? sched_clock_cpu+0xa8/0x100\n >  [<ffffffff8103096a>] ? __change_page_attr_set_clr+0x82a/0xa50\n >  [<ffffffff810786dd>] ? sched_clock_local+0x1d/0x80\n >  [<ffffffff810788a8>] ? sched_clock_cpu+0xa8/0x100\n >  [<ffffffff8103096a>] ? __change_page_attr_set_clr+0x82a/0xa50\n >  [<ffffffff810788a8>] ? sched_clock_cpu+0xa8/0x100\n >  [<ffffffff81534ddc>] ? retint_restore_args+0xe/0xe\n >  [<ffffffff8109c82d>] ? trace_hardirqs_on_caller+0xfd/0x1c0\n >  [<ffffffff81279a2e>] ? trace_hardirqs_on_thunk+0x3a/0x3f\n >  [<ffffffff810d28a8>] ? rcu_irq_exit+0x68/0xb0\n >  [<ffffffff81534ddc>] ? retint_restore_args+0xe/0xe\n >  [<ffffffff8121e947>] sel_write_load+0xa7/0x770\n >  [<ffffffff81139633>] ? vfs_write+0x1c3/0x200\n >  [<ffffffff81210e8e>] ? security_file_permission+0x1e/0xa0\n >  [<ffffffff8113952b>] vfs_write+0xbb/0x200\n >  [<ffffffff811581c7>] ? fget_light+0x397/0x4b0\n >  [<ffffffff81139c27>] SyS_write+0x47/0xa0\n >  [<ffffffff8153bde4>] tracesys+0xdd/0xe2\n\nStephen Smalley suggested:\n\n > Maybe put a cond_resched() within the ebitmap_for_each_positive_bit()\n > loop in mls_convert_context()?\n\nThat seems to do the trick. Tested by downgrading and re-upgrading selinux-policy-targeted.\n\nChange-Id: I857df480e7e58825529b76a935f65dce3282ec5f\nSigned-off-by: Dave Jones <davej@redhat.com>\nAcked-by: Stephen Smalley <sds@tycho.nsa.gov>\nSigned-off-by: Paul Moore <pmoore@redhat.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/a55601134379aa82f971aed0a5f44d02fb240c95"},{"sha":"c5aaf17a4c6a0a346ca85c392531b99c3f94cc16","author":{"email":"d5ec0d24602845f6f4b6a35ef729998d1fba5507@redhat.com","name":"Dave Jones"},"message":"selinux: conditionally reschedule in hashtab_insert while loading selinux policy\n\nAfter silencing the sleeping warning in mls_convert_context() I started\nseeing similar traces from hashtab_insert. Do a cond_resched there too.\n\nChange-Id: I9de792723c9689c6a19a4c5bf49f8a78d542fd17\nSigned-off-by: Dave Jones <davej@redhat.com>\nAcked-by: Stephen Smalley <sds@tycho.nsa.gov>\nSigned-off-by: Paul Moore <pmoore@redhat.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/c5aaf17a4c6a0a346ca85c392531b99c3f94cc16"},{"sha":"456c9f76a21b22a7c25133cbff90513224df972a","author":{"email":"a123fdd9fb50e93f03393cfddab9c182b4164439@hp.com","name":"Waiman Long"},"message":"SELinux: Reduce overhead of mls_level_isvalid() function call\n\nDate\tMon, 10 Jun 2013 13:55:08 -0400\n\nv4->v5:\n  - Fix scripts/checkpatch.pl warning.\n\nv3->v4:\n  - Merge the 2 separate while loops in ebitmap_contains() into\n    a single one.\n\nv2->v3:\n  - Remove unused local variables i, node from mls_level_isvalid().\n\nv1->v2:\n - Move the new ebitmap comparison logic from mls_level_isvalid()\n   into the ebitmap_contains() helper function.\n - Rerun perf and performance tests on the latest v3.10-rc4 kernel.\n\nWhile running the high_systime workload of the AIM7 benchmark on\na 2-socket 12-core Westmere x86-64 machine running 3.10-rc4 kernel\n(with HT on), it was found that a pretty sizable amount of time was\nspent in the SELinux code. Below was the perf trace of the \"perf\nrecord -a -s\" of a test run at 1500 users:\n\n  5.04%            ls  [kernel.kallsyms]     [k] ebitmap_get_bit\n  1.96%            ls  [kernel.kallsyms]     [k] mls_level_isvalid\n  1.95%            ls  [kernel.kallsyms]     [k] find_next_bit\n\nThe ebitmap_get_bit() was the hottest function in the perf-report\noutput.  Both the ebitmap_get_bit() and find_next_bit() functions\nwere, in fact, called by mls_level_isvalid(). As a result, the\nmls_level_isvalid() call consumed 8.95% of the total CPU time of\nall the 24 virtual CPUs which is quite a lot. The majority of the\nmls_level_isvalid() function invocations come from the socket creation\nsystem call.\n\nLooking at the mls_level_isvalid() function, it is checking to see\nif all the bits set in one of the ebitmap structure are also set in\nanother one as well as the highest set bit is no bigger than the one\nspecified by the given policydb data structure. It is doing it in\na bit-by-bit manner. So if the ebitmap structure has many bits set,\nthe iteration loop will be done many times.\n\nThe current code can be rewritten to use a similar algorithm as the\nebitmap_contains() function with an additional check for the\nhighest set bit. The ebitmap_contains() function was extended to\ncover an optional additional check for the highest set bit, and the\nmls_level_isvalid() function was modified to call ebitmap_contains().\n\nWith that change, the perf trace showed that the used CPU time drop\ndown to just 0.08% (ebitmap_contains + mls_level_isvalid) of the\ntotal which is about 100X less than before.\n\n  0.07%            ls  [kernel.kallsyms]     [k] ebitmap_contains\n  0.05%            ls  [kernel.kallsyms]     [k] ebitmap_get_bit\n  0.01%            ls  [kernel.kallsyms]     [k] mls_level_isvalid\n  0.01%            ls  [kernel.kallsyms]     [k] find_next_bit\n\nThe remaining ebitmap_get_bit() and find_next_bit() functions calls\nare made by other kernel routines as the new mls_level_isvalid()\nfunction will not call them anymore.\n\nThis patch also improves the high_systime AIM7 benchmark result,\nthough the improvement is not as impressive as is suggested by the\nreduction in CPU time spent in the ebitmap functions. The table below\nshows the performance change on the 2-socket x86-64 system (with HT\non) mentioned above.\n\n+--------------+---------------+----------------+-----------------+\n|   Workload   | mean % change | mean % change  | mean % change   |\n|              | 10-100 users  | 200-1000 users | 1100-2000 users |\n+--------------+---------------+----------------+-----------------+\n| high_systime |     +0.1%     |     +0.9%      |     +2.6%       |\n+--------------+---------------+----------------+-----------------+\n\nChange-Id: I7cc07edcc6a6a8dadb01c047e3e3cdc7627be44f\nSigned-off-by: Waiman Long <Waiman.Long@hp.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/456c9f76a21b22a7c25133cbff90513224df972a"},{"sha":"a7b292b7e4f3d8a44f6a006290d4293a3bc60fc7","author":{"email":"e642b69ed2fc111e09ffdc37feb733a52253340d@oracle.com","name":"Sasha Levin"},"message":"net: llc: use correct size for sysctl timeout entries\n\nThe timeout entries are sizeof(int) rather than sizeof(long), which\nmeans that when they were getting read we'd also leak kernel memory\nto userspace along with the timeout values.\n\nChange-Id: I328d1186720a6f70f555eeeb62c83ee69814868d\nSigned-off-by: Sasha Levin <sasha.levin@oracle.com>\nSigned-off-by: David S. Miller <davem@davemloft.net>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/a7b292b7e4f3d8a44f6a006290d4293a3bc60fc7"},{"sha":"707e322ff5899bb157574690c9541b03c2b8f831","author":{"email":"a123fdd9fb50e93f03393cfddab9c182b4164439@hp.com","name":"Waiman Long"},"message":"mutex: Move mutex spinning code from sched/core.c back to mutex.c\n\nAs mentioned by Ingo, the SCHED_FEAT_OWNER_SPIN scheduler\nfeature bit was really just an early hack to make with/without\nmutex-spinning testable. So it is no longer necessary.\n\nThis patch removes the SCHED_FEAT_OWNER_SPIN feature bit and\nmove the mutex spinning code from kernel/sched/core.c back to\nkernel/mutex.c which is where they should belong.\n\nSigned-off-by: Waiman Long <Waiman.Long@hp.com>\nCc: Linus Torvalds <torvalds@linux-foundation.org>\nCc: Andrew Morton <akpm@linux-foundation.org>\nCc: Peter Zijlstra <a.p.zijlstra@chello.nl>\nCc: Thomas Gleixner <tglx@linutronix.de>\nCc: Chandramouleeswaran Aswin <aswin@hp.com>\nCc: Davidlohr Bueso <davidlohr.bueso@hp.com>\nCc: Norton Scott J <scott.norton@hp.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>\nCc: David Howells <dhowells@redhat.com>\nCc: Dave Jones <davej@redhat.com>\nCc: Clark Williams <williams@redhat.com>\nCc: Peter Zijlstra <peterz@infradead.org>\nSigned-off-by: Ingo Molnar <mingo@kernel.org>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/707e322ff5899bb157574690c9541b03c2b8f831"},{"sha":"f2d26f85ad64500c82d822076ba55eca27528b56","author":{"email":"a123fdd9fb50e93f03393cfddab9c182b4164439@hp.com","name":"Waiman Long"},"message":"mutex: Make more scalable by doing less atomic operations\n\nIn the __mutex_lock_common() function, an initial entry into\nthe lock slow path will cause two atomic_xchg instructions to be\nissued. Together with the atomic decrement in the fast path, a\ntotal of three atomic read-modify-write instructions will be\nissued in rapid succession. This can cause a lot of cache\nbouncing when many tasks are trying to acquire the mutex at the\nsame time.\n\nThis patch will reduce the number of atomic_xchg instructions\nused by checking the counter value first before issuing the\ninstruction. The atomic_read() function is just a simple memory\nread. The atomic_xchg() function, on the other hand, can be up\nto 2 order of magnitude or even more in cost when compared with\natomic_read(). By using atomic_read() to check the value first\nbefore calling atomic_xchg(), we can avoid a lot of unnecessary\ncache coherency traffic. The only downside with this change is\nthat a task on the slow path will have a tiny bit less chance of\ngetting the mutex when competing with another task in the fast\npath.\n\nThe same is true for the atomic_cmpxchg() function in the\nmutex-spin-on-owner loop. So an atomic_read() is also performed\nbefore calling atomic_cmpxchg().\n\nThe mutex locking and unlocking code for the x86 architecture\ncan allow any negative number to be used in the mutex count to\nindicate that some tasks are waiting for the mutex. I am not so\nsure if that is the case for the other architectures. So the\ndefault is to avoid atomic_xchg() if the count has already been\nset to -1. For x86, the check is modified to include all\nnegative numbers to cover a larger case.\n\nThe following table shows the jobs per minutes (JPM) scalability\ndata on an 8-node 80-core Westmere box with a 3.7.10 kernel. The\nnumactl command is used to restrict the running of the\nhigh_systime workloads to 1/2/4/8 nodes with hyperthreading on\nand off.\n\n+-----------------+-----------+------------+----------+\n|  Configuration  | Mean JPM  |  Mean JPM  | % Change |\n|\t\t  | w/o patch | with patch |\t      |\n+-----------------+-----------------------------------+\n|\t\t  |      User Range 1100 - 2000\t      |\n+-----------------+-----------------------------------+\n| 8 nodes, HT on  |    36980   |   148590  | +301.8%  |\n| 8 nodes, HT off |    42799   |   145011  | +238.8%  |\n| 4 nodes, HT on  |    61318   |   118445  |  +51.1%  |\n| 4 nodes, HT off |   158481   |   158592  |   +0.1%  |\n| 2 nodes, HT on  |   180602   |   173967  |   -3.7%  |\n| 2 nodes, HT off |   198409   |   198073  |   -0.2%  |\n| 1 node , HT on  |   149042   |   147671  |   -0.9%  |\n| 1 node , HT off |   126036   |   126533  |   +0.4%  |\n+-----------------+-----------------------------------+\n|\t\t  |       User Range 200 - 1000\t      |\n+-----------------+-----------------------------------+\n| 8 nodes, HT on  |   41525    |   122349  | +194.6%  |\n| 8 nodes, HT off |   49866    |   124032  | +148.7%  |\n| 4 nodes, HT on  |   66409    |   106984  |  +61.1%  |\n| 4 nodes, HT off |  119880    |   130508  |   +8.9%  |\n| 2 nodes, HT on  |  138003    |   133948  |   -2.9%  |\n| 2 nodes, HT off |  132792    |   131997  |   -0.6%  |\n| 1 node , HT on  |  116593    |   115859  |   -0.6%  |\n| 1 node , HT off |  104499    |   104597  |   +0.1%  |\n+-----------------+------------+-----------+----------+\n\nAt low user range 10-100, the JPM differences were within +/-1%.\nSo they are not that interesting.\n\nAIM7 benchmark run has a pretty large run-to-run variance due to\nrandom nature of the subtests executed. So a difference of less\nthan +-5% may not be really significant.\n\nThis patch improves high_systime workload performance at 4 nodes\nand up by maintaining transaction rates without significant\ndrop-off at high node count.  The patch has practically no\nimpact on 1 and 2 nodes system.\n\nThe table below shows the percentage time (as reported by perf\nrecord -a -s -g) spent on the __mutex_lock_slowpath() function\nby the high_systime workload at 1500 users for 2/4/8-node\nconfigurations with hyperthreading off.\n\n+---------------+-----------------+------------------+---------+\n| Configuration | %Time w/o patch | %Time with patch | %Change |\n+---------------+-----------------+------------------+---------+\n|    8 nodes    |      65.34%     |      0.69%       |  -99%   |\n|    4 nodes    |       8.70%\t  |      1.02%\t     |  -88%   |\n|    2 nodes    |       0.41%     |      0.32%       |  -22%   |\n+---------------+-----------------+------------------+---------+\n\nIt is obvious that the dramatic performance improvement at 8\nnodes was due to the drastic cut in the time spent within the\n__mutex_lock_slowpath() function.\n\nThe table below show the improvements in other AIM7 workloads\n(at 8 nodes, hyperthreading off).\n\n+--------------+---------------+----------------+-----------------+\n|   Workload   | mean % change | mean % change  | mean % change   |\n|              | 10-100 users  | 200-1000 users | 1100-2000 users |\n+--------------+---------------+----------------+-----------------+\n| alltests     |     +0.6%     |   +104.2%      |   +185.9%       |\n| five_sec     |     +1.9%     |     +0.9%      |     +0.9%       |\n| fserver      |     +1.4%     |     -7.7%      |     +5.1%       |\n| new_fserver  |     -0.5%     |     +3.2%      |     +3.1%       |\n| shared       |    +13.1%     |   +146.1%      |   +181.5%       |\n| short        |     +7.4%     |     +5.0%      |     +4.2%       |\n+--------------+---------------+----------------+-----------------+\n\nSigned-off-by: Waiman Long <Waiman.Long@hp.com>\nReviewed-by: Davidlohr Bueso <davidlohr.bueso@hp.com>\nReviewed-by: Rik van Riel <riel@redhat.com>\nCc: Linus Torvalds <torvalds@linux-foundation.org>\nCc: Andrew Morton <akpm@linux-foundation.org>\nCc: Peter Zijlstra <a.p.zijlstra@chello.nl>\nCc: Thomas Gleixner <tglx@linutronix.de>\nCc: Chandramouleeswaran Aswin <aswin@hp.com>\nCc: Norton: Scott J <scott.norton@hp.com>\nCc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>\nCc: David Howells <dhowells@redhat.com>\nCc: Dave Jones <davej@redhat.com>\nCc: Clark Williams <williams@redhat.com>\nCc: Peter Zijlstra <peterz@infradead.org>\nLink: http://lkml.kernel.org/r/1366226594-5506-3-git-send-email-Waiman.Long@hp.com\nSigned-off-by: Ingo Molnar <mingo@kernel.org>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/f2d26f85ad64500c82d822076ba55eca27528b56"},{"sha":"a2a4731edccb4013397002f7037444f57f080fec","author":{"email":"a123fdd9fb50e93f03393cfddab9c182b4164439@hp.com","name":"Waiman Long"},"message":"mutex: Queue mutex spinners with MCS lock to reduce cacheline contention\n\nThe current mutex spinning code (with MUTEX_SPIN_ON_OWNER option\nturned on) allow multiple tasks to spin on a single mutex\nconcurrently. A potential problem with the current approach is\nthat when the mutex becomes available, all the spinning tasks\nwill try to acquire the mutex more or less simultaneously. As a\nresult, there will be a lot of cacheline bouncing especially on\nsystems with a large number of CPUs.\n\nThis patch tries to reduce this kind of contention by putting\nthe mutex spinners into a queue so that only the first one in\nthe queue will try to acquire the mutex. This will reduce\ncontention and allow all the tasks to move forward faster.\n\nThe queuing of mutex spinners is done using an MCS lock based\nimplementation which will further reduce contention on the mutex\ncacheline than a similar ticket spinlock based implementation.\nThis patch will add a new field into the mutex data structure\nfor holding the MCS lock. This expands the mutex size by 8 bytes\nfor 64-bit system and 4 bytes for 32-bit system. This overhead\nwill be avoid if the MUTEX_SPIN_ON_OWNER option is turned off.\n\nThe following table shows the jobs per minute (JPM) scalability\ndata on an 8-node 80-core Westmere box with a 3.7.10 kernel. The\nnumactl command is used to restrict the running of the fserver\nworkloads to 1/2/4/8 nodes with hyperthreading off.\n\n+-----------------+-----------+-----------+-------------+----------+\n|  Configuration  | Mean JPM  | Mean JPM  |  Mean JPM   | % Change |\n|                 | w/o patch | patch 1   | patches 1&2 |  1->1&2  |\n+-----------------+------------------------------------------------+\n|                 |              User Range 1100 - 2000            |\n+-----------------+------------------------------------------------+\n| 8 nodes, HT off |  227972   |  227237   |   305043    |  +34.2%  |\n| 4 nodes, HT off |  393503   |  381558   |   394650    |   +3.4%  |\n| 2 nodes, HT off |  334957   |  325240   |   338853    |   +4.2%  |\n| 1 node , HT off |  198141   |  197972   |   198075    |   +0.1%  |\n+-----------------+------------------------------------------------+\n|                 |              User Range 200 - 1000             |\n+-----------------+------------------------------------------------+\n| 8 nodes, HT off |  282325   |  312870   |   332185    |   +6.2%  |\n| 4 nodes, HT off |  390698   |  378279   |   393419    |   +4.0%  |\n| 2 nodes, HT off |  336986   |  326543   |   340260    |   +4.2%  |\n| 1 node , HT off |  197588   |  197622   |   197582    |    0.0%  |\n+-----------------+-----------+-----------+-------------+----------+\n\nAt low user range 10-100, the JPM differences were within +/-1%.\nSo they are not that interesting.\n\nThe fserver workload uses mutex spinning extensively. With just\nthe mutex change in the first patch, there is no noticeable\nchange in performance.  Rather, there is a slight drop in\nperformance. This mutex spinning patch more than recovers the\nlost performance and show a significant increase of +30% at high\nuser load with the full 8 nodes. Similar improvements were also\nseen in a 3.8 kernel.\n\nThe table below shows the %time spent by different kernel\nfunctions as reported by perf when running the fserver workload\nat 1500 users with all 8 nodes.\n\n+-----------------------+-----------+---------+-------------+\n|        Function       |  % time   | % time  |   % time    |\n|                       | w/o patch | patch 1 | patches 1&2 |\n+-----------------------+-----------+---------+-------------+\n| __read_lock_failed    |  34.96%   | 34.91%  |   29.14%    |\n| __write_lock_failed   |  10.14%   | 10.68%  |    7.51%    |\n| mutex_spin_on_owner   |   3.62%   |  3.42%  |    2.33%    |\n| mspin_lock            |    N/A    |   N/A   |    9.90%    |\n| __mutex_lock_slowpath |   1.46%   |  0.81%  |    0.14%    |\n| _raw_spin_lock        |   2.25%   |  2.50%  |    1.10%    |\n+-----------------------+-----------+---------+-------------+\n\nThe fserver workload for an 8-node system is dominated by the\ncontention in the read/write lock. Mutex contention also plays a\nrole. With the first patch only, mutex contention is down (as\nshown by the __mutex_lock_slowpath figure) which help a little\nbit. We saw only a few percents improvement with that.\n\nBy applying patch 2 as well, the single mutex_spin_on_owner\nfigure is now split out into an additional mspin_lock figure.\nThe time increases from 3.42% to 11.23%. It shows a great\nreduction in contention among the spinners leading to a 30%\nimprovement. The time ratio 9.9/2.33=4.3 indicates that there\nare on average 4+ spinners waiting in the spin_lock loop for\neach spinner in the mutex_spin_on_owner loop. Contention in\nother locking functions also go down by quite a lot.\n\nThe table below shows the performance change of both patches 1 &\n2 over patch 1 alone in other AIM7 workloads (at 8 nodes,\nhyperthreading off).\n\n+--------------+---------------+----------------+-----------------+\n|   Workload   | mean % change | mean % change  | mean % change   |\n|              | 10-100 users  | 200-1000 users | 1100-2000 users |\n+--------------+---------------+----------------+-----------------+\n| alltests     |      0.0%     |     -0.8%      |     +0.6%       |\n| five_sec     |     -0.3%     |     +0.8%      |     +0.8%       |\n| high_systime |     +0.4%     |     +2.4%      |     +2.1%       |\n| new_fserver  |     +0.1%     |    +14.1%      |    +34.2%       |\n| shared       |     -0.5%     |     -0.3%      |     -0.4%       |\n| short        |     -1.7%     |     -9.8%      |     -8.3%       |\n+--------------+---------------+----------------+-----------------+\n\nThe short workload is the only one that shows a decline in\nperformance probably due to the spinner locking and queuing\noverhead.\n\n[myfluxi: On our 3.4 base, this patch series gives another\nreproducable 3.5% advantage which is significantly above the +- 1-2% standard variation.\n\n Performance counter stats for 'hackbench 10  ' (10 runs):\n\n       2885.888073 task-clock                #    3.565 CPUs utilized\n ( +-  0.75% )\n             16429 context-switches          #    0.006 M/sec\n ( +-  7.47% )\n              4234 CPU-migrations            #    0.001 M/sec\n ( +- 11.08% )\n             21541 page-faults               #    0.007 M/sec\n ( +-  0.02% )\n        5959743473 cycles                    #    2.065 GHz\n ( +-  0.70% ) [85.81%]\n                 0 stalled-cycles-frontend   #    0.00% frontend cycles idle\n ( +-  0.00% ) [86.55%]\n                 0 stalled-cycles-backend    #    0.00% backend  cycles idle\n ( +-  0.00% ) [88.53%]\n        2018815336 instructions              #    0.34  insns per cycle\n ( +-  0.57% ) [88.31%]\n         195542833 branches                  #   67.968 M/sec\n ( +-  0.80% ) [89.30%]\n           4178524 branch-misses             #    2.14% of all branches\n ( +-  2.39% ) [76.06%]\n\n       0.807441968 seconds time elapsed\n ( +-  1.86% )]\n\nSigned-off-by: Waiman Long <Waiman.Long@hp.com>\nReviewed-by: Davidlohr Bueso <davidlohr.bueso@hp.com>\nAcked-by: Rik van Riel <riel@redhat.com>\nCc: Linus Torvalds <torvalds@linux-foundation.org>\nCc: Andrew Morton <akpm@linux-foundation.org>\nCc: Peter Zijlstra <a.p.zijlstra@chello.nl>\nCc: Thomas Gleixner <tglx@linutronix.de>\nCc: Chandramouleeswaran Aswin <aswin@hp.com>\nCc: Norton Scott J <scott.norton@hp.com>\nCc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>\nCc: David Howells <dhowells@redhat.com>\nCc: Dave Jones <davej@redhat.com>\nCc: Clark Williams <williams@redhat.com>\nCc: Peter Zijlstra <peterz@infradead.org>\nSigned-off-by: Ingo Molnar <mingo@kernel.org>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/a2a4731edccb4013397002f7037444f57f080fec"},{"sha":"2380e3669aa17dec7dba1dc76eb45fc6e9f3111b","author":{"email":"a123fdd9fb50e93f03393cfddab9c182b4164439@hp.com","name":"Waiman Long"},"message":"mutex: Back out architecture specific check for negative mutex count\n\nLinus suggested that probably all the supported architectures can\nallow a negative mutex count without incorrect behavior, so we can\nthen back out the architecture specific change and allow the\nmutex count to go to any negative number. That should further\nreduce contention for non-x86 architecture.\n\nSuggested-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Waiman Long <Waiman.Long@hp.com>\nCc: Andrew Morton <akpm@linux-foundation.org>\nCc: Peter Zijlstra <a.p.zijlstra@chello.nl>\nCc: Thomas Gleixner <tglx@linutronix.de>\nCc: Chandramouleeswaran Aswin <aswin@hp.com>\nCc: Davidlohr Bueso <davidlohr.bueso@hp.com>\nCc: Norton Scott J <scott.norton@hp.com>\nCc: Rik van Riel <riel@redhat.com>\nCc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>\nCc: David Howells <dhowells@redhat.com>\nCc: Dave Jones <davej@redhat.com>\nCc: Clark Williams <williams@redhat.com>\nCc: Peter Zijlstra <peterz@infradead.org>\nSigned-off-by: Ingo Molnar <mingo@kernel.org>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/2380e3669aa17dec7dba1dc76eb45fc6e9f3111b"},{"sha":"5bf07c4564e8168a4c834048dee71e37220933f4","author":{"email":"0d4353972589bb87d33d28329bb29c8440a8960a@firemail.de","name":"Ken Helias"},"message":"klist: use same naming scheme as hlist for klist_add_after()\n\nThe name was modified from hlist_add_after() to hlist_add_behind() when\nadjusting the order of arguments to match the one with\nklist_add_after().  This is necessary to break old code when it would\nuse it the wrong way.\n\nMake klist follow this naming scheme for consistency.\n\nSigned-off-by: Ken Helias <kenhelias@firemail.de>\nCc: \"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>\nCc: Christoph Hellwig <hch@infradead.org>\nCc: Hugh Dickins <hughd@google.com>\nCc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/5bf07c4564e8168a4c834048dee71e37220933f4"},{"sha":"0252a763d32e7b32c1ac093d3b8a242bbfa8e865","author":{"email":"18b901ae8972a98f81ddd39c1d9a3af43e37c494@gmail.com","name":"Dirk Brandewie"},"message":"cpufreq_stats: do not remove sysfs files if frequency table is not present\n\nThe sysfs files for cpufreq_stats are created in cpufreq_stats_create_table()\ncalled from cpufreq_stat_notifier_policy() when a policy is added to\nthe cpu. cpufreq_stats_create_table() will not be called if the\nscaling driver does not export a frequency table to cpufreq.  Use the\nsame fence on tear down.\n\nSigned-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>\nAcked-by: Viresh Kumar <viresh.kumar@linaro.org>\nSigned-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/0252a763d32e7b32c1ac093d3b8a242bbfa8e865"},{"sha":"0b0c1a2216df0653afeab671f8b6fdaea432a9ee","author":{"email":"91e0ff19c25a4c90f9bdc24b1ac8e48e9177c077@gmail.com","name":"Xi Wang"},"message":"ipv4: fix NULL checking in devinet_ioctl()\n\nThe NULL pointer check `!ifa' should come before its first use.\n\n[ Bug origin : (ipv4: Add hash table of interface addresses) in\n  linux-2.6.39 ]\n\nSigned-off-by: Xi Wang <xi.wang@gmail.com>\nAcked-by: Eric Dumazet <edumazet@google.com>\nSigned-off-by: David S. Miller <davem@davemloft.net>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/0b0c1a2216df0653afeab671f8b6fdaea432a9ee"},{"sha":"954cf0581986df0a4407d0079cb5531fd81e961c","author":{"email":"0474aee45985f5ae829f53849df476200e876990@linux.intel.com","name":"Andi Kleen"},"message":"Disable -fconserve-stack on ARM v2\n\nThere are reports that -fconserve-stack misaligns variables on the stack.\nDisable it for ARM to work around this gcc bug.\n\nv2: Move top level flags definition up\nSigned-off-by: Andi Kleen <ak@linux.intel.com>\nSigned-off-by: Catalin Marinas <catalin.marinas@arm.com>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/954cf0581986df0a4407d0079cb5531fd81e961c"},{"sha":"cf2fcf86b0e308d19ce99938b3ca9a6193eda472","author":{"email":"ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz","name":"Jiri Kosina"},"message":"./Makefile: tell gcc optimizer to never introduce new data races\n\nWe have been chasing a memory corruption bug, which turned out to be\ncaused by very old gcc (4.3.4), which happily turned conditional load\ninto a non-conditional one, and that broke correctness (the condition\nwas met only if lock was held) and corrupted memory.\n\nThis particular problem with that particular code did not happen when\nnever gccs were used.  I've brought this up with our gcc folks, as I\nwanted to make sure that this can't really happen again, and it turns\nout it actually can.\n\nQuoting Martin Jambor <mjambor@suse.cz>:\n \"More current GCCs are more careful when it comes to replacing a\n  conditional load with a non-conditional one, most notably they check\n  that a store happens in each iteration of _a_ loop but they assume\n  loops are executed.  They also perform a simple check whether the\n  store cannot trap which currently passes only for non-const\n  variables.  A simple testcase demonstrating it on an x86_64 is for\n  example the following:\n\n  $ cat cond_store.c\n\n  int g_1 = 1;\n\n  int g_2[1024] __attribute__((section (\"safe_section\"), aligned (4096)));\n\n  int c = 4;\n\n  int __attribute__ ((noinline))\n  foo (void)\n  {\n    int l;\n    for (l = 0; (l != 4); l++) {\n      if (g_1)\n        return l;\n      for (g_2[0] = 0; (g_2[0] >= 26); ++g_2[0])\n        ;\n    }\n    return 2;\n  }\n\n  int main (int argc, char* argv[])\n  {\n    if (mprotect (g_2, sizeof(g_2), PROT_READ) == -1)\n      {\n        int e = errno;\n        error (e, e, \"mprotect error %i\", e);\n      }\n    foo ();\n    __builtin_printf(\"OK\\n\");\n    return 0;\n  }\n  /* EOF */\n  $ ~/gcc/trunk/inst/bin/gcc cond_store.c -O2 --param allow-store-data-races=0\n  $ ./a.out\n  OK\n  $ ~/gcc/trunk/inst/bin/gcc cond_store.c -O2 --param allow-store-data-races=1\n  $ ./a.out\n  Segmentation fault\n\n  The testcase fails the same at least with 4.9, 4.8 and 4.7.  Therefore\n  I would suggest building kernels with this parameter set to zero. I\n  also agree with Jikos that the default should be changed for -O2.  I\n  have run most of the SPEC 2k6 CPU benchmarks (gamess and dealII\n  failed, at -O2, not sure why) compiled with and without this option\n  and did not see any real difference between respective run-times\"\n\nHopefully the default will be changed in newer gccs, but let's force it\nfor kernel builds so that we are on a safe side even when older gcc are\nused.\n\nThe code in question was out-of-tree printk-in-NMI (yeah, surprise\nsuprise, once again) patch written by Petr Mladek, let me quote his\ncomment from our internal bugzilla:\n\n \"I have spent few days investigating inconsistent state of kernel ring buffer.\n  It went out that it was caused by speculative store generated by\n  gcc-4.3.4.\n\n  The problem is in assembly generated for make_free_space(). The functions is\n  called the following way:\n\n  + vprintk_emit();\n      + log = MAIN_LOG; // with logbuf_lock\n         or\n         log = NMI_LOG; // with nmi_logbuf_lock\n         cont_add(log, ...);\n          + cont_flush(log, ...);\n              + log_store(log, ...);\n                    + log_make_free_space(log, ...);\n\n  If called with log = NMI_LOG then only nmi_log_* global variables are safe to\n  modify but the generated code does store also into (main_)log_* global\n  variables:\n\n  <log_make_free_space>:\n         55                      push   %rbp\n         89 f6                   mov    %esi,%esi\n\n         48 8b 05 03 99 51 01    mov    0x1519903(%rip),%rax       # ffffffff82620868 <nmi_log_next_id>\n         44 8b 1d ec 98 51 01    mov    0x15198ec(%rip),%r11d      # ffffffff82620858 <log_next_idx>\n         8b 35 36 60 14 01       mov    0x1146036(%rip),%esi       # ffffffff8224cfa8 <log_buf_len>\n         44 8b 35 33 60 14 01    mov    0x1146033(%rip),%r14d      # ffffffff8224cfac <nmi_log_buf_len>\n         4c 8b 2d d0 98 51 01    mov    0x15198d0(%rip),%r13       # ffffffff82620850 <log_next_seq>\n         4c 8b 25 11 61 14 01    mov    0x1146111(%rip),%r12       # ffffffff8224d098 <log_buf>\n         49 89 c2                mov    %rax,%r10\n         48 21 c2                and    %rax,%rdx\n         48 8b 1d 0c 99 55 01    mov    0x155990c(%rip),%rbx       # ffffffff826608a0 <nmi_log_buf>\n         49 c1 ea 20             shr    $0x20,%r10\n         48 89 55 d0             mov    %rdx,-0x30(%rbp)\n         44 29 de                sub    %r11d,%esi\n         45 29 d6                sub    %r10d,%r14d\n         4c 8b 0d 97 98 51 01    mov    0x1519897(%rip),%r9\t# ffffffff82620840 <log_first_seq>\n         eb 7e                   jmp    ffffffff81107029\t<log_make_free_space+0xe9>\n  [...]\n         85 ff                   test   %edi,%edi                  # edi = 1 for NMI_LOG\n         4c 89 e8                mov    %r13,%rax\n         4c 89 ca                mov    %r9,%rdx\n         74 0a                   je     ffffffff8110703d\t<log_make_free_space+0xfd>\n         8b 15 27 98 51 01       mov    0x1519827(%rip),%edx       # ffffffff82620860 <nmi_log_first_id>\n         48 8b 45 d0             mov    -0x30(%rbp),%rax\n         48 39 c2                cmp    %rax,%rdx                  # end of loop\n         0f 84 da 00 00 00       je     ffffffff81107120 <log_make_free_space+0x1e0>\n  [...]\n         85 ff                   test   %edi,%edi                  # edi = 1 for NMI_LOG\n         4c 89 0d 17 97 51 01    mov    %r9,0x1519717(%rip)        # ffffffff82620840 <log_first_seq>\n                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n                                 KABOOOM\n         74 35                   je     ffffffff81107160\t\t <log_make_free_space+0x220>\n\n  It stores log_first_seq when edi == NMI_LOG. This instructions are used also\n  when edi == MAIN_LOG but the store is done speculatively before the condition\n  is decided.  It is unsafe because we do not have \"logbuf_lock\" in NMI context\n  and some other process migh modify \"log_first_seq\" in parallel\"\n\nI believe that the best course of action is both\n\n - building kernel (and anything multi-threaded, I guess) with that\n   optimization turned off\n - persuade gcc folks to change the default for future releases\n\nSigned-off-by: Jiri Kosina <jkosina@suse.cz>\nCc: Martin Jambor <mjambor@suse.cz>\nCc: Petr Mladek <pmladek@suse.cz>\nCc: Linus Torvalds <torvalds@linux-foundation.org>\nCc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>\nCc: Peter Zijlstra <peterz@infradead.org>\nCc: Marek Polacek <polacek@redhat.com>\nCc: Jakub Jelinek <jakub@redhat.com>\nCc: Steven Noonan <steven@uplinklabs.net>\nCc: Richard Biener <richard.guenther@gmail.com>\nCc: Dan Carpenter <dan.carpenter@oracle.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Pranav Vashi <neobuddy89@gmail.com>","distinct":true,"url":"https://api.github.com/repos/GearCM/android_kernel_samsung_exynos5410/commits/cf2fcf86b0e308d19ce99938b3ca9a6193eda472"}]}