[PATCH 1/1] JFS: performance patch
[email protected] (Dave Kleikamp) Thu, 23 Jun 2005 17:00:59 -0500 (CDT)
| Newsgroups | gmane.comp.file-systems.jfs.patches |
|---|---|
| Message-ID | <[email protected]> |
JFS: performance patch 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 <[email protected]> --- commit f5f287738bddf38ec9ca79344f00dab675e1bbf5 tree c8144a3906f6904f7cf18c4520976c79a1e15b0a parent a8ad86f2dc46356f87be1327dabc18bdbda32f50 author Sonny Rao <[email protected]> Thu, 23 Jun 2005 16:57:56 -0500 committer Dave Kleikamp <[email protected]> Thu, 23 Jun 2005 16:57:56 -0500 fs/jfs/jfs_unicode.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/jfs/jfs_unicode.c b/fs/jfs/jfs_unicode.c --- a/fs/jfs/jfs_unicode.c +++ b/fs/jfs/jfs_unicode.c @@ -51,8 +51,9 @@ int jfs_strfromUCS_le(char *to, const __ } } 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 @@ -61,7 +62,7 @@ int jfs_strfromUCS_le(char *to, const __ printk(KERN_ERR "mount with iocharset=utf8 to access\n"); } - to[i] = '?'; + } else to[i] = (char) (le16_to_cpu(from[i])); ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click