[Devel] [PATCH RHEL7 COMMIT] blk-cbt: Remove needless zeroing

Konstantin Khorenko khorenko at virtuozzo.com
Tue Feb 21 21:07:06 MSK 2023


The commit is pushed to "branch-rh7-3.10.0-1160.83.1.vz7.194.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.83.1.vz7.194.4
------>
commit 5fa9a5b8e8397aed4be5096b615d5e615fa63baf
Author: Nikolay Borisov <nikolay.borisov at virtuozzo.com>
Date:   Fri Jan 27 13:34:38 2023 +0200

    blk-cbt: Remove needless zeroing
    
    The per-cpu allocator guarantees the returned memory is going to be
    zeroed out so it's redundant to do our own zeroing when initializing
    cbt. Simply remove this code.
    
    Fixes: acdc18e4d1aa ("cbt: introduce changed block tracking")
    
    Signed-off-by: Nikolay Borisov <nikolay.borisov at virtuozzo.com>
    Reviewed-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
---
 block/blk-cbt.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/block/blk-cbt.c b/block/blk-cbt.c
index 054c73c6ef9f..d1eb6ce500e7 100644
--- a/block/blk-cbt.c
+++ b/block/blk-cbt.c
@@ -262,9 +262,6 @@ static struct cbt_info* do_cbt_alloc(struct request_queue *q, __u8 *uuid,
 				     loff_t size, loff_t blocksize)
 {
 	struct cbt_info *cbt;
-	struct cbt_extent *ex;
-	int i;
-
 
 	cbt = kzalloc(sizeof(*cbt), GFP_KERNEL);
 	if (!cbt)
@@ -278,11 +275,6 @@ static struct cbt_info* do_cbt_alloc(struct request_queue *q, __u8 *uuid,
 	if (!cbt->cache)
 		goto err_cbt;
 
-	for_each_possible_cpu(i) {
-		ex = per_cpu_ptr(cbt->cache, i);
-		memset(ex, 0, sizeof (*ex));
-	}
-
 	cbt->map = vmalloc(NR_PAGES(cbt->block_max) * sizeof(void*));
 	if (!cbt->map)
 		goto err_pcpu;


More information about the Devel mailing list