Thread (7 messages) 7 messages, 3 authors, 2021-10-18

Re: [PATCH v3] btrfs: zoned: btrfs: zoned: use greedy gc for auto reclaim

From: Johannes Thumshirn <hidden>
Date: 2021-10-18 15:57:45

On 18/10/2021 17:56, David Sterba wrote:
On Mon, Oct 18, 2021 at 03:51:44PM +0000, Johannes Thumshirn wrote:
quoted
On 18/10/2021 17:42, David Sterba wrote:
quoted
On Thu, Oct 14, 2021 at 06:39:02PM +0900, Johannes Thumshirn wrote:
quoted
+/*
+ * We want block groups with a low number of used bytes to be in the beginning
+ * of the list, so they will get reclaimed first.
+ */
+static int reclaim_bgs_cmp(void *unused, const struct list_head *a,
+			   const struct list_head *b)
+{
+	const struct btrfs_block_group *bg1, *bg2;
+
+	bg1 = list_entry(a, struct btrfs_block_group, bg_list);
+	bg2 = list_entry(b, struct btrfs_block_group, bg_list);
+
+	return bg1->used - bg2->used;
So you also reverted to v1 the compare condition, this should be < so
it's the valid stable sort condition.
Ah damn, want me to resend with fixed commit message, subject and compare function?
Not needed, simple fixes are ok. And I correct myself it should be ">"
as was in v2.
Thanks a lot.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help