Skip to content

Instantly share code, notes, and snippets.

@yukkeorg
Last active October 29, 2016 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukkeorg/7648e12af7fe9b1387a23fe011872423 to your computer and use it in GitHub Desktop.
Save yukkeorg/7648e12af7fe9b1387a23fe011872423 to your computer and use it in GitHub Desktop.
Fix genarate thousand kworker on Linux Kernel 4.7
# Re: [Bug 172981] New: [bisected] SLAB: extreme load averages and over 2000 kworker threads
# Joonsoo Kim
# http://www.spinics.net/lists/linux-mm/msg114252.html
# Usage
# cd linux-X.X.X
# patch -p1 < this.patch
diff --git a/mm/slab.c b/mm/slab.c
index cc8bbc1..be4c7fa 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -964,7 +964,7 @@ static int setup_kmem_cache_node(struct kmem_cache *cachep,
* guaranteed to be valid until irq is re-enabled, because it will be
* freed after synchronize_sched().
*/
- if (force_change)
+ if (old_shared && force_change)
synchronize_sched();
fail:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment