diff options
author | Josef Bacik <jbacik@fb.com> | 2015-09-24 16:17:39 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-21 18:51:40 -0700 |
commit | 161c3549b45aeef05451b6822d8aaaf39c7bedce (patch) | |
tree | f14c534323f7b8d6bf181c9610df66313358360b /fs/btrfs/ordered-data.h | |
parent | a408365c62762c30419018587cffd2b89836434e (diff) | |
download | linux-stable-161c3549b45aeef05451b6822d8aaaf39c7bedce.tar.gz linux-stable-161c3549b45aeef05451b6822d8aaaf39c7bedce.tar.bz2 linux-stable-161c3549b45aeef05451b6822d8aaaf39c7bedce.zip |
Btrfs: change how we wait for pending ordered extents
We have a mechanism to make sure we don't lose updates for ordered extents that
were logged in the transaction that is currently running. We add the ordered
extent to a transaction list and then the transaction waits on all the ordered
extents in that list. However are substantially large file systems this list
can be extremely large, and can give us soft lockups, since the ordered extents
don't remove themselves from the list when they do complete.
To fix this we simply add a counter to the transaction that is incremented any
time we have a logged extent that needs to be completed in the current
transaction. Then when the ordered extent finally completes it decrements the
per transaction counter and wakes up the transaction if we are the last ones.
This will eliminate the softlockup. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ordered-data.h')
-rw-r--r-- | fs/btrfs/ordered-data.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h index 7176cc0fe43f..23c96059cef2 100644 --- a/fs/btrfs/ordered-data.h +++ b/fs/btrfs/ordered-data.h @@ -73,6 +73,8 @@ struct btrfs_ordered_sum { #define BTRFS_ORDERED_LOGGED 10 /* Set when we've waited on this ordered extent * in the logging code. */ +#define BTRFS_ORDERED_PENDING 11 /* We are waiting for this ordered extent to + * complete in the current transaction. */ struct btrfs_ordered_extent { /* logical offset in the file */ u64 file_offset; |