<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/mm/slub.c, branch linux-3.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-09-26T09:51:56Z</updated>
<entry>
<title>mm: optimize put_mems_allowed() usage</title>
<updated>2014-09-26T09:51:56Z</updated>
<author>
<name>Mel Gorman</name>
</author>
<published>2014-08-28T18:34:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=337c9823cf0b93c8f4d1c4654bd93cf24e5b837b'/>
<id>urn:sha1:337c9823cf0b93c8f4d1c4654bd93cf24e5b837b</id>
<content type='text'>
commit d26914d11751b23ca2e8747725f2cae10c2f2c1b upstream.

Since put_mems_allowed() is strictly optional, its a seqcount retry, we
don't need to evaluate the function if the allocation was in fact
successful, saving a smp_rmb some loads and comparisons on some relative
fast-paths.

Since the naming, get/put_mems_allowed() does suggest a mandatory
pairing, rename the interface, as suggested by Mel, to resemble the
seqcount interface.

This gives us: read_mems_allowed_begin() and read_mems_allowed_retry(),
where it is important to note that the return value of the latter call
is inverted from its previous incarnation.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Mel Gorman &lt;mgorman@suse.de&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: Mel Gorman &lt;mgorman@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>slub: Fix calculation of cpu slabs</title>
<updated>2014-02-13T21:50:13Z</updated>
<author>
<name>Li Zefan</name>
</author>
<published>2013-09-10T03:43:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f350eea0ce901237bf2450ef29ffc7edad461a6d'/>
<id>urn:sha1:f350eea0ce901237bf2450ef29ffc7edad461a6d</id>
<content type='text'>
commit 8afb1474db4701d1ab80cd8251137a3260e6913e upstream.

  /sys/kernel/slab/:t-0000048 # cat cpu_slabs
  231 N0=16 N1=215
  /sys/kernel/slab/:t-0000048 # cat slabs
  145 N0=36 N1=109

See, the number of slabs is smaller than that of cpu slabs.

The bug was introduced by commit 49e2258586b423684f03c278149ab46d8f8b6700
("slub: per cpu cache for partial pages").

We should use page-&gt;pages instead of page-&gt;pobjects when calculating
the number of cpu partial slabs. This also fixes the mapping of slabs
and nodes.

As there's no variable storing the number of total/active objects in
cpu partial slabs, and we don't have user interfaces requiring those
statistics, I just add WARN_ON for those cases.

Acked-by: Christoph Lameter &lt;cl@linux.com&gt;
Reviewed-by: Wanpeng Li &lt;liwanp@linux.vnet.ibm.com&gt;
Signed-off-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>slub: Handle NULL parameter in kmem_cache_flags</title>
<updated>2013-11-29T19:28:09Z</updated>
<author>
<name>Christoph Lameter</name>
</author>
<published>2013-11-07T16:29:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54fc381e213ae04227c038ecab5623959b0f5849'/>
<id>urn:sha1:54fc381e213ae04227c038ecab5623959b0f5849</id>
<content type='text'>
commit c6f58d9b362b45c52afebe4342c9137d0dabe47f upstream.

Andreas Herrmann writes:

  When I've used slub_debug kernel option (e.g.
  "slub_debug=,skbuff_fclone_cache" or similar) on a debug session I've
  seen a panic like:

    Highbank #setenv bootargs console=ttyAMA0 root=/dev/sda2 kgdboc.kgdboc=ttyAMA0,115200 slub_debug=,kmalloc-4096 earlyprintk=ttyAMA0
    ...
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = c0004000
    [00000000] *pgd=00000000
    Internal error: Oops: 5 [#1] SMP ARM
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper Tainted: G        W    3.12.0-00048-gbe408cd #314
    task: c0898360 ti: c088a000 task.ti: c088a000
    PC is at strncmp+0x1c/0x84
    LR is at kmem_cache_flags.isra.46.part.47+0x44/0x60
    pc : [&lt;c02c6da0&gt;]    lr : [&lt;c0110a3c&gt;]    psr: 200001d3
    sp : c088bea8  ip : c088beb8  fp : c088beb4
    r10: 00000000  r9 : 413fc090  r8 : 00000001
    r7 : 00000000  r6 : c2984a08  r5 : c0966e78  r4 : 00000000
    r3 : 0000006b  r2 : 0000000c  r1 : 00000000  r0 : c2984a08
    Flags: nzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
    Control: 10c5387d  Table: 0000404a  DAC: 00000015
    Process swapper (pid: 0, stack limit = 0xc088a248)
    Stack: (0xc088bea8 to 0xc088c000)
    bea0:                   c088bed4 c088beb8 c0110a3c c02c6d90 c0966e78 00000040
    bec0: ef001f00 00000040 c088bf14 c088bed8 c0112070 c0110a04 00000005 c010fac8
    bee0: c088bf5c c088bef0 c010fac8 ef001f00 00000040 00000000 00000040 00000001
    bf00: 413fc090 00000000 c088bf34 c088bf18 c0839190 c0112040 00000000 ef001f00
    bf20: 00000000 00000000 c088bf54 c088bf38 c0839200 c083914c 00000006 c0961c4c
    bf40: c0961c28 00000000 c088bf7c c088bf58 c08392ac c08391c0 c08a2ed8 c0966e78
    bf60: c086b874 c08a3f50 c0961c28 00000001 c088bfb4 c088bf80 c083b258 c0839248
    bf80: 2f800000 0f000000 c08935b4 ffffffff c08cd400 ffffffff c08cd400 c0868408
    bfa0: c29849c0 00000000 c088bff4 c088bfb8 c0824974 c083b1e4 ffffffff ffffffff
    bfc0: c08245c0 00000000 00000000 c0868408 00000000 10c5387d c0892bcc c0868404
    bfe0: c0899440 0000406a 00000000 c088bff8 00008074 c0824824 00000000 00000000
    [&lt;c02c6da0&gt;] (strncmp+0x1c/0x84) from [&lt;c0110a3c&gt;] (kmem_cache_flags.isra.46.part.47+0x44/0x60)
    [&lt;c0110a3c&gt;] (kmem_cache_flags.isra.46.part.47+0x44/0x60) from [&lt;c0112070&gt;] (__kmem_cache_create+0x3c/0x410)
    [&lt;c0112070&gt;] (__kmem_cache_create+0x3c/0x410) from [&lt;c0839190&gt;] (create_boot_cache+0x50/0x74)
    [&lt;c0839190&gt;] (create_boot_cache+0x50/0x74) from [&lt;c0839200&gt;] (create_kmalloc_cache+0x4c/0x88)
    [&lt;c0839200&gt;] (create_kmalloc_cache+0x4c/0x88) from [&lt;c08392ac&gt;] (create_kmalloc_caches+0x70/0x114)
    [&lt;c08392ac&gt;] (create_kmalloc_caches+0x70/0x114) from [&lt;c083b258&gt;] (kmem_cache_init+0x80/0xe0)
    [&lt;c083b258&gt;] (kmem_cache_init+0x80/0xe0) from [&lt;c0824974&gt;] (start_kernel+0x15c/0x318)
    [&lt;c0824974&gt;] (start_kernel+0x15c/0x318) from [&lt;00008074&gt;] (0x8074)
    Code: e3520000 01a00002 089da800 e5d03000 (e5d1c000)
    ---[ end trace 1b75b31a2719ed1d ]---
    Kernel panic - not syncing: Fatal exception

  Problem is that slub_debug option is not parsed before
  create_boot_cache is called. Solve this by changing slub_debug to
  early_param.

  Kernels 3.11, 3.10 are also affected.  I am not sure about older
  kernels.

Christoph Lameter explains:

  kmem_cache_flags may be called with NULL parameter during early boot.
  Skip the test in that case.

Reported-by: Andreas Herrmann &lt;andreas.herrmann@calxeda.com&gt;
Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branch 'slab/next' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux</title>
<updated>2013-09-15T11:15:06Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2013-09-15T11:15:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bff157b3ad4b9f6be0af6987fcd62deaf0f2b799'/>
<id>urn:sha1:bff157b3ad4b9f6be0af6987fcd62deaf0f2b799</id>
<content type='text'>
Pull SLAB update from Pekka Enberg:
 "Nothing terribly exciting here apart from Christoph's kmalloc
  unification patches that brings sl[aou]b implementations closer to
  each other"

* 'slab/next' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
  slab: Use correct GFP_DMA constant
  slub: remove verify_mem_not_deleted()
  mm/sl[aou]b: Move kmallocXXX functions to common code
  mm, slab_common: add 'unlikely' to size check of kmalloc_slab()
  mm/slub.c: beautify code for removing redundancy 'break' statement.
  slub: Remove unnecessary page NULL check
  slub: don't use cpu partial pages on UP
  mm/slub: beautify code for 80 column limitation and tab alignment
  mm/slub: remove 'per_cpu' which is useless variable
</content>
</entry>
<entry>
<title>mm: replace strict_strtoul() with kstrtoul()</title>
<updated>2013-09-11T22:57:11Z</updated>
<author>
<name>Jingoo Han</name>
</author>
<published>2013-09-11T21:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3dbb95f7895e378514ffefa93cc887fb1bc9df94'/>
<id>urn:sha1:3dbb95f7895e378514ffefa93cc887fb1bc9df94</id>
<content type='text'>
The use of strict_strtoul() is not preferred, because strict_strtoul() is
obsolete.  Thus, kstrtoul() should be used.

Signed-off-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>slub: remove verify_mem_not_deleted()</title>
<updated>2013-09-04T17:53:16Z</updated>
<author>
<name>Christoph Lameter</name>
</author>
<published>2013-09-04T16:35:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76b6f3d255a327383c89cb8c8384872dd4a0a054'/>
<id>urn:sha1:76b6f3d255a327383c89cb8c8384872dd4a0a054</id>
<content type='text'>
I do not see any user for this code in the tree.

Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
</content>
</entry>
<entry>
<title>mm/sl[aou]b: Move kmallocXXX functions to common code</title>
<updated>2013-09-04T17:51:33Z</updated>
<author>
<name>Christoph Lameter</name>
</author>
<published>2013-09-04T16:35:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1b6eb6e6be149b40ebb013f5bfe2ac86b6f1c1b'/>
<id>urn:sha1:f1b6eb6e6be149b40ebb013f5bfe2ac86b6f1c1b</id>
<content type='text'>
The kmalloc* functions of all slab allcoators are similar now so
lets move them into slab.h. This requires some function naming changes
in slob.

As a results of this patch there is a common set of functions for
all allocators. Also means that kmalloc_large() is now available
in general to perform large order allocations that go directly
via the page allocator. kmalloc_large() can be substituted if
kmalloc() throws warnings because of too large allocations.

kmalloc_large() has exactly the same semantics as kmalloc but
can only used for allocations &gt; PAGE_SIZE.

Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
</content>
</entry>
<entry>
<title>mm/slub.c: beautify code for removing redundancy 'break' statement.</title>
<updated>2013-08-13T06:21:46Z</updated>
<author>
<name>Chen Gang</name>
</author>
<published>2013-07-15T01:06:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=68f06650ea63f38e1cca7b5bbd56a9c1b8ac5209'/>
<id>urn:sha1:68f06650ea63f38e1cca7b5bbd56a9c1b8ac5209</id>
<content type='text'>
Remove redundancy 'break' statement.

Acked-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
</content>
</entry>
<entry>
<title>slub: Remove unnecessary page NULL check</title>
<updated>2013-08-13T06:21:46Z</updated>
<author>
<name>Libin</name>
</author>
<published>2013-07-18T07:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac6434e6b804845290e4de06210fe110674140e6'/>
<id>urn:sha1:ac6434e6b804845290e4de06210fe110674140e6</id>
<content type='text'>
In commit 4d7868e6(slub: Do not dereference NULL pointer in node_match)
had added check for page NULL in node_match.  Thus, it is not needed
to check it before node_match, remove it.

Acked-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Libin &lt;huawei.libin@huawei.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "slub: do not put a slab to cpu partial list when cpu_partial is 0"</title>
<updated>2013-08-08T16:06:37Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2013-08-08T16:06:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=370905069ce6515f38d5de0a5b1c899cbe58fe22'/>
<id>urn:sha1:370905069ce6515f38d5de0a5b1c899cbe58fe22</id>
<content type='text'>
This reverts commit 318df36e57c0ca9f2146660d41ff28e8650af423.

This commit caused Steven Rostedt's hackbench runs to run out of memory
due to a leak.  As noted by Joonsoo Kim, it is buggy in the following
scenario:

 "I guess, you may set 0 to all kmem caches's cpu_partial via sysfs,
  doesn't it?

  In this case, memory leak is possible in following case.  Code flow of
  possible leak is follwing case.

   * in __slab_free()
   1. (!new.inuse || !prior) &amp;&amp; !was_frozen
   2. !kmem_cache_debug &amp;&amp; !prior
   3. new.frozen = 1
   4. after cmpxchg_double_slab, run the (!n) case with new.frozen=1
   5. with this patch, put_cpu_partial() doesn't do anything,
      because this cache's cpu_partial is 0
   6. return

  In step 5, leak occur"

And Steven does indeed have cpu_partial set to 0 due to RT testing.

Joonsoo is cooking up a patch, but everybody agrees that reverting this
for now is the right thing to do.

Reported-and-bisected-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Acked-by: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Acked-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
