<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/mm/slub.c, branch o-8.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=o-8.1</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=o-8.1'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2018-05-16T13:01:26+00:00</updated>
<entry>
<title>panic on !PageSlab &amp;&amp; !PageCompound in ksize</title>
<updated>2018-05-16T13:01:26+00:00</updated>
<author>
<name>Daniel Micay</name>
<email>danielmicay@gmail.com</email>
</author>
<published>2017-03-26T20:24:45+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=77940eebdc7a31435dee125103029b79dc3c7169'/>
<id>urn:sha1:77940eebdc7a31435dee125103029b79dc3c7169</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add slub free list XOR encryption</title>
<updated>2018-05-16T13:01:25+00:00</updated>
<author>
<name>Daniel Micay</name>
<email>danielmicay@gmail.com</email>
</author>
<published>2017-01-23T22:33:53+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=27feb7f377841173b9c193f89d6b616d3413f071'/>
<id>urn:sha1:27feb7f377841173b9c193f89d6b616d3413f071</id>
<content type='text'>
Based on the grsecurity feature, but with a per-cache random value.
</content>
</entry>
<entry>
<title>add slub sanitization</title>
<updated>2018-05-16T13:01:25+00:00</updated>
<author>
<name>Daniel Micay</name>
<email>danielmicay@gmail.com</email>
</author>
<published>2017-01-24T03:40:10+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=84cd07dc2f6d3b163458c5c87671da6530e6e0f1'/>
<id>urn:sha1:84cd07dc2f6d3b163458c5c87671da6530e6e0f1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>slub: Fix sysfs duplicate filename creation when slub_debug=O</title>
<updated>2017-11-24T14:16:17+00:00</updated>
<author>
<name>Miles Chen</name>
<email>miles.chen@mediatek.com</email>
</author>
<published>2017-11-11T02:03:25+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=b09bd9603daaa9fb66952db9c56dd697f903778f'/>
<id>urn:sha1:b09bd9603daaa9fb66952db9c56dd697f903778f</id>
<content type='text'>
When slub_debug=O is set. It is possible to clear debug flags
for an "unmergeable" slab cache in kmem_cache_open().
It makes the "unmergeable" cache became "mergeable" in sysfs_slab_add().

These caches will generate their "unique IDs" by create_unique_id(),
but it is possible to create identical unique IDs. In my experiment,
sgpool-128, names_cache, biovec-256 generate the same ID ":Ft-0004096"
and the kernel reports "sysfs: cannot create duplicate filename
'/kernel/slab/:Ft-0004096'".

To repeat my experiment, set disable_higher_order_debug=1,
CONFIG_SLUB_DEBUG_ON=y in kernel-4.14.

Fix this issue by setting unmergeable=1 if slub_debug=O and the
the default slub_debug contains any no-merge flags.

call path:
kmem_cache_create()
  __kmem_cache_alias()	-&gt; we set SLAB_NEVER_MERGE flags here
  create_cache()
    __kmem_cache_create()
      kmem_cache_open()	-&gt; clear DEBUG_METADATA_FLAGS
      sysfs_slab_add()	-&gt; the slab cache is mergeable now

[    0.674272] sysfs: cannot create duplicate filename '/kernel/slab/:Ft-0004096'
[    0.674473] ------------[ cut here ]------------
[    0.674653] WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x60/0x7c
[    0.674847] Modules linked in:
[    0.674969] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W       4.14.0-rc7ajb-00131-gd4c2e9f-dirty #123
[    0.675211] Hardware name: linux,dummy-virt (DT)
[    0.675342] task: ffffffc07d4e0080 task.stack: ffffff8008008000
[    0.675505] PC is at sysfs_warn_dup+0x60/0x7c
[    0.675633] LR is at sysfs_warn_dup+0x60/0x7c
[    0.675759] pc : [&lt;ffffff8008235808&gt;] lr : [&lt;ffffff8008235808&gt;] pstate: 60000145
[    0.675948] sp : ffffff800800bb40
[    0.676048] x29: ffffff800800bb40 x28: 0000000000000040
[    0.676209] x27: ffffffc07c52a380 x26: 0000000000000000
[    0.676369] x25: ffffff8008af4ad0 x24: ffffff8008af4000
[    0.676528] x23: ffffffc07c532580 x22: ffffffc07cf04598
[    0.676695] x21: ffffffc07cf26578 x20: ffffffc07c533700
[    0.676857] x19: ffffffc07ce67000 x18: 0000000000000002
[    0.677017] x17: 0000000000007ffe x16: 0000000000000007
[    0.677176] x15: 0000000000000001 x14: 0000000000007fff
[    0.677335] x13: 0000000000000394 x12: 0000000000000000
[    0.677492] x11: 00000000000001ab x10: 0000000000000007
[    0.677651] x9 : 00000000000001ac x8 : ffffff800835d114
[    0.677809] x7 : 656b2f2720656d61 x6 : 0000000000000017
[    0.677967] x5 : ffffffc07ffdb9a8 x4 : 0000000000000000
[    0.678124] x3 : 0000000000000000 x2 : ffffffffffffffff
[    0.678282] x1 : ffffff8008a4e878 x0 : 0000000000000042
[    0.678442] Call trace:
[    0.678528] Exception stack(0xffffff800800ba00 to 0xffffff800800bb40)
[    0.678706] ba00: 0000000000000042 ffffff8008a4e878 ffffffffffffffff 0000000000000000
[    0.678914] ba20: 0000000000000000 ffffffc07ffdb9a8 0000000000000017 656b2f2720656d61
[    0.679121] ba40: ffffff800835d114 00000000000001ac 0000000000000007 00000000000001ab
[    0.679326] ba60: 0000000000000000 0000000000000394 0000000000007fff 0000000000000001
[    0.679532] ba80: 0000000000000007 0000000000007ffe 0000000000000002 ffffffc07ce67000
[    0.679739] baa0: ffffffc07c533700 ffffffc07cf26578 ffffffc07cf04598 ffffffc07c532580
[    0.679944] bac0: ffffff8008af4000 ffffff8008af4ad0 0000000000000000 ffffffc07c52a380
[    0.680149] bae0: 0000000000000040 ffffff800800bb40 ffffff8008235808 ffffff800800bb40
[    0.680354] bb00: ffffff8008235808 0000000060000145 ffffffc07c533700 0000000062616c73
[    0.680560] bb20: ffffffffffffffff 0000000000000000 ffffff800800bb40 ffffff8008235808
[    0.680774] [&lt;ffffff8008235808&gt;] sysfs_warn_dup+0x60/0x7c
[    0.680928] [&lt;ffffff8008235920&gt;] sysfs_create_dir_ns+0x98/0xa0
[    0.681095] [&lt;ffffff8008539274&gt;] kobject_add_internal+0xa0/0x294
[    0.681267] [&lt;ffffff80085394f8&gt;] kobject_init_and_add+0x90/0xb4
[    0.681435] [&lt;ffffff80081b524c&gt;] sysfs_slab_add+0x90/0x200
[    0.681592] [&lt;ffffff80081b62a0&gt;] __kmem_cache_create+0x26c/0x438
[    0.681769] [&lt;ffffff80081858a4&gt;] kmem_cache_create+0x164/0x1f4
[    0.681940] [&lt;ffffff80086caa98&gt;] sg_pool_init+0x60/0x100
[    0.682094] [&lt;ffffff8008084144&gt;] do_one_initcall+0x38/0x12c
[    0.682254] [&lt;ffffff80086a0d10&gt;] kernel_init_freeable+0x138/0x1d4
[    0.682423] [&lt;ffffff8008547388&gt;] kernel_init+0x10/0xfc
[    0.682571] [&lt;ffffff80080851e0&gt;] ret_from_fork+0x10/0x18

Signed-off-by: Miles Chen &lt;miles.chen@mediatek.com&gt;
</content>
</entry>
<entry>
<title>Mediatek: mm:slub: Use newest node_nr_slabs &amp;&amp; node_nr_objs in get_slabinfo</title>
<updated>2017-04-11T09:00:26+00:00</updated>
<author>
<name>cesar.maximo@gmail.com</name>
<email>cesar.maximo@gmail.com</email>
</author>
<published>2016-09-18T18:37:16+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=c473dfaf9314a12eb4864db8bdd59f04b72c6c0f'/>
<id>urn:sha1:c473dfaf9314a12eb4864db8bdd59f04b72c6c0f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Mediatek: mm:slub: Drop depricated nr_partials</title>
<updated>2017-04-11T09:00:26+00:00</updated>
<author>
<name>cesar.maximo@gmail.com</name>
<email>cesar.maximo@gmail.com</email>
</author>
<published>2016-09-18T18:35:16+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=a08d27e6fff9e48e6bfbfb94a7d287f3c72ca780'/>
<id>urn:sha1:a08d27e6fff9e48e6bfbfb94a7d287f3c72ca780</id>
<content type='text'>
</content>
</entry>
<entry>
<title> Get rid of __cpuinit</title>
<updated>2017-04-11T09:00:11+00:00</updated>
<author>
<name>Moyster</name>
<email>oysterized@gmail.com</email>
</author>
<published>2017-03-18T01:50:50+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=7c777e87cb30fc926920d677a845d651decaf997'/>
<id>urn:sha1:7c777e87cb30fc926920d677a845d651decaf997</id>
<content type='text'>
This commit is the result of

find . -name '*.c' | xargs sed -i 's/ __cpuinit / /g'
find . -name '*.c' | xargs sed -i 's/ __cpuexit / /g'
find . -name '*.c' | xargs sed -i 's/ __cpuinitdata / /g'
find . -name '*.c' | xargs sed -i 's/ __cpuinit$//g'
find ./arch/ -name '*.h' | xargs sed -i 's/ __cpuinit//g'
find . -name '*.c' | xargs sed -i 's/^__cpuinit //g'
find . -name '*.c' | xargs sed -i 's/^__cpuinitdata //g'
find . -name '*.c' | xargs sed -i 's/\*__cpuinit /\*/g'
find . -name '*.c' | xargs sed -i 's/ __cpuinitconst / /g'
find . -name '*.h' | xargs sed -i 's/ __cpuinit / /g'
find . -name '*.h' | xargs sed -i 's/ __cpuinitdata / /g'
git add .
git reset include/linux/init.h
git checkout -- include/linux/init.h

based off : https://github.com/jollaman999/jolla-kernel_bullhead/commit/bc15db84a622eed7d61d3ece579b577154d0ec29
</content>
</entry>
<entry>
<title>slub: do not assert not having lock in removing freed partial</title>
<updated>2016-09-28T13:14:32+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2014-02-10T22:25:46+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=1d0dc70511de207883ce0252801a77b796ec196f'/>
<id>urn:sha1:1d0dc70511de207883ce0252801a77b796ec196f</id>
<content type='text'>
Vladimir reported the following issue:

Commit c65c1877bd68 ("slub: use lockdep_assert_held") requires
remove_partial() to be called with n-&gt;list_lock held, but free_partial()
called from kmem_cache_close() on cache destruction does not follow this
rule, leading to a warning:

  WARNING: CPU: 0 PID: 2787 at mm/slub.c:1536 __kmem_cache_shutdown+0x1b2/0x1f0()
  Modules linked in:
  CPU: 0 PID: 2787 Comm: modprobe Tainted: G        W    3.14.0-rc1-mm1+ #1
  Hardware name:
   0000000000000600 ffff88003ae1dde8 ffffffff816d9583 0000000000000600
   0000000000000000 ffff88003ae1de28 ffffffff8107c107 0000000000000000
   ffff880037ab2b00 ffff88007c240d30 ffffea0001ee5280 ffffea0001ee52a0
  Call Trace:
    __kmem_cache_shutdown+0x1b2/0x1f0
    kmem_cache_destroy+0x43/0xf0
    xfs_destroy_zones+0x103/0x110 [xfs]
    exit_xfs_fs+0x38/0x4e4 [xfs]
    SyS_delete_module+0x19a/0x1f0
    system_call_fastpath+0x16/0x1b

His solution was to add a spinlock in order to quiet lockdep.  Although
there would be no contention to adding the lock, that lock also requires
disabling of interrupts which will have a larger impact on the system.

Instead of adding a spinlock to a location where it is not needed for
lockdep, make a __remove_partial() function that does not test if the
list_lock is held, as no one should have it due to it being freed.

Also added a __add_partial() function that does not do the lock
validation either, as it is not needed for the creation of the cache.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Reported-by: Vladimir Davydov &lt;vdavydov@parallels.com&gt;
Suggested-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Vladimir Davydov &lt;vdavydov@parallels.com&gt;
Acked-by: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: W4TCH0UT &lt;ateekujjawal@gmail.com&gt;
</content>
</entry>
<entry>
<title>mm: slub: work around unneeded lockdep warning</title>
<updated>2016-09-28T13:14:31+00:00</updated>
<author>
<name>Dave Hansen</name>
<email>dave.hansen@linux.intel.com</email>
</author>
<published>2014-01-24T15:20:23+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=6d920febf5a78394fb5da2ffa4b0cf6636b707d8'/>
<id>urn:sha1:6d920febf5a78394fb5da2ffa4b0cf6636b707d8</id>
<content type='text'>
The slub code does some setup during early boot in
early_kmem_cache_node_alloc() with some local data.  There is no
possible way that another CPU can see this data, so the slub code
doesn't unnecessarily lock it.  However, some new lockdep asserts
check to make sure that add_partial() _always_ has the list_lock
held.

Just add the locking, even though it is technically unnecessary.

Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: W4TCH0UT &lt;ateekujjawal@gmail.com&gt;
Signed-off-by: Anik1199 &lt;anik9280@gmail.com&gt;

Conflicts:
	mm/slub.c
</content>
</entry>
<entry>
<title>slub: fall back to node_to_mem_node() node if allocating on memoryless node</title>
<updated>2016-09-28T13:14:22+00:00</updated>
<author>
<name>Joonsoo Kim</name>
<email>iamjoonsoo.kim@lge.com</email>
</author>
<published>2014-10-09T22:26:15+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=3e7d45ff47479c508a71989d4573d304da293497'/>
<id>urn:sha1:3e7d45ff47479c508a71989d4573d304da293497</id>
<content type='text'>
Update the SLUB code to search for partial slabs on the nearest node with
memory in the presence of memoryless nodes.  Additionally, do not consider
it to be an ALLOC_NODE_MISMATCH (and deactivate the slab) when a
memoryless-node specified allocation goes off-node.

Signed-off-by: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Signed-off-by: Nishanth Aravamudan &lt;nacc@linux.vnet.ibm.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Han Pingtian &lt;hanpt@linux.vnet.ibm.com&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Anton Blanchard &lt;anton@samba.org&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Wanpeng Li &lt;liwanp@linux.vnet.ibm.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: W4TCH0UT &lt;ateekujjawal@gmail.com&gt;
</content>
</entry>
</feed>
