Skip to contentSkip to conversation

mm/zswap: unregister zswap_cpu_notifier_block in cleanup procedure

PATCH In review Mahendran Ganesh 2 participants 3 messages Nov 9, 2014 – Nov 13, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/zswap: unregister zswap_cpu_notifier_block in cleanup procedure

In zswap_cpu_init(), the code does not unregister *zswap_cpu_notifier_block* during the cleanup procedure.

This patch fix this issue.

---
 mm/zswap.c |    1 +
 1 file changed, 1 insertion(+)
mm/zswap.c +1 -0
index ea064c1..51a2c45 100644
@@ -404,6 +404,7 @@ static int zswap_cpu_init(void)
 cleanup:
 	for_each_online_cpu(cpu)
 		__zswap_cpu_notifier(CPU_UP_CANCELED, cpu);
+	__unregister_cpu_notifier(&zswap_cpu_notifier_block);
 	cpu_notifier_register_done();
 	return -ENOMEM;
 }
Signature · 7 lines
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#1 lore raw
Quoted 2 lines · Mahendran Ganesh

In zswap_cpu_init(), the code does not unregister *zswap_cpu_notifier_block* during the cleanup procedure.

This is not needed. If we are in the cleanup code, we never got to the __register_cpu_notifier() call.

Thanks,
Seth

Quoted 23 lines

This patch fix this issue.

---
 mm/zswap.c |    1 +
 1 file changed, 1 insertion(+)
mm/zswap.c +1 -0
index ea064c1..51a2c45 100644
@@ -404,6 +404,7 @@ static int zswap_cpu_init(void)
 cleanup:
 	for_each_online_cpu(cpu)
 		__zswap_cpu_notifier(CPU_UP_CANCELED, cpu);
+	__unregister_cpu_notifier(&zswap_cpu_notifier_block);
 	cpu_notifier_register_done();
 	return -ENOMEM;
 }
Signature · 1 line
1.7.9.5
#2 lore raw

2014-11-13 10:53 GMT+08:00 Seth Jennings <[email protected]>:

Quoted 6 lines · Mahendran Ganesh
Quoted 2 lines

In zswap_cpu_init(), the code does not unregister *zswap_cpu_notifier_block* during the cleanup procedure.

This is not needed. If we are in the cleanup code, we never got to the __register_cpu_notifier() call.

Yes, you are right. Thanks for you review.

Quoted 12 lines

Thanks,
Seth

Quoted 8 lines

This patch fix this issue.

---
 mm/zswap.c |    1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines
Quoted 13 lines
mm/zswap.c +1 -1
index ea064c1..51a2c45 100644
@@ -404,6 +404,7 @@ static int zswap_cpu_init(void)
 cleanup:
      for_each_online_cpu(cpu)
              __zswap_cpu_notifier(CPU_UP_CANCELED, cpu);
+     __unregister_cpu_notifier(&zswap_cpu_notifier_block);
      cpu_notifier_register_done();
      return -ENOMEM;
 }
--
Quoted 2 lines

1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>