]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
GFS2: Speed up gfs2_rbm_from_block
authorBob Peterson <rpeterso@redhat.com>
Fri, 19 Oct 2012 12:32:51 +0000 (08:32 -0400)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 7 Nov 2012 13:31:36 +0000 (13:31 +0000)
commita68a0a352a0209467268dfddffe02db08b97ddb4
treed307e08ac5f985d1e93ebf5fa0f18255a4610bd6
parent8eae1ca0034cce78a24738087a32adb1ddb66aa7
GFS2: Speed up gfs2_rbm_from_block

This patch is a rewrite of function gfs2_rbm_from_block. Rather than
looping to find the right bitmap, the code now does a few simple
math calculations.

I compared the performance of both algorithms side by side and the new
algorithm is noticeably faster. Sample instrumentation output from a
"fast" machine:

5 million calls: millisec spent: Orig: 166 New: 113
5 million calls: millisec spent: Orig: 189 New: 114

In addition, I ran postmark (on a somewhat slowr CPU) before the after
the new algorithm was put in place and postmark showed a decent
improvement:

Before the new algorithm:
-------------------------
Time:
645 seconds total
584 seconds of transactions (171 per second)

Files:
150087 created (232 per second)
Creation alone: 100000 files (2083 per second)
Mixed with transactions: 50087 files (85 per second)
49995 read (85 per second)
49991 appended (85 per second)
150087 deleted (232 per second)
Deletion alone: 100174 files (7705 per second)
Mixed with transactions: 49913 files (85 per second)

Data:
273.42 megabytes read (434.08 kilobytes per second)
852.13 megabytes written (1.32 megabytes per second)

With the new algorithm:
-----------------------
Time:
599 seconds total
530 seconds of transactions (188 per second)

Files:
150087 created (250 per second)
Creation alone: 100000 files (1886 per second)
Mixed with transactions: 50087 files (94 per second)
49995 read (94 per second)
49991 appended (94 per second)
150087 deleted (250 per second)
Deletion alone: 100174 files (6260 per second)
Mixed with transactions: 49913 files (94 per second)

Data:
273.42 megabytes read (467.42 kilobytes per second)
852.13 megabytes written (1.42 megabytes per second)

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/incore.h
fs/gfs2/ops_fstype.c
fs/gfs2/rgrp.c