Re: [RFC] replace revoke hash table with rhashtable
From: Andreas Dilger <hidden>
Date: 2021-09-01 18:32:33
Attachments
- signature.asc [application/pgp-signature] 873 bytes
From: Andreas Dilger <hidden>
Date: 2021-09-01 18:32:33
On Aug 31, 2021, at 8:49 AM, Alex Zhuravlev [off-list ref] wrote:
Hi, Not so long ago we noticed that journal replay can take quite a lot (hours) in cases where many journaled blocks were freed during a short period.
It may be worthwhile to mention this was a case with a 4GB journal size.
I benchmarked hash table used by revoke code, basically it’s lookup+insert like jbd2 does at replay: 1048576 records - 95 seconds 2097152 records - 580 seconds Then I benchmarked rhashtable: 1048576 records - 2 seconds 2097152 records - 3 seconds 4194304 records - 7 seconds So, here is a patch replacing existing fixed-size hash table with rhashtable, please have a look. Thanks, Alex
Alex, the patch looks good from both a performance standpoint, as well as a good reduction in lines (and possibly memory, for the cases where there are fewer entries in the hash than the static table size). I did notice some lines are using 8-space indents instead of tabs. That can be fixed if there are any other comments, and you resubmit without [RFC]. Cheers, Andreas