Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
18e35e0a
Commit
18e35e0a
authored
Aug 01, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Throttle less often waiting for snapshots to delete
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
f87f057b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
16 deletions
+5
-16
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+5
-2
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+0
-14
No files found.
fs/btrfs/extent-tree.c
View file @
18e35e0a
...
...
@@ -2535,6 +2535,10 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
root_gen
,
0
,
0
,
1
);
BUG_ON
(
ret
);
mutex_unlock
(
&
root
->
fs_info
->
alloc_mutex
);
atomic_inc
(
&
root
->
fs_info
->
throttle_gen
);
wake_up
(
&
root
->
fs_info
->
transaction_throttle
);
continue
;
}
/*
...
...
@@ -2603,7 +2607,6 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
root_owner
=
btrfs_header_owner
(
parent
);
root_gen
=
btrfs_header_generation
(
parent
);
mutex_lock
(
&
root
->
fs_info
->
alloc_mutex
);
ret
=
__btrfs_free_extent
(
trans
,
root
,
bytenr
,
blocksize
,
root_owner
,
root_gen
,
0
,
0
,
1
);
...
...
@@ -2726,7 +2729,6 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
}
}
while
(
1
)
{
atomic_inc
(
&
root
->
fs_info
->
throttle_gen
);
wret
=
walk_down_tree
(
trans
,
root
,
path
,
&
level
);
if
(
wret
>
0
)
break
;
...
...
@@ -2742,6 +2744,7 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
ret
=
-
EAGAIN
;
break
;
}
atomic_inc
(
&
root
->
fs_info
->
throttle_gen
);
wake_up
(
&
root
->
fs_info
->
transaction_throttle
);
}
for
(
i
=
0
;
i
<=
orig_level
;
i
++
)
{
...
...
fs/btrfs/transaction.c
View file @
18e35e0a
...
...
@@ -211,11 +211,9 @@ static void throttle_on_drops(struct btrfs_root *root)
{
struct
btrfs_fs_info
*
info
=
root
->
fs_info
;
harder:
if
(
atomic_read
(
&
info
->
throttles
))
{
DEFINE_WAIT
(
wait
);
int
thr
;
int
harder_count
=
0
;
thr
=
atomic_read
(
&
info
->
throttle_gen
);
do
{
...
...
@@ -228,18 +226,6 @@ static void throttle_on_drops(struct btrfs_root *root)
schedule
();
finish_wait
(
&
info
->
transaction_throttle
,
&
wait
);
}
while
(
thr
==
atomic_read
(
&
info
->
throttle_gen
));
if
(
harder_count
<
5
&&
info
->
total_ref_cache_size
>
1
*
1024
*
1024
)
{
harder_count
++
;
goto
harder
;
}
if
(
harder_count
<
10
&&
info
->
total_ref_cache_size
>
5
*
1024
*
1024
)
{
harder_count
++
;
goto
harder
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment