erofs-utils: avoid unnecessary insert behavior when not deduplicating
PATCH 1/1 erofs-utils: avoid unnecessary insert behavior when not deduplicating
From: Yue Hu <[email protected]>
We should do nothing in dedupe inserting when it's not configured.
--- lib/dedupe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dedupe.c +1 -1
@@ -99,7 +99,7 @@ int z_erofs_dedupe_insert(struct z_erofs_inmem_extent *e, {struct z_erofs_dedupe_item *di; -if (e->length < window_size) +if (!dedupe_subtree || e->length < window_size)return 0 ; di =malloc (sizeof (*di) + e->length - window_size);
Signature · 1 line
2.17.1
Hi Yue,
Quoted 6 lines · Yue Hu
From: Yue Hu <[email protected]>
We should do nothing in dedupe inserting when it's not configured.
Signed-off-by Yue Hu <[email protected]>---
Thanks for the patch, do you observe some strange happening?
IMO, If dedupe is not enabled, window_size will be 0 I think. However, I think we might need to disable it explicitly like below.
So,
Thanks,
Gao Xiang
Quoted 18 lines
lib/dedupe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/dedupe.c +1
-1@@ -99,7 +99,7 @@ int z_erofs_dedupe_insert(struct z_erofs_inmem_extent *e, {struct z_erofs_dedupe_item *di; -if (e->length < window_size) +if (!dedupe_subtree || e->length < window_size)return 0 ; di =malloc (sizeof (*di) + e->length - window_size);Signature · 1 line
2.17.1
Quoted 11 lines · On Thu, 13 Oct 2022 16:59:26 +0800 Gao Xiang <[email protected]>…
Hi Yue,
Quoted 6 lines · Yue Hu
From: Yue Hu <[email protected]>
We should do nothing in dedupe inserting when it's not configured.
Signed-off-by Yue Hu <[email protected]>---
Thanks for the patch, do you observe some strange happening?
I can see malloc/memcpy at runtime when dedupe is disabled. So, just skip.
Quoted 29 lines
IMO, If dedupe is not enabled,
window_sizewill be 0 I think. However, I think we might need to disable it explicitly like below.So,
Reviewed-by Gao Xiang <[email protected]>Thanks,
Gao XiangQuoted 18 lines
lib/dedupe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/dedupe.c +1
-1@@ -99,7 +99,7 @@ int z_erofs_dedupe_insert(struct z_erofs_inmem_extent *e, {struct z_erofs_dedupe_item *di; -if (e->length < window_size) +if (!dedupe_subtree || e->length < window_size)return 0 ; di =malloc (sizeof (*di) + e->length - window_size);Signature · 1 line
2.17.1
Quoted 8 lines · Yue Hu
Quoted 5 lines · On Thu, 13 Oct 2022 16:59:26 +0800 Gao Xiang <[email protected]>…
Hi Yue,
Quoted 2 lines · Yue Hu
From: Yue Hu <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
We should do nothing in dedupe inserting when it's not configured.
Signed-off-by Yue Hu <[email protected]>---
Thanks for the patch, do you observe some strange happening?
I can see malloc/memcpy at runtime when dedupe is disabled. So, just skip.
Would you mind confirming the numbers of e->length and window_size at that time?
Thanks,
Gao Xiang
Quoted 10 lines
Quoted 10 lines
IMO, If dedupe is not enabled,
window_sizewill be 0 I think. However, I think we might need to disable it explicitly like below.So,
Reviewed-by Gao Xiang <[email protected]>Thanks,
Gao Xiang
Hi Xiang,
Quoted 14 lines · On Fri, 14 Oct 2022 10:15:27 +0800 Gao Xiang <[email protected]>…
Quoted 13 lines · Yue Hu
Quoted 10 lines · On Thu, 13 Oct 2022 16:59:26 +0800 Gao Xiang <[email protected]>…
Hi Yue,
Quoted 6 lines · Yue Hu
From: Yue Hu <[email protected]>
We should do nothing in dedupe inserting when it's not configured.
Signed-off-by Yue Hu <[email protected]>---
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks for the patch, do you observe some strange happening?
I can see malloc/memcpy at runtime when dedupe is disabled. So, just skip.
Would you mind confirming the numbers of
e->lengthandwindow_sizeat that time?
The caller to insert function is just checking "!may_inline && !may_packing".
Check below (-zlz4hc foo.img foo/):
Processing .gitignore ...
<E> erofs: z_erofs_dedupe_insert() Line[105] e->length 84, window_size 0 Processing Kconfig.freezer ...
<E> erofs: z_erofs_dedupe_insert() Line[105] e->length 92, window_size 0 Processing Kconfig.hz ...
<E> erofs: z_erofs_dedupe_insert() Line[105] e->length 1709, window_size 0
lib/dedupe.c +2 -0
@@ -102,6 +102,8 @@ int z_erofs_dedupe_insert(struct z_erofs_inmem_extent *e,if (e->length < window_size)return 0 ; +erofs_err ("e->length %u, window_size %u" , e->length, window_size); + di =malloc (sizeof (*di) + e->length - window_size);
Thanks.
Quoted 14 lines
Thanks,
Gao XiangQuoted 10 lines
Quoted 10 lines
IMO, If dedupe is not enabled,
window_sizewill be 0 I think. However, I think we might need to disable it explicitly like below.So,
Reviewed-by Gao Xiang <[email protected]>Thanks,
Gao Xiang
Quoted 28 lines · Yue Hu
Hi Xiang,
Quoted 14 lines · On Fri, 14 Oct 2022 10:15:27 +0800 Gao Xiang <[email protected]>…
Quoted 13 lines · Yue Hu
Quoted 10 lines · On Thu, 13 Oct 2022 16:59:26 +0800 Gao Xiang <[email protected]>…
Hi Yue,
Quoted 6 lines · Yue Hu
From: Yue Hu <[email protected]>
We should do nothing in dedupe inserting when it's not configured.
Signed-off-by Yue Hu <[email protected]>---
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks for the patch, do you observe some strange happening?
I can see malloc/memcpy at runtime when dedupe is disabled. So, just skip.
Would you mind confirming the numbers of
e->lengthandwindow_sizeat that time?The caller to insert function is just checking "!may_inline && !may_packing".
Quoted 9 lines
Check below (-zlz4hc foo.img foo/):
Processing .gitignore ...
<E> erofs:z_erofs_dedupe_insert()Line[105]e->length84,window_size0 ProcessingKconfig.freezer...
<E> erofs:z_erofs_dedupe_insert()Line[105]e->length92,window_size0 ProcessingKconfig.hz...
<E> erofs:z_erofs_dedupe_insert()Line[105]e->length1709,window_size0
Thanks for confirming!
Thanks,
Gao Xiang