Skip to content

Commit

Permalink
JFS: performance patch
Browse files Browse the repository at this point in the history
Basically, we saw a large amount of time spent in the
jfs_strfromUCS_le() function, mispredicting the branch inside the
loop, so I just added some unlikely modifiers to the if statements to
re-ordered the code.  Again, these simple changes provided > 2 % on
spec-sfs, so please consider it for inclusion.

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
  • Loading branch information
Sonny Rao authored and Dave Kleikamp committed Jun 23, 2005
1 parent a8ad86f commit f5f2877
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/jfs/jfs_unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ int jfs_strfromUCS_le(char *to, const __le16 * from,
}
} else {
for (i = 0; (i < len) && from[i]; i++) {
if (le16_to_cpu(from[i]) & 0xff00) {
if (warn) {
if (unlikely(le16_to_cpu(from[i]) & 0xff00)) {
to[i] = '?';
if (unlikely(warn)) {
warn--;
warn_again--;
printk(KERN_ERR
Expand All @@ -61,7 +62,7 @@ int jfs_strfromUCS_le(char *to, const __le16 * from,
printk(KERN_ERR
"mount with iocharset=utf8 to access\n");
}
to[i] = '?';

}
else
to[i] = (char) (le16_to_cpu(from[i]));
Expand Down

0 comments on commit f5f2877

Please sign in to comment.