Merge lp:~akopytov/percona-server/bug1130655 into lp:percona-server/5.5

Proposed by Alexey Kopytov
Status: Merged
Approved by: Sergei Glushchenko
Approved revision: no longer in the source branch.
Merged at revision: 452
Proposed branch: lp:~akopytov/percona-server/bug1130655
Merge into: lp:percona-server/5.5
Diff against target: 20 lines (+3/-3)
1 file modified
Percona-Server/storage/innobase/row/row0sel.c (+3/-3)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug1130655
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 Approve
Review via email: mp+149819@code.launchpad.net

Description of the change

  Bug #1130655: Suboptimal code in row_search_for_mysql()

  Provide compiler with the branch prediction information similar to the original
  code replaced by innodb_adaptive_hash_index_partitions.patch.

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innobase/row/row0sel.c'
2--- Percona-Server/storage/innobase/row/row0sel.c 2013-01-09 23:45:25 +0000
3+++ Percona-Server/storage/innobase/row/row0sel.c 2013-02-21 12:52:22 +0000
4@@ -3520,13 +3520,13 @@
5 should_release = 0;
6 for (i = 0; i < btr_search_index_num; i++) {
7 /* we should check all latches (fix Bug#791030) */
8- if (rw_lock_get_writer(btr_search_latch_part[i])
9- != RW_LOCK_NOT_LOCKED) {
10+ if (UNIV_UNLIKELY(rw_lock_get_writer(btr_search_latch_part[i])
11+ != RW_LOCK_NOT_LOCKED)) {
12 should_release |= ((ulint)1 << i);
13 }
14 }
15
16- if (should_release) {
17+ if (UNIV_UNLIKELY(should_release)) {
18
19 /* There is an x-latch request on the adaptive hash index:
20 release the s-latch to reduce starvation and wait for

Subscribers

People subscribed via source and target branches