diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-27 15:05:48 +0200 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-27 16:34:35 +0200 |
commit | 8ca78f3eda4bf1799e8c4ba02035623fd7a347df (patch) | |
tree | 7d4ae8520273276213d1e02921b3eb338fc6a6f4 /fs/btrfs/backref.c | |
parent | cb77fcd88569cd2b7b25ecd4086ea932a53be9b3 (diff) | |
download | linux-8ca78f3eda4bf1799e8c4ba02035623fd7a347df.tar.bz2 |
Btrfs: avoid waiting for delayed refs when we must not
We track two conditions to decide if we should sleep while waiting for more
delayed refs, the number of delayed refs (num_refs) and the first entry in
the list of blockers (first_seq).
When we suspect staleness, we save num_refs and do one more cycle. If
nothing changes, we then save first_seq for later comparison and do
wait_event. We ought to save first_seq the very same moment we're saving
num_refs. Otherwise we cannot be sure that nothing has changed and we might
start waiting when we shouldn't, which could lead to starvation.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs/btrfs/backref.c')
0 files changed, 0 insertions, 0 deletions