Skip to contentSkip to conversation

f2fs: check discard command number before traversing discard pending list

PATCH New Chao Yu 1 participant 1 message Feb 22, 2021 F2FS file system

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs: check discard command number before traversing discard pending list

In trim thread, let's add a condition to check discard command number before traversing discard pending list, it can avoid unneeded traversing if there is no discard command.

---
 fs/f2fs/segment.c | 2 ++
 1 file changed, 2 insertions(+)
fs/f2fs/segment.c +2 -0
index deaf57e13125..1e674c117ce3 100644
@@ -1769,6 +1769,8 @@ static int issue_discard_thread(void *data)
 			wait_ms = dpolicy.max_interval;
 			continue;
 		}
+		if (!atomic_read(&dcc->discard_cmd_cnt))
+			continue;
 
 		if (sbi->gc_mode == GC_URGENT_HIGH)
 			__init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1);
Signature · 8 lines
2.29.2



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel