* [PATCH 1/2] btrfs: add necessary comments about tickets_id
@ 2016-11-07 7:59 Wang Xiaoguang
2016-11-07 7:59 ` [PATCH 2/2] btrfs: increase tickets_id even for failed metadata request Wang Xiaoguang
0 siblings, 1 reply; 2+ messages in thread
From: Wang Xiaoguang @ 2016-11-07 7:59 UTC (permalink / raw)
To: linux-btrfs
Tickets_id's name may result in some misunderstandings, it just indicates
the next ticket will be handled and is not stored per ticket.
Fixes: ce12965 ("btrfs: introduce tickets_id to determine whether
asynchronous metadata reclaim work makes progress")
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
---
fs/btrfs/ctree.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 0b8ce2b..9307084 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -429,6 +429,10 @@ struct btrfs_space_info {
struct list_head ro_bgs;
struct list_head priority_tickets;
struct list_head tickets;
+ /*
+ * tickets_id just indicates the next ticket will be handled, so note
+ * it's not stored per ticket.
+ */
u64 tickets_id;
struct rw_semaphore groups_sem;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 2/2] btrfs: increase tickets_id even for failed metadata request
2016-11-07 7:59 [PATCH 1/2] btrfs: add necessary comments about tickets_id Wang Xiaoguang
@ 2016-11-07 7:59 ` Wang Xiaoguang
0 siblings, 0 replies; 2+ messages in thread
From: Wang Xiaoguang @ 2016-11-07 7:59 UTC (permalink / raw)
To: linux-btrfs
Not functional change, it just makes codes logic more reasonable, then
at least tickets_id can reflect the number of metadata requests we already
handled.
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
---
fs/btrfs/extent-tree.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 4607af3..d63bf40 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4949,14 +4949,16 @@ static inline int need_do_async_reclaim(struct btrfs_space_info *space_info,
&root->fs_info->fs_state));
}
-static void wake_all_tickets(struct list_head *head)
+static void wake_all_tickets(struct btrfs_space_info *space_info)
{
struct reserve_ticket *ticket;
+ struct list_head *head = &space_info->tickets;
while (!list_empty(head)) {
ticket = list_first_entry(head, struct reserve_ticket, list);
list_del_init(&ticket->list);
ticket->error = -ENOSPC;
+ space_info->tickets_id++;
wake_up(&ticket->wait);
}
}
@@ -5018,7 +5020,7 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work)
if (flush_state > COMMIT_TRANS) {
commit_cycles++;
if (commit_cycles > 2) {
- wake_all_tickets(&space_info->tickets);
+ wake_all_tickets(space_info);
space_info->flush = 0;
} else {
flush_state = FLUSH_DELAYED_ITEMS_NR;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-07 8:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-07 7:59 [PATCH 1/2] btrfs: add necessary comments about tickets_id Wang Xiaoguang
2016-11-07 7:59 ` [PATCH 2/2] btrfs: increase tickets_id even for failed metadata request Wang Xiaoguang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).