Skip to contentSkip to conversation

dm-kcopyd: Correctly free requests

PATCH In review Bastian Blank 2 participants 3 messages Aug 26, 2011 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm-kcopyd: Correctly free requests

kcopyd only frees the requests if the master job information is set up correctly, but it was not in the recently added path. This leads to many unfreed slabs during snapshot usage.

drivers/md/dm-kcopyd.c +1 -0
index f821470..32ac708 100644
@@ -628,6 +628,7 @@ void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc,
 	job->kc = kc;
 	job->fn = fn;
 	job->context = context;
+	job->master_job = job;
 
 	atomic_inc(&kc->nr_jobs);
 
Signature · 2 lines
Landru! Guide us!
		-- A Beta 3-oid, "The Return of the Archons", stardate 3157.4
#1 lore raw
Quoted 3 lines · Bastian Blank

kcopyd only frees the requests if the master job information is set up correctly, but it was not in the recently added path. This leads to many unfreed slabs during snapshot usage.

Referring to commit c6ea41fbbe08f270a8edef99dc369faf809d1bd6
dm kcopyd: preallocate sub jobs to avoid deadlock
which added the master_job field.

Alasdair

#2 lore raw
Quoted 7 lines · Alasdair G Kergon
Quoted 3 lines · Bastian Blank

kcopyd only frees the requests if the master job information is set up correctly, but it was not in the recently added path. This leads to many unfreed slabs during snapshot usage.

Referring to commit c6ea41fbbe08f270a8edef99dc369faf809d1bd6
dm kcopyd: preallocate sub jobs to avoid deadlock
which added the master_job field.

and commit a6e50b409d3f9e0833e69c3c9cca822e8fa4adbb
dm snapshot: skip reading origin when overwriting complete chunk
which indeed forgets to set the new field.

I'll submit the patch shortly, together with some other minor fixes sitting in linux-next.

Alasdair