Project

General

Profile

Actions

Feature #7063

closed

Replace lfn_find call in omap* functions with more lighter implematation

Added by Haomai Wang over 10 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
OSD
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

find_index plays a important role in handling transactions with FileStore. Although it's not a heave implementation, it's called several times each transaction and the cumulative time is still striking.

In a latest test with all SSD backend, the actual IO operations don't occur the main consuming time and find_index takes over 25% time of the whole transaction.

Systemtap results:
----lfn_find--------------------------------------------------
value |-------------------------------------------------- count
20 | 0
30 | 0
40 |@@@@@@ 5290
50 |
@@@@@@@@@@@@@@@@@@@@@@@@ 18867
60 |@@@@@@ 4544
70 |@@@@ 3673
80 |
@@@ 2279
90 | 467
100 | 117
>100 |
@@@ 2275

sum: 2646862
----do_transactions-------------------------------------------
value |-------------------------------------------------- count
225 | 0
250 | 0
>250 |@@@@@@@@@@@@@@@@@@@@@@@@@ 9377

sum: 10785520
--------------------------------------------------------------

I simply remove all lfn_find() in omap* functions, it decrease op latency hugely.

----do_transactions-------------------------------------------
value |-------------------------------------------------- count
225 | 0
250 | 0
>250 |@@@@@@@@@@@@@@@@@@@@@@@@@ 20212

39359311
--------------------------------------------------------------

Nearly improve 2x throughout.

So I think we need to a way to avoid or lighten find_index call. Maybe cache object existing status, remove object or move object both are rarely thing.

Actions #1

Updated by Haomai Wang over 10 years ago

Maybe we can maintain a hashmap<object, state>, "state" can be int and 0 mean unknown, 1 mean existing. If unknown, it may need to call "lfn_find" to check. Because most of "lfn_find" return value are existing state, it will be a little percentage of caller needed to check filesystem again.

Atomic operation can be used to modify state.

Actions #2

Updated by Haomai Wang over 10 years ago

  • Subject changed from Replace find_index call in omap* functions with more lighter implematation to Replace lfn_find call in omap* functions with more lighter implematation
Actions #3

Updated by Haomai Wang over 10 years ago

It seemed that "IndexManager::get_index" protect concurrent write operations on the same object. So if remove it, multi write operations on the same object may be happened?

Actions #4

Updated by Haomai Wang about 8 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF