<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.kernel.mm">
    <title>gmane.linux.kernel.mm</title>
    <link>http://blog.gmane.org/gmane.linux.kernel.mm</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/79053"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/79045"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78953"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78950"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78928"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78911"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78891"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78877"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78876"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78875"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78874"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78873"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78872"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78865"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78860"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78837"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78819"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78812"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78782"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.mm/78770"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/79053">
    <title>[PATCH] mm/numa: Fix kernel crash caused by offline node</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/79053</link>
    <description>&lt;pre&gt;I tried to boot the updated kernel (3.4.0+) on IBM power machine.
Unfortunately, I got kernel crash as follows. Then I traced it
down until I found sched/core.c::sched_init_numa tried to allocate
memory from the possible nodes. That doesn't make sense since the
possible nodes might never come in for ever.

Linux version 3.4.0+ (shangw&amp;lt; at &amp;gt;shangw) (gcc version 4.4.5 (crosstool-NG 1.13.0) ) #154 SMP Sat May 26 15:33:20 CST 2012
:
Unable to handle kernel paging request for data at address 0x00001388
Faulting instruction address: 0xc00000000017d44c
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=1024 NUMA PowerNV
Modules linked in:
NIP: c00000000017d44c LR: c00000000017d448 CTR: 000000002f805eb0
REGS: c0000007f22836d0 TRAP: 0300   Not tainted  (3.4.0+)
MSR: 9000000000009032 &amp;lt;SF,HV,EE,ME,IR,DR,RI&amp;gt;  CR: 28004082  XER: 00000000
SOFTE: 1
CFAR: c000000000005100
DAR: 0000000000001388, DSISR: 40000000
TASK = c0000007f21c0000[1] 'swapper/0' THREAD: c0000007f2280000 CPU: 0
GPR00: c00000000017d448 c0000007f2283950 c0000000014fa7a0 0000000000000000
GPR04: 0000000000000000 0000000000001380 0000000000000000 0000000000000003
GPR08: 0000000000000010 0000000000000000 000000000001c0bb 0000000000000000
GPR12: 0000000028004088 c00000000ff20000 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000042abf9f0 0000000000001380 0000000000000000
GPR20: 0000000000d6da70 0000000000000001 c0000007f2283c10 0000000000210d00
GPR24: 0000000000000001 0000000000000001 0000000000000000 0000000000000000
GPR28: 0000000000001380 0000000000000000 c0000000014228e8 00000000000012d0
NIP [c00000000017d44c] .__alloc_pages_nodemask+0xf4/0x88c
LR [c00000000017d448] .__alloc_pages_nodemask+0xf0/0x88c
Call Trace:
[c0000007f2283950] [c00000000017d448] .__alloc_pages_nodemask+0xf0/0x88c (unreliable)
[c0000007f2283af0] [c0000000001ce9dc] .new_slab+0x15c/0x438
[c0000007f2283ba0] [c0000000001cf220] .__slab_alloc+0x3a4/0x510
[c0000007f2283cd0] [c0000000001d0cbc] .kmem_cache_alloc_node_trace+0xbc/0x214
[c0000007f2283d90] [c000000000bf8c00] .sched_init_smp+0x1a8/0x4d4
[c0000007f2283ed0] [c000000000be0384] .kernel_init+0x154/0x2f8
[c0000007f2283f90] [c000000000021478] .kernel_thread+0x54/0x70
Instruction dump:
7bfa6fe2 78000fa4 7f5a0378 e93e8000 80090000 7c1ff838 7bff0020 57e806f7
f90100c8 4182000c 486e6539 60000000 &amp;lt;e81c0008&amp;gt; 3a000000 2fa00000 41de0728

The patch fixes it by allocating memory without node sense. It
should have some performance impact but I'm not sure how much
that will be.

Signed-off-by: Gavin Shan &amp;lt;shangw&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;
---
 kernel/sched/core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a5a9d39..62bd092 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -6406,7 +6406,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void sched_init_numa(void)
 return;
 
 for (j = 0; j &amp;lt; nr_node_ids; j++) {
-struct cpumask *mask = kzalloc_node(cpumask_size(), GFP_KERNEL, j);
+struct cpumask *mask = kzalloc(cpumask_size(), GFP_KERNEL);
+
 if (!mask)
 return;
 
&lt;/pre&gt;</description>
    <dc:creator>Gavin Shan</dc:creator>
    <dc:date>2012-05-26T08:03:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/79045">
    <title>[PATCH 00/35] AutoNUMA alpha14</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/79045</link>
    <description>&lt;pre&gt;Hello everyone,

It's time for a new autonuma-alpha14 milestone.

Removed the [RFC] from Subject because 1) this is a release I'm quite
happy with (from the implementation side it allows the same kernel
image to boot optimally on NUMA and not-NUMA hardware and it avoids
altering the scheduler runtime most of the time) and 2) because of the
great benchmark results we got so far, showing this design so far has
been proved to perform best.

I believe (realistically speaking) nobody is going to change
applications to specify which thread is using which memory (for
threaded apps) with the only exception of QEMU and a few others.

For not threaded apps that fits in a NUMA node, there's no way a blind
home node can perform nearly as good as AutoNUMA: AutoNUMA monitor the
whole status of the memory of the running processes and it optimizes
the memory placement and CPU placement dynamically
accordingly. There's a small memory and CPU cost in collecting so much
information to be able to make smart decisions, but the benefits
largely outweight those costs.

If a big idle task was idle for a long while, but it suddenly start
computing, AutoNUMA may totally change the memory and CPU placement of
the other running tasks according to what's best, because it has
enough information to take optimal NUMA placement decisions.

git clone --reference linux -b autonuma-alpha14 git://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git autonuma-alpha14

Development autonuma branch (currently equal to autonuma-alpha14 ==
a49fedcc284a8e8b47175fbc23e9d3b075884e53):

git clone --reference linux -b autonuma git://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git
to update: git fetch; git checkout -f origin/autonuma

Changelog from alpha13 to alpha14:

o page_autonuma introduction, no memory wasted if the kernel is booted
  on not-NUMA hardware. Tested with flatmem/sparsemem on x86
  autonuma=y/n and sparsemem/vsparsemem on x86_64 with autonuma=y/n.

  The "noautonuma" kernel param disables autonuma permanently also
  when booted on NUMA hardware (no /sys/kernel/mm/autonuma, and no
  page_autonuma allocations, like cgroup_disable=memory)

o autonuma_balance only runs along with run_rebalance_domains, to
  avoid altering the scheduler runtime. autonuma_balance gives a
  "kick" to the scheduler only along the load balance events (it
  overrides the load balance activity if needed). This change has not
  yet been tested on specjbb or more schedule intensive benchmarks,
  but I don't expect measurable NUMA affinity regressions. For
  intensive compute loads not involving a flood of scheduling activity
  this has already been verified not to show any performance
  regression, and it will boost the scheduler performance compared to
  previous autonuma releases.

  Note: autonuma_balance still runs from normal context (not softirq
  context like run_rebalance_domains) to be able to wait on process
  migration (avoid _nowait), but most of the time it does nothing at
  all.

Changelog from alpha11 to alpha13:

o autonuma_balance optimization (take the fast path when process is in
  the preferred NUMA node)

TODO:

o THP native migration (orthogonal and also needed for
  cpuset/migrate_pages(2)/numa/sched).

o distribute pagecache to other nodes (and maybe shared memory or
  other movable memory) if knuma_migrated stops because the local node
  is full

Andrea Arcangeli (35):
  mm: add unlikely to the mm allocation failure check
  autonuma: make set_pmd_at always available
  xen: document Xen is using an unused bit for the pagetables
  autonuma: define _PAGE_NUMA_PTE and _PAGE_NUMA_PMD
  autonuma: x86 pte_numa() and pmd_numa()
  autonuma: generic pte_numa() and pmd_numa()
  autonuma: teach gup_fast about pte_numa
  autonuma: introduce kthread_bind_node()
  autonuma: mm_autonuma and sched_autonuma data structures
  autonuma: define the autonuma flags
  autonuma: core autonuma.h header
  autonuma: CPU follow memory algorithm
  autonuma: add page structure fields
  autonuma: knuma_migrated per NUMA node queues
  autonuma: init knuma_migrated queues
  autonuma: autonuma_enter/exit
  autonuma: call autonuma_setup_new_exec()
  autonuma: alloc/free/init sched_autonuma
  autonuma: alloc/free/init mm_autonuma
  autonuma: avoid CFS select_task_rq_fair to return -1
  autonuma: teach CFS about autonuma affinity
  autonuma: sched_set_autonuma_need_balance
  autonuma: core
  autonuma: follow_page check for pte_numa/pmd_numa
  autonuma: default mempolicy follow AutoNUMA
  autonuma: call autonuma_split_huge_page()
  autonuma: make khugepaged pte_numa aware
  autonuma: retain page last_nid information in khugepaged
  autonuma: numa hinting page faults entry points
  autonuma: reset autonuma page data when pages are freed
  autonuma: initialize page structure fields
  autonuma: link mm/autonuma.o and kernel/sched/numa.o
  autonuma: add CONFIG_AUTONUMA and CONFIG_AUTONUMA_DEFAULT_ENABLED
  autonuma: boost khugepaged scanning rate
  autonuma: page_autonuma

 arch/x86/include/asm/paravirt.h      |    2 -
 arch/x86/include/asm/pgtable.h       |   51 ++-
 arch/x86/include/asm/pgtable_types.h |   22 +-
 arch/x86/mm/gup.c                    |    2 +-
 fs/exec.c                            |    3 +
 include/asm-generic/pgtable.h        |   12 +
 include/linux/autonuma.h             |   53 ++
 include/linux/autonuma_flags.h       |   68 ++
 include/linux/autonuma_sched.h       |   50 ++
 include/linux/autonuma_types.h       |   88 ++
 include/linux/huge_mm.h              |    2 +
 include/linux/kthread.h              |    1 +
 include/linux/mm_types.h             |    5 +
 include/linux/mmzone.h               |   18 +
 include/linux/page_autonuma.h        |   53 ++
 include/linux/sched.h                |    3 +
 init/main.c                          |    2 +
 kernel/fork.c                        |   36 +-
 kernel/kthread.c                     |   23 +
 kernel/sched/Makefile                |    1 +
 kernel/sched/core.c                  |   12 +-
 kernel/sched/fair.c                  |   72 ++-
 kernel/sched/numa.c                  |  281 +++++++
 kernel/sched/sched.h                 |   10 +
 mm/Kconfig                           |   13 +
 mm/Makefile                          |    1 +
 mm/autonuma.c                        | 1464 ++++++++++++++++++++++++++++++++++
 mm/huge_memory.c                     |   58 ++-
 mm/memory.c                          |   36 +-
 mm/mempolicy.c                       |   15 +-
 mm/mmu_context.c                     |    2 +
 mm/page_alloc.c                      |    6 +-
 mm/page_autonuma.c                   |  234 ++++++
 mm/sparse.c                          |  126 +++-
 34 files changed, 2776 insertions(+), 49 deletions(-)
 create mode 100644 include/linux/autonuma.h
 create mode 100644 include/linux/autonuma_flags.h
 create mode 100644 include/linux/autonuma_sched.h
 create mode 100644 include/linux/autonuma_types.h
 create mode 100644 include/linux/page_autonuma.h
 create mode 100644 kernel/sched/numa.c
 create mode 100644 mm/autonuma.c
 create mode 100644 mm/page_autonuma.c

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Andrea Arcangeli</dc:creator>
    <dc:date>2012-05-25T17:02:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78953">
    <title>[PATCH 0/2 v4] Flexible proportions</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78953</link>
    <description>&lt;pre&gt;
  Hello,

  here is the next iteration of my flexible proportions code. I've addressed
all Peter's comments.
Changes since v3:
  * changed fprop_fraction_foo() to avoid using percpu_counter_sum()
  * changed __fprop_inc_percpu_max() to avoid 64-bit division (now maximum
    allowed fraction is expressed max_frac/FPROP_FRAC_BASE)
  * avoid drifting of period timer
  * handle better cases where period timer fires long after intended time by
    aging by really passed number of periods
Changes since v2:
  * use timer instead of workqueue for triggering period switch
  * arm timer only if aging didn't zero out all fractions, re-arm timer when
    new event arrives again
  * set period length to 3s

  Some introduction for first time readers:

  The idea of this patch set is to provide code for computing event proportions
where aging period is not dependent on the number of events happening (so
that aging works well both with fast storage and slow USB sticks in the same
system).

  The basic idea is that we compute proportions as:
p_j = (\Sum_{i&amp;gt;=0} x_{i,j}/2^{i+1}) / (\Sum_{i&amp;gt;=0} x_i/2^{i+1})

  Where x_{i,j} is j's number of events in i-th last time period and x_i is
total number of events in i-th last time period.

  Note that when x_i's are all the same (as is the case with current
proportion code), this expression simplifies to the expression defining
current proportions which is:
p_j =  \Sum_{i&amp;gt;=0} x_{i,j}/2^{i+1} / t

  where t is the lenght of the aging period.

  In fact, if we are in the middle of the period, the proportion computed by
the current code is:
p_j = (x_0 + \Sum_{i&amp;gt;=1} x_{i,j}/2^{i+1}) / (t' + t)

  where t' is total number of events in the running period and t is the lenght
of the aging period. So there is event more similarity.

  Similarly as with current proportion code, it is simple to compute update
proportion after several periods have elapsed. For each proportion we store
the numerator of our fraction and the number of period when the proportion
was last updated. In global proportion structure we compute the denominator
of the fraction which is the same for all event types. So catch up with missed
periods boils down to shifting the numerator by the number of missed periods
and that's it. For more details, please see the code.

  I've also run a few tests (I've created a userspace wrapper to allow me to
run proportion code in userpace and arbitrarily generate events for it) to
compare the behavior of old and new code. You can see them at
http://beta.suse.com/private/jack/flex_proportions/ In all the tests new code
showed faster convergence to current event proportions (I tried to
realistically set period_shift for fixed proportions).  Also in the last test
we see that if period_shift is decreased, then current proportions become more
sensitive to short term fluctuations in event rate so just decreasing
period_shift isn't a good solution to slower convergence. If anyone has other
idea what to try, I can do that - it should be simple enough to implement in
my testing tool.

Honza

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Jan Kara</dc:creator>
    <dc:date>2012-05-24T16:59:09</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78950">
    <title>the max size of block device on 32bit os,when using do_generic_file_read() proceed.</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78950</link>
    <description>&lt;pre&gt;  Hi all:
I readed a raid5,which size 30T.OS is RHEL6 32bit.
    I reaed the raid5(as a whole,not parted) and found read address which not i wanted.
So I tested the newest kernel code,the problem is still.
I review the code, in function do_generic_file_read()

index = *ppos &amp;gt;&amp;gt; PAGE_CACHE_SHIFT;
index is u32.and *ppos is long long.
So when *ppos is larger than 0xFFFF FFFF *  PAGE_CACHE_SHIFT(16T Byte),then the index is error.

I wonder this .In 32bit os ,block devices size do not large then 16T,in other words, if block devices larger than 16T,must parted.

Thanks all.
 
--------------
majianpeng
2012-05-24

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>majianpeng</dc:creator>
    <dc:date>2012-05-24T13:38:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78928">
    <title>[PATCH RESEND] avoid swapping out with swappiness==0</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78928</link>
    <description>&lt;pre&gt;Hi Andrew,

This patch has been reviewed for couple of months.

This patch *only* improves the behavior when the kernel has
enough filebacked pages. It means that it does not change
the behavior when kernel has small number of filebacked pages.

Kosaki-san pointed out that the threshold which we use
to decide whether filebacked page is enough or not is not
appropriate(*).

(*) http://www.spinics.net/lists/linux-mm/msg32380.html

As I described in (**), I believe that threshold discussion
should be done in other thread because it affects not only
swappiness=0 case and the kernel behave the same way with
or without this patch below the threshold.

(**) http://www.spinics.net/lists/linux-mm/msg34317.html

The patch may not be perfect but, at least, we can improve
the kernel behavior in the enough filebacked memory case
with this patch. I believe it's better than nothing.

Do you have any comments about it?

NOTE: I updated the patch with Acked-by tags

---
Sometimes we'd like to avoid swapping out anonymous memory
in particular, avoid swapping out pages of important process or
process groups while there is a reasonable amount of pagecache
on RAM so that we can satisfy our customers' requirements.

OTOH, we can control how aggressive the kernel will swap memory pages
with /proc/sys/vm/swappiness for global and
/sys/fs/cgroup/memory/memory.swappiness for each memcg.

But with current reclaim implementation, the kernel may swap out
even if we set swappiness==0 and there is pagecache on RAM.

This patch changes the behavior with swappiness==0. If we set
swappiness==0, the kernel does not swap out completely
(for global reclaim until the amount of free pages and filebacked
pages in a zone has been reduced to something very very small
(nr_free + nr_filebacked &amp;lt; high watermark)).

Any comments are welcome.

Regards,
Satoru Moriya

Signed-off-by: Satoru Moriya &amp;lt;satoru.moriya&amp;lt; at &amp;gt;hds.com&amp;gt;
Acked-by: Minchan Kim &amp;lt;minchan&amp;lt; at &amp;gt;kernel.org&amp;gt;
Acked-by: Rik van Riel &amp;lt;riel&amp;lt; at &amp;gt;redhat.com&amp;gt;

---
 mm/vmscan.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 33dc256..52d64bf 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1983,10 +1983,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void get_scan_count(struct mem_cgroup_zone *mz, struct scan_control *sc,
  * proportional to the fraction of recently scanned pages on
  * each list that were recently referenced and in active use.
  */
-ap = (anon_prio + 1) * (reclaim_stat-&amp;gt;recent_scanned[0] + 1);
+ap = anon_prio * (reclaim_stat-&amp;gt;recent_scanned[0] + 1);
 ap /= reclaim_stat-&amp;gt;recent_rotated[0] + 1;
 
-fp = (file_prio + 1) * (reclaim_stat-&amp;gt;recent_scanned[1] + 1);
+fp = file_prio * (reclaim_stat-&amp;gt;recent_scanned[1] + 1);
 fp /= reclaim_stat-&amp;gt;recent_rotated[1] + 1;
 spin_unlock_irq(&amp;amp;mz-&amp;gt;zone-&amp;gt;lru_lock);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1999,7 +1999,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; out:
 unsigned long scan;
 
 scan = zone_nr_lru_pages(mz, lru);
-if (priority || noswap) {
+if (priority || noswap || !vmscan_swappiness(mz, sc)) {
 scan &amp;gt;&amp;gt;= priority;
 if (!scan &amp;amp;&amp;amp; force_scan)
 scan = SWAP_CLUSTER_MAX;
--
1.7.6.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Satoru Moriya</dc:creator>
    <dc:date>2012-05-23T20:41:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78911">
    <title>Common 00/22] Sl[auo]b: Common functionality V3</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78911</link>
    <description>&lt;pre&gt;V2-&amp;gt;V3:
- Incorporate more feedback from Joonsoo Kim and Glauber Costa
- And a couple more patches to deal with slab duping and move
  more code to slab_common.c

V1-&amp;gt;V2:
- Incorporate glommers feedback.
- Add 2 more patches dealing with common code in kmem_cache_destroy

This is a series of patches that extracts common functionality from
slab allocators into a common code base. The intend is to standardize
as much as possible of the allocator behavior while keeping the
distinctive features of each allocator which are mostly due to their
storage format and serialization approaches.

This patchset makes a beginning by extracting common functionality in
kmem_cache_create() and kmem_cache_destroy(). However, there are
numerous other areas where such work could be beneficial:

1. Extract the sysfs support from SLUB and make it common. That way
   all allocators have a common sysfs API and are handleable in the same
   way regardless of the allocator chose.

2. Extract the error reporting and checking from SLUB and make
   it available for all allocators. This means that all allocators
   will gain the resiliency and error handling capabilties.

3. Extract the memory hotplug and cpu hotplug handling. It seems that
   SLAB may be more sophisticated here. Having common code here will
   make it easier to maintain the special code.

4. Extract the aliasing capability of SLUB. This will enable fast
   slab creation without creating too many additional slab caches.
   The arrays of caches of varying sizes in numerous subsystems
   do not cause the creation of numerous slab caches. Storage
   density is increased and the cache footprint is reduced.

Ultimately it is to be hoped that the special code for each allocator
shrinks to a mininum. This will also make it easier to make modification
to allocators.

In the far future one could envision that the current allocators will
just become storage algorithms that can be chosen based on the need of
the subsystem. F.e.

Cpu cache dependend performance= Bonwick allocator (SLAB)
Minimal cycle count and cache footprint= SLUB
Maximum storage density= K&amp;amp;R allocator (SLOB)


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Christoph Lameter</dc:creator>
    <dc:date>2012-05-23T20:34:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78891">
    <title>[PATCH] tmpfs not interleaving properly</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78891</link>
    <description>&lt;pre&gt;
When tmpfs has the memory policy interleaved it always starts allocating at each file at node 0.
When there are many small files the lower nodes fill up disproportionately.
My proposed solution is to start a file at a randomly chosen node.

Cc: Christoph Lameter &amp;lt;cl&amp;lt; at &amp;gt;linux.com&amp;gt;
Cc: Nick Piggin &amp;lt;npiggin&amp;lt; at &amp;gt;gmail.com&amp;gt;
Cc: Hugh Dickins &amp;lt;hughd&amp;lt; at &amp;gt;google.com&amp;gt;
Cc: Lee Schermerhorn &amp;lt;lee.schermerhorn&amp;lt; at &amp;gt;hp.com&amp;gt;
Cc: stable&amp;lt; at &amp;gt;vger.kernel.org
Signed-off-by: Nathan T Zimmer &amp;lt;nzimmer&amp;lt; at &amp;gt;sgi.com&amp;gt;


diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 79ab255..38eda26 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -17,6 +17,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct shmem_inode_info {
 char*symlink;/* unswappable short symlink */
 };
 struct shared_policypolicy;/* NUMA memory alloc policy */
+intnode_offset;/* bias for interleaved nodes */
 struct list_headswaplist;/* chain of maybes on swap */
 struct list_headxattr_list;/* list of shmem_xattr */
 struct inodevfs_inode;
diff --git a/mm/shmem.c b/mm/shmem.c
index f99ff3e..58ef512 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -819,7 +819,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct page *shmem_alloc_page(gfp_t gfp,
 
 /* Create a pseudo vma that just contains the policy */
 pvma.vm_start = 0;
-pvma.vm_pgoff = index;
+pvma.vm_pgoff = index + info-&amp;gt;node_offset;
 pvma.vm_ops = NULL;
 pvma.vm_policy = mpol_shared_policy_lookup(&amp;amp;info-&amp;gt;policy, index);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1153,6 +1153,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
 inode-&amp;gt;i_fop = &amp;amp;shmem_file_operations;
 mpol_shared_policy_init(&amp;amp;info-&amp;gt;policy,
  shmem_get_sbmpol(sbinfo));
+info-&amp;gt;node_offset = node_random(&amp;amp;node_online_map);
 break;
 case S_IFDIR:
 inc_nlink(inode);


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Nathan Zimmer</dc:creator>
    <dc:date>2012-05-23T13:28:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78877">
    <title>[PATCH 2/2] vmevent: pass right attribute to vmevent_sample_attr()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78877</link>
    <description>&lt;pre&gt;From: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Subject: [PATCH] vmevent: pass right attribute to vmevent_sample_attr()

Pass "config attribute" (&amp;amp;watch-&amp;gt;config-&amp;gt;attrs[i]) not "sample
attribute" (&amp;amp;watch-&amp;gt;sample_attrs[i]) to vmevent_sample_attr() to
allow use of the original attribute value in vmevent_attr_sample_fn().

Cc: Anton Vorontsov &amp;lt;anton.vorontsov&amp;lt; at &amp;gt;linaro.org&amp;gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Signed-off-by: Kyungmin Park &amp;lt;kyungmin.park&amp;lt; at &amp;gt;samsung.com&amp;gt;
---
Without this patch vmevent_attr_lowmem_pages() always returns 0.

 mm/vmevent.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: b/mm/vmevent.c
===================================================================
--- a/mm/vmevent.c2012-05-22 17:55:02.000000000 +0200
+++ b/mm/vmevent.c2012-05-22 18:10:40.075231798 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -31,6 +31,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  */
 unsigned longnr_attrs;
 struct vmevent_attr*sample_attrs;
+struct vmevent_attr*config_attrs[VMEVENT_CONFIG_MAX_ATTRS];
 
 /* sampling */
 struct timer_listtimer;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -104,6 +105,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  */
 if (free &amp;lt; val &amp;amp;&amp;amp; file &amp;lt; val)
 return val;
+
 return 0;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -210,7 +212,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 for (i = 0; i &amp;lt; watch-&amp;gt;nr_attrs; i++) {
 struct vmevent_attr *attr = &amp;amp;watch-&amp;gt;sample_attrs[i];
 
-attr-&amp;gt;value = vmevent_sample_attr(watch, attr);
+attr-&amp;gt;value = vmevent_sample_attr(watch,
+  watch-&amp;gt;config_attrs[i]);
 }
 
 atomic_set(&amp;amp;watch-&amp;gt;pending, 1);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -353,6 +356,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 attrs[nr].type = attr-&amp;gt;type;
 attrs[nr].value = 0;
 attrs[nr].state = 0;
+
+watch-&amp;gt;config_attrs[nr] = attr;
+
 nr++;
 }
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Bartlomiej Zolnierkiewicz</dc:creator>
    <dc:date>2012-05-23T07:28:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78876">
    <title>[PATCH] vmevent: add arm support</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78876</link>
    <description>&lt;pre&gt;From: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Subject: [PATCH] vmevent: add arm support

Tested on ARM EXYNOS4210 (Universal C210 board).

Cc: Anton Vorontsov &amp;lt;anton.vorontsov&amp;lt; at &amp;gt;linaro.org&amp;gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Signed-off-by: Kyungmin Park &amp;lt;kyungmin.park&amp;lt; at &amp;gt;samsung.com&amp;gt;
---
 arch/arm/include/asm/unistd.h        |    1 +
 arch/arm/kernel/calls.S              |    1 +
 tools/testing/vmevent/vmevent-test.c |    3 +++
 3 files changed, 5 insertions(+)

Index: b/arch/arm/include/asm/unistd.h
===================================================================
--- a/arch/arm/include/asm/unistd.h2012-05-22 15:17:15.590826904 +0200
+++ b/arch/arm/include/asm/unistd.h2012-05-22 15:17:43.990826872 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -404,6 +404,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #define __NR_setns(__NR_SYSCALL_BASE+375)
 #define __NR_process_vm_readv(__NR_SYSCALL_BASE+376)
 #define __NR_process_vm_writev(__NR_SYSCALL_BASE+377)
+#define __NR_vmevent_fd(__NR_SYSCALL_BASE+378)
 
 /*
  * The following SWIs are ARM private.
Index: b/arch/arm/kernel/calls.S
===================================================================
--- a/arch/arm/kernel/calls.S2012-05-22 15:16:31.646826898 +0200
+++ b/arch/arm/kernel/calls.S2012-05-22 15:17:02.850825441 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -387,6 +387,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 /* 375 */CALL(sys_setns)
 CALL(sys_process_vm_readv)
 CALL(sys_process_vm_writev)
+CALL(sys_vmevent_fd)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) &amp;amp; ~3) - NR_syscalls
 #define syscalls_counted
Index: b/tools/testing/vmevent/vmevent-test.c
===================================================================
--- a/tools/testing/vmevent/vmevent-test.c2012-05-22 15:18:46.702826642 +0200
+++ b/tools/testing/vmevent/vmevent-test.c2012-05-22 15:19:21.302826872 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3,6 +3,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #if defined(__x86_64__)
 #include "../../../arch/x86/include/generated/asm/unistd_64.h"
 #endif
+#if defined(__arm__)
+#include "../../../arch/arm/include/asm/unistd.h"
+#endif
 
 #include &amp;lt;stdint.h&amp;gt;
 #include &amp;lt;stdlib.h&amp;gt;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Bartlomiej Zolnierkiewicz</dc:creator>
    <dc:date>2012-05-23T07:27:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78875">
    <title>[PATCH 1/2] vmevent: don't leak unitialized data to userspace</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78875</link>
    <description>&lt;pre&gt;From: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Subject: [PATCH] vmevent: don't leak unitialized data to userspace

Remember to initialize all attrs[nr] fields in vmevent_setup_watch().

Cc: Anton Vorontsov &amp;lt;anton.vorontsov&amp;lt; at &amp;gt;linaro.org&amp;gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Signed-off-by: Kyungmin Park &amp;lt;kyungmin.park&amp;lt; at &amp;gt;samsung.com&amp;gt;
---
 mm/vmevent.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: b/mm/vmevent.c
===================================================================
--- a/mm/vmevent.c2012-05-22 17:51:13.195231958 +0200
+++ b/mm/vmevent.c2012-05-22 17:51:40.991231956 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -350,7 +350,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 attrs = new;
 
-attrs[nr++].type = attr-&amp;gt;type;
+attrs[nr].type = attr-&amp;gt;type;
+attrs[nr].value = 0;
+attrs[nr].state = 0;
+nr++;
 }
 
 watch-&amp;gt;sample_attrs= attrs;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Bartlomiej Zolnierkiewicz</dc:creator>
    <dc:date>2012-05-23T07:27:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78874">
    <title>[PATCH] cma: cached pageblock type fixup</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78874</link>
    <description>&lt;pre&gt;From: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Subject: [PATCH] cma: cached pageblock type fixup

CMA pages added to per-cpu pages lists in free_hot_cold_page()
have private field set to MIGRATE_CMA pageblock type .  If this
happes just before start_isolate_page_range() in alloc_contig_range()
changes pageblock type of the page to MIGRATE_ISOLATE it may result
in the cached pageblock type being stale in free_pcppages_bulk()
(which may be triggered by drain_all_pages() in alloc_contig_range()),
page being added to MIGRATE_CMA free list instead of MIGRATE_ISOLATE
one in __free_one_page() and (if the page is reused just before
test_pages_isolated() check) causing alloc_contig_range() failure.

Fix such situation by checking whether pageblock type of the page
changed to MIGRATE_ISOLATE for MIGRATE_CMA type pages in
free_pcppages_bulk() and if so fixup the pageblock type to
MIGRATE_ISOLATE (so the page will be added to MIGRATE_ISOLATE free
list in __free_one_page() and won't be used).

Similar situation can happen if rmqueue_bulk() sets cached pageblock
of the page to MIGRATE_CMA and start_isolate_page_range() is called
before buffered_rmqueue() completes (so the page may used by
get_page_from_freelist() and cause test_pages_isolated() check
failure in alloc_contig_range()).  Fix it in buffered_rmqueue() by
changing the pageblock type of the affected page if needed, freeing
page back to buddy allocator and retrying the allocation.

Please note that even with this patch applied some page allocation
vs alloc_contig_range() races are still possible and may result in
rare test_pages_isolated() failures.

Cc: Michal Nazarewicz &amp;lt;mina86&amp;lt; at &amp;gt;mina86.com&amp;gt;
Cc: Marek Szyprowski &amp;lt;m.szyprowski&amp;lt; at &amp;gt;samsung.com&amp;gt;
Cc: Mel Gorman &amp;lt;mgorman&amp;lt; at &amp;gt;suse.de&amp;gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Signed-off-by: Kyungmin Park &amp;lt;kyungmin.park&amp;lt; at &amp;gt;samsung.com&amp;gt;
---
 mm/page_alloc.c |   38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

Index: b/mm/page_alloc.c
===================================================================
--- a/mm/page_alloc.c2012-05-14 16:19:10.052973990 +0200
+++ b/mm/page_alloc.c2012-05-15 12:40:54.199127705 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -664,12 +664,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 batch_free = to_free;
 
 do {
+int mt;
+
 page = list_entry(list-&amp;gt;prev, struct page, lru);
 /* must delete as __free_one_page list manipulates */
 list_del(&amp;amp;page-&amp;gt;lru);
+
+mt = page_private(page);
+/*
+ * cached MIGRATE_CMA pageblock type may have changed
+ * during isolation
+ */
+if (is_migrate_cma(mt) &amp;amp;&amp;amp;
+    get_pageblock_migratetype(page) == MIGRATE_ISOLATE)
+mt = MIGRATE_ISOLATE;
+
 /* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */
-__free_one_page(page, zone, 0, page_private(page));
-trace_mm_page_pcpu_drain(page, 0, page_private(page));
+__free_one_page(page, zone, 0, mt);
+trace_mm_page_pcpu_drain(page, 0, mt);
 } while (--to_free &amp;amp;&amp;amp; --batch_free &amp;amp;&amp;amp; !list_empty(list));
 }
 __mod_zone_page_state(zone, NR_FREE_PAGES, count);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1440,6 +1452,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 if (likely(order == 0)) {
 struct per_cpu_pages *pcp;
 struct list_head *list;
+int mt;
 
 local_irq_save(flags);
 pcp = &amp;amp;this_cpu_ptr(zone-&amp;gt;pageset)-&amp;gt;pcp;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1459,6 +1472,27 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 list_del(&amp;amp;page-&amp;gt;lru);
 pcp-&amp;gt;count--;
+
+spin_lock(&amp;amp;zone-&amp;gt;lock);
+mt = page_private(page);
+/*
+ * cached MIGRATE_CMA pageblock type may have changed
+ * during isolation
+ */
+if ((is_migrate_cma(mt) &amp;amp;&amp;amp;
+     get_pageblock_migratetype(page) == MIGRATE_ISOLATE) ||
+    mt == MIGRATE_ISOLATE) {
+mt = MIGRATE_ISOLATE;
+
+zone-&amp;gt;all_unreclaimable = 0;
+zone-&amp;gt;pages_scanned = 0;
+
+__free_one_page(page, zone, 0, mt);
+__mod_zone_page_state(zone, NR_FREE_PAGES, 1);
+spin_unlock(&amp;amp;zone-&amp;gt;lock);
+goto again;
+} else
+spin_unlock(&amp;amp;zone-&amp;gt;lock);
 } else {
 if (unlikely(gfp_flags &amp;amp; __GFP_NOFAIL)) {
 /*

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Bartlomiej Zolnierkiewicz</dc:creator>
    <dc:date>2012-05-23T07:22:00</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78873">
    <title>[PATCH] cma: retry on test_pages_isolated() failure</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78873</link>
    <description>&lt;pre&gt;From: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Subject: [PATCH] cma: retry on test_pages_isolated() failure

Retry (once) migration on test_pages_isolated() failure.

Cc: Michal Nazarewicz &amp;lt;mina86&amp;lt; at &amp;gt;mina86.com&amp;gt;
Cc: Marek Szyprowski &amp;lt;m.szyprowski&amp;lt; at &amp;gt;samsung.com&amp;gt;
Cc: Mel Gorman &amp;lt;mgorman&amp;lt; at &amp;gt;suse.de&amp;gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &amp;lt;b.zolnierkie&amp;lt; at &amp;gt;samsung.com&amp;gt;
Signed-off-by: Kyungmin Park &amp;lt;kyungmin.park&amp;lt; at &amp;gt;samsung.com&amp;gt;
---
 mm/page_alloc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: b/mm/page_alloc.c
===================================================================
--- a/mm/page_alloc.c2012-05-15 12:40:54.199127705 +0200
+++ b/mm/page_alloc.c2012-05-15 12:41:25.335127686 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -5796,7 +5796,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 {
 struct zone *zone = page_zone(pfn_to_page(start));
 unsigned long outer_start, outer_end;
-int ret = 0, order;
+int ret = 0, order, retry = 0;
 
 /*
  * What we do here is we mark all pageblocks in range as
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -5826,7 +5826,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
        pfn_max_align_up(end), migratetype);
 if (ret)
 goto done;
-
+migrate:
 ret = __alloc_contig_migrate_range(start, end);
 if (ret)
 goto done;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -5863,6 +5863,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 /* Make sure the range is really isolated. */
 if (test_pages_isolated(outer_start, end)) {
+if (retry++ &amp;lt; 1)
+goto migrate;
 pr_warn("alloc_contig_range test_pages_isolated(%lx, %lx) failed\n",
        outer_start, end);
 ret = -EBUSY;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Bartlomiej Zolnierkiewicz</dc:creator>
    <dc:date>2012-05-23T07:23:02</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78872">
    <title>[PATCH] mm: fix NULL ptr deref when walking hugepages</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78872</link>
    <description>&lt;pre&gt;A missing vlidation of the value returned by find_vma() could cause a NULL ptr
dereference when walking the pagetable.

This is triggerable from usermode by a simple user by trying to read a
page info out of /proc/pid/pagemap which doesn't exist.

Introduced by commit 025c5b24 ("thp: optimize away unnecessary page table
locking").

Signed-off-by: Sasha Levin &amp;lt;levinsasha928&amp;lt; at &amp;gt;gmail.com&amp;gt;
---
 fs/proc/task_mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 3e564f0..885830b 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -820,7 +820,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
 
 /* find the first VMA at or above 'addr' */
 vma = find_vma(walk-&amp;gt;mm, addr);
-if (pmd_trans_huge_lock(pmd, vma) == 1) {
+if (vma &amp;amp;&amp;amp; pmd_trans_huge_lock(pmd, vma) == 1) {
 for (; addr != end; addr += PAGE_SIZE) {
 unsigned long offset;
 
&lt;/pre&gt;</description>
    <dc:creator>Sasha Levin</dc:creator>
    <dc:date>2012-05-23T07:20:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78865">
    <title>[PATCH 1/2 v2] zsmalloc: zsmalloc: use unsigned long instead of void *</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78865</link>
    <description>&lt;pre&gt;We should use unsigned long as handle instead of void * to avoid any
confusion. Without this, users may just treat zs_malloc return value as
a pointer and try to deference it.

This patch passed compile test(zram, zcache and ramster) and zram is
tested on qemu.

changelog
  * from v1
 - change zcache's zv_create return value
        - baesd on next-20120522

Cc: Seth Jennings &amp;lt;sjenning&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;
Cc: Dan Magenheimer &amp;lt;dan.magenheimer&amp;lt; at &amp;gt;oracle.com&amp;gt;
Cc: Konrad Rzeszutek Wilk &amp;lt;konrad.wilk&amp;lt; at &amp;gt;oracle.com&amp;gt;
Cc: Nitin Gupta &amp;lt;ngupta&amp;lt; at &amp;gt;vflare.org&amp;gt;
Signed-off-by: Minchan Kim &amp;lt;minchan&amp;lt; at &amp;gt;kernel.org&amp;gt;
---
 drivers/staging/zcache/zcache-main.c     |   12 ++++++------
 drivers/staging/zram/zram_drv.c          |   16 ++++++++--------
 drivers/staging/zram/zram_drv.h          |    2 +-
 drivers/staging/zsmalloc/zsmalloc-main.c |   24 ++++++++++++------------
 drivers/staging/zsmalloc/zsmalloc.h      |    8 ++++----
 5 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
index 2734dac..d0141fbc 100644
--- a/drivers/staging/zcache/zcache-main.c
+++ b/drivers/staging/zcache/zcache-main.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -693,14 +693,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static unsigned int zv_max_mean_zsize = (PAGE_SIZE / 8) * 5;
 static atomic_t zv_curr_dist_counts[NCHUNKS];
 static atomic_t zv_cumul_dist_counts[NCHUNKS];
 
-static struct zv_hdr *zv_create(struct zs_pool *pool, uint32_t pool_id,
+static unsigned long zv_create(struct zs_pool *pool, uint32_t pool_id,
 struct tmem_oid *oid, uint32_t index,
 void *cdata, unsigned clen)
 {
 struct zv_hdr *zv;
 u32 size = clen + sizeof(struct zv_hdr);
 int chunks = (size + (CHUNK_SIZE - 1)) &amp;gt;&amp;gt; CHUNK_SHIFT;
-void *handle = NULL;
+unsigned long handle = 0;
 
 BUG_ON(!irqs_disabled());
 BUG_ON(chunks &amp;gt;= NCHUNKS);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -721,7 +721,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; out:
 return handle;
 }
 
-static void zv_free(struct zs_pool *pool, void *handle)
+static void zv_free(struct zs_pool *pool, unsigned long handle)
 {
 unsigned long flags;
 struct zv_hdr *zv;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -743,7 +743,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void zv_free(struct zs_pool *pool, void *handle)
 local_irq_restore(flags);
 }
 
-static void zv_decompress(struct page *page, void *handle)
+static void zv_decompress(struct page *page, unsigned long handle)
 {
 unsigned int clen = PAGE_SIZE;
 char *to_va;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1247,7 +1247,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int zcache_pampd_get_data(char *data, size_t *bufsize, bool raw,
 int ret = 0;
 
 BUG_ON(is_ephemeral(pool));
-zv_decompress((struct page *)(data), pampd);
+zv_decompress((struct page *)(data), (unsigned long)pampd);
 return ret;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1282,7 +1282,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void zcache_pampd_free(void *pampd, struct tmem_pool *pool,
 atomic_dec(&amp;amp;zcache_curr_eph_pampd_count);
 BUG_ON(atomic_read(&amp;amp;zcache_curr_eph_pampd_count) &amp;lt; 0);
 } else {
-zv_free(cli-&amp;gt;zspool, pampd);
+zv_free(cli-&amp;gt;zspool, (unsigned long)pampd);
 atomic_dec(&amp;amp;zcache_curr_pers_pampd_count);
 BUG_ON(atomic_read(&amp;amp;zcache_curr_pers_pampd_count) &amp;lt; 0);
 }
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 685d612..abd69d1 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -135,7 +135,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void zram_set_disksize(struct zram *zram, size_t totalram_bytes)
 
 static void zram_free_page(struct zram *zram, size_t index)
 {
-void *handle = zram-&amp;gt;table[index].handle;
+unsigned long handle = zram-&amp;gt;table[index].handle;
 
 if (unlikely(!handle)) {
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -150,7 +150,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void zram_free_page(struct zram *zram, size_t index)
 }
 
 if (unlikely(zram_test_flag(zram, index, ZRAM_UNCOMPRESSED))) {
-__free_page(handle);
+__free_page((struct page *)handle);
 zram_clear_flag(zram, index, ZRAM_UNCOMPRESSED);
 zram_stat_dec(&amp;amp;zram-&amp;gt;stats.pages_expand);
 goto out;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -166,7 +166,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; out:
 zram-&amp;gt;table[index].size);
 zram_stat_dec(&amp;amp;zram-&amp;gt;stats.pages_stored);
 
-zram-&amp;gt;table[index].handle = NULL;
+zram-&amp;gt;table[index].handle = 0;
 zram-&amp;gt;table[index].size = 0;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -189,7 +189,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void handle_uncompressed_page(struct zram *zram, struct bio_vec *bvec,
 unsigned char *user_mem, *cmem;
 
 user_mem = kmap_atomic(page);
-cmem = kmap_atomic(zram-&amp;gt;table[index].handle);
+cmem = kmap_atomic((struct page *)zram-&amp;gt;table[index].handle);
 
 memcpy(user_mem + bvec-&amp;gt;bv_offset, cmem + offset, bvec-&amp;gt;bv_len);
 kunmap_atomic(cmem);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -317,7 +317,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 int ret;
 u32 store_offset;
 size_t clen;
-void *handle;
+unsigned long handle;
 struct zobj_header *zheader;
 struct page *page, *page_store;
 unsigned char *user_mem, *cmem, *src, *uncmem = NULL;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -399,7 +399,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 store_offset = 0;
 zram_set_flag(zram, index, ZRAM_UNCOMPRESSED);
 zram_stat_inc(&amp;amp;zram-&amp;gt;stats.pages_expand);
-handle = page_store;
+handle = (unsigned long)page_store;
 src = kmap_atomic(page);
 cmem = kmap_atomic(page_store);
 goto memstore;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -592,12 +592,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void __zram_reset_device(struct zram *zram)
 
 /* Free all pages that are still in this zram device */
 for (index = 0; index &amp;lt; zram-&amp;gt;disksize &amp;gt;&amp;gt; PAGE_SHIFT; index++) {
-void *handle = zram-&amp;gt;table[index].handle;
+unsigned long handle = zram-&amp;gt;table[index].handle;
 if (!handle)
 continue;
 
 if (unlikely(zram_test_flag(zram, index, ZRAM_UNCOMPRESSED)))
-__free_page(handle);
+__free_page((struct page *)handle);
 else
 zs_free(zram-&amp;gt;mem_pool, handle);
 }
diff --git a/drivers/staging/zram/zram_drv.h b/drivers/staging/zram/zram_drv.h
index fbe8ac9..7a7e256 100644
--- a/drivers/staging/zram/zram_drv.h
+++ b/drivers/staging/zram/zram_drv.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -81,7 +81,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; enum zram_pageflags {
 
 /* Allocated for each disk page */
 struct table {
-void *handle;
+unsigned long handle;
 u16 size;/* object size (excluding header) */
 u8 count;/* object ref count (not yet used) */
 u8 flags;
diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c
index 4496737..fcbe83d 100644
--- a/drivers/staging/zsmalloc/zsmalloc-main.c
+++ b/drivers/staging/zsmalloc/zsmalloc-main.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -247,10 +247,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void *obj_location_to_handle(struct page *page, unsigned long obj_idx)
 }
 
 /* Decode &amp;lt;page, obj_idx&amp;gt; pair from the given object handle */
-static void obj_handle_to_location(void *handle, struct page **page,
+static void obj_handle_to_location(unsigned long handle, struct page **page,
 unsigned long *obj_idx)
 {
-unsigned long hval = (unsigned long)handle;
+unsigned long hval = handle;
 
 *page = pfn_to_page(hval &amp;gt;&amp;gt; OBJ_INDEX_BITS);
 *obj_idx = hval &amp;amp; OBJ_INDEX_MASK;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -568,12 +568,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; EXPORT_SYMBOL_GPL(zs_destroy_pool);
  * &amp;lt; at &amp;gt;size: size of block to allocate
  *
  * On success, handle to the allocated object is returned,
- * otherwise NULL.
+ * otherwise 0.
  * Allocation requests with size &amp;gt; ZS_MAX_ALLOC_SIZE will fail.
  */
-void *zs_malloc(struct zs_pool *pool, size_t size)
+unsigned long zs_malloc(struct zs_pool *pool, size_t size)
 {
-void *obj;
+unsigned long obj;
 struct link_free *link;
 int class_idx;
 struct size_class *class;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -582,7 +582,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void *zs_malloc(struct zs_pool *pool, size_t size)
 unsigned long m_objidx, m_offset;
 
 if (unlikely(!size || size &amp;gt; ZS_MAX_ALLOC_SIZE))
-return NULL;
+return 0;
 
 class_idx = get_size_class_index(size);
 class = &amp;amp;pool-&amp;gt;size_class[class_idx];
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -595,14 +595,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void *zs_malloc(struct zs_pool *pool, size_t size)
 spin_unlock(&amp;amp;class-&amp;gt;lock);
 first_page = alloc_zspage(class, pool-&amp;gt;flags);
 if (unlikely(!first_page))
-return NULL;
+return 0;
 
 set_zspage_mapping(first_page, class-&amp;gt;index, ZS_EMPTY);
 spin_lock(&amp;amp;class-&amp;gt;lock);
 class-&amp;gt;pages_allocated += class-&amp;gt;pages_per_zspage;
 }
 
-obj = first_page-&amp;gt;freelist;
+obj = (unsigned long)first_page-&amp;gt;freelist;
 obj_handle_to_location(obj, &amp;amp;m_page, &amp;amp;m_objidx);
 m_offset = obj_idx_to_offset(m_page, m_objidx, class-&amp;gt;size);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -621,7 +621,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void *zs_malloc(struct zs_pool *pool, size_t size)
 }
 EXPORT_SYMBOL_GPL(zs_malloc);
 
-void zs_free(struct zs_pool *pool, void *obj)
+void zs_free(struct zs_pool *pool, unsigned long obj)
 {
 struct link_free *link;
 struct page *first_page, *f_page;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -648,7 +648,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void zs_free(struct zs_pool *pool, void *obj)
 + f_offset);
 link-&amp;gt;next = first_page-&amp;gt;freelist;
 kunmap_atomic(link);
-first_page-&amp;gt;freelist = obj;
+first_page-&amp;gt;freelist = (void *)obj;
 
 first_page-&amp;gt;inuse--;
 fullness = fix_fullness_group(pool, first_page);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -672,7 +672,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; EXPORT_SYMBOL_GPL(zs_free);
  * this function. When done with the object, it must be unmapped using
  * zs_unmap_object
 */
-void *zs_map_object(struct zs_pool *pool, void *handle)
+void *zs_map_object(struct zs_pool *pool, unsigned long handle)
 {
 struct page *page;
 unsigned long obj_idx, off;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -712,7 +712,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void *zs_map_object(struct zs_pool *pool, void *handle)
 }
 EXPORT_SYMBOL_GPL(zs_map_object);
 
-void zs_unmap_object(struct zs_pool *pool, void *handle)
+void zs_unmap_object(struct zs_pool *pool, unsigned long handle)
 {
 struct page *page;
 unsigned long obj_idx, off;
diff --git a/drivers/staging/zsmalloc/zsmalloc.h b/drivers/staging/zsmalloc/zsmalloc.h
index 949384e..485cbb1 100644
--- a/drivers/staging/zsmalloc/zsmalloc.h
+++ b/drivers/staging/zsmalloc/zsmalloc.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -20,11 +20,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct zs_pool;
 struct zs_pool *zs_create_pool(const char *name, gfp_t flags);
 void zs_destroy_pool(struct zs_pool *pool);
 
-void *zs_malloc(struct zs_pool *pool, size_t size);
-void zs_free(struct zs_pool *pool, void *obj);
+unsigned long zs_malloc(struct zs_pool *pool, size_t size);
+void zs_free(struct zs_pool *pool, unsigned long obj);
 
-void *zs_map_object(struct zs_pool *pool, void *handle);
-void zs_unmap_object(struct zs_pool *pool, void *handle);
+void *zs_map_object(struct zs_pool *pool, unsigned long handle);
+void zs_unmap_object(struct zs_pool *pool, unsigned long handle);
 
 u64 zs_get_total_size_bytes(struct zs_pool *pool);
 
&lt;/pre&gt;</description>
    <dc:creator>Minchan Kim</dc:creator>
    <dc:date>2012-05-23T01:43:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78860">
    <title>[PATCH v4] mm: Fix slab-&gt;page flags corruption.</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78860</link>
    <description>&lt;pre&gt;v3-v4:
- Added comments.
- Removed VM_BUG_ON on PageHead from put_page.
v2-v3:
- Check if page is still compound page after inc refcnt.
v1-v2:
- Avoid taking compound lock for slab pages.

--8&amp;lt;--------------------------cut here--------------------------&amp;gt;8--

Transparent huge pages can change page-&amp;gt;flags (PG_compound_lock)
without taking Slab lock. Since THP can not break slab pages we can
safely access compound page without taking compound lock.

Specifically this patch fixes race between compound_unlock and slab
functions which does page-flags update. This can occur when
get_page/put_page is called on page from slab object.

Reported-by: Amey Bhide &amp;lt;abhide&amp;lt; at &amp;gt;nicira.com&amp;gt;
Signed-off-by: Pravin B Shelar &amp;lt;pshelar&amp;lt; at &amp;gt;nicira.com&amp;gt;
Reviewed-by: Christoph Lameter &amp;lt;cl&amp;lt; at &amp;gt;linux.com&amp;gt;
---
 include/linux/mm.h |    2 ++
 mm/swap.c          |   34 +++++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8437e93..ddd58ce 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -321,6 +321,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline int is_vmalloc_or_module_addr(const void *x)
 static inline void compound_lock(struct page *page)
 {
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
+VM_BUG_ON(PageSlab(page));
 bit_spin_lock(PG_compound_lock, &amp;amp;page-&amp;gt;flags);
 #endif
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -328,6 +329,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline void compound_lock(struct page *page)
 static inline void compound_unlock(struct page *page)
 {
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
+VM_BUG_ON(PageSlab(page));
 bit_spin_unlock(PG_compound_lock, &amp;amp;page-&amp;gt;flags);
 #endif
 }
diff --git a/mm/swap.c b/mm/swap.c
index 8ff73d8..93c709b 100644
--- a/mm/swap.c
+++ b/mm/swap.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -82,6 +82,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void put_compound_page(struct page *page)
 if (likely(page != page_head &amp;amp;&amp;amp;
    get_page_unless_zero(page_head))) {
 unsigned long flags;
+
+/* THP can not break up slab pages, avoid taking
+ * compound_lock(). Slab prefer non atomic bit ops
+ * on page-&amp;gt;flags for better performance. In particular
+ * slab_unlock() in slub used to be a hot path
+ * item. It is still hot on arches that do not support
+ * this_cpu_cmpxchg_double. */
+
+if (PageSlab(page_head)) {
+if (PageTail(page)) {
+if (put_page_testzero(page_head))
+VM_BUG_ON(1);
+
+atomic_dec(&amp;amp;page-&amp;gt;_mapcount);
+goto skip_lock_tail;
+} else
+goto skip_lock;
+}
 /*
  * page_head wasn't a dangling pointer but it
  * may not be a head page anymore by the time
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -92,7 +110,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void put_compound_page(struct page *page)
 if (unlikely(!PageTail(page))) {
 /* __split_huge_page_refcount run before us */
 compound_unlock_irqrestore(page_head, flags);
-VM_BUG_ON(PageHead(page_head));
+skip_lock:
 if (put_page_testzero(page_head))
 __put_single_page(page_head);
 out_put_single:
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -115,6 +133,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void put_compound_page(struct page *page)
 VM_BUG_ON(atomic_read(&amp;amp;page_head-&amp;gt;_count) &amp;lt;= 0);
 VM_BUG_ON(atomic_read(&amp;amp;page-&amp;gt;_count) != 0);
 compound_unlock_irqrestore(page_head, flags);
+
+skip_lock_tail:
 if (put_page_testzero(page_head)) {
 if (PageHead(page_head))
 __put_compound_page(page_head);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -162,6 +182,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bool __get_page_tail(struct page *page)
 struct page *page_head = compound_trans_head(page);
 
 if (likely(page != page_head &amp;amp;&amp;amp; get_page_unless_zero(page_head))) {
+
+/* Ref to put_compound_page() comment. */
+if (PageSlab(page_head)) {
+if (likely(PageTail(page))) {
+__get_page_tail_foll(page, false);
+return true;
+} else {
+put_page(page_head);
+return false;
+}
+}
+
 /*
  * page_head wasn't a dangling pointer but it
  * may not be a head page anymore by the time
&lt;/pre&gt;</description>
    <dc:creator>Pravin B Shelar</dc:creator>
    <dc:date>2012-05-22T23:25:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78837">
    <title>memcg-devel git tree updated to 3.4</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78837</link>
    <description>&lt;pre&gt;Hi,
JFYI I have just pushed memcg patch queue rebased on top of v3.4.
You can find it at a usual place:
git&amp;lt; at &amp;gt;github.com:mstsxfx/memcg-devel.git in since-3.4 branch

I hope I haven't forgotten about anything (there quite some patches that
are sitting in mmotm but I haven't seen them in linux-next - statistics
cleanup by Johannes and lruvec cleanup by Hugh - and I will push them as
soon as they appear there).

Current shortlog on top of v3.4:

Aneesh Kumar K.V (15):
      hugetlb: rename max_hstate to hugetlb_max_hstate
      hugetlbfs: don't use ERR_PTR with VM_FAULT* values
      hugetlbfs: add an inline helper for finding hstate index
      hugetlb: use mmu_gather instead of a temporary linked list for accumulating pages
      hugetlb: avoid taking i_mmap_mutex in unmap_single_vma() for hugetlb
      hugetlb: simplify migrate_huge_page()
      memcg: add HugeTLB extension
      hugetlb: add charge/uncharge calls for HugeTLB alloc/free
      memcg: track resource index in cftype private
      hugetlbfs: add memcg control files for hugetlbfs
      memcg: use scnprintf instead of sprintf
      hugetlbfs: add a list for tracking in-use HugeTLB pages
      memcg: move HugeTLB resource count to parent cgroup on memcg removal
      hugetlb: migrate memcg info from oldpage to new page during migration
      memcg: add memory controller documentation for hugetlb management

David Rientjes (4):
      mm, thp: remove unnecessary ret variable
      mm, thp: allow fallback when pte_alloc_one() fails for huge pmd
      thp, memcg: split hugepage for memcg oom on cow
      mm, thp: drop page_table_lock to uncharge memcg pages

Hugh Dickins (6):
      memcg: fix page migration to reset_owner
      memcg: fix GPF when cgroup removal races with last exit
      memcg swap: mem_cgroup_move_swap_account never needs fixup
      memcg swap: use mem_cgroup_uncharge_swap()
      mm/memcg: scanning_global_lru means mem_cgroup_disabled
      mm/memcg: move reclaim_stat into lruvec

Johannes Weiner (3):
      kernel: cgroup: push rcu read locking from css_is_ancestor() to callsite
      mm: memcg: count pte references from every member of the reclaimed hierarchy
      Documentation: memcg: future proof hierarchical statistics documentation

KAMEZAWA Hiroyuki (2):
      memcg: clear pc-&amp;gt;mem_cgorup if necessary.
      memcg: fix/change behavior of shared anon at moving task

Kirill A. Shutemov (4):
      memcg: mark more functions/variables as static
      memcg: remove unused variable
      memcg: mark stat field of mem_cgroup struct as __percpu
      memcg: remove redundant parentheses

Konstantin Khlebnikov (18):
      mm: push lru index into shrink_[in]active_list()
      mm: mark mm-inline functions as __always_inline
      mm: remove lru type checks from __isolate_lru_page()
      mm/memcg: kill mem_cgroup_lru_del()
      mm/memcg: use vm_swappiness from target memory cgroup
      mm: correctly synchronize rss-counters at exit/exec
      mm/vmscan: store "priority" in struct scan_control
      mm: add link from struct lruvec to struct zone
      mm/vmscan: push lruvec pointer into isolate_lru_pages()
      mm/vmscan: push zone pointer into shrink_page_list()
      mm/vmscan: remove update_isolated_counts()
      mm/vmscan: push lruvec pointer into putback_inactive_pages()
      mm/vmscan: replace zone_nr_lru_pages() with get_lruvec_size()
      mm/vmscan: push lruvec pointer into inactive_list_is_low()
      mm/vmscan: push lruvec pointer into shrink_list()
      mm/vmscan: push lruvec pointer into get_scan_count()
      mm/vmscan: push lruvec pointer into should_continue_reclaim()
      mm/vmscan: kill struct mem_cgroup_zone

Mel Gorman (2):
      mm: vmscan: remove lumpy reclaim
      mm: vmscan: remove reclaim_mode_t

Rik van Riel (1):
      mm: remove swap token code

Sha Zhengju (2):
      memcg: make threshold index in the right position
      memcg: revise the position of threshold index while unregistering event

Tejun Heo (15):
      cgroup: deprecate remount option changes
      cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir()
      cgroup: build list of all cgroups under a given cgroupfs_root
      cgroup: implement cgroup_add_cftypes() and friends
      cgroup: merge cft_release_agent cftype array into the base files array
      cgroup: relocate cftype and cgroup_subsys definitions in controllers
      cgroup: convert all non-memcg controllers to the new cftype interface
      memcg: always create memsw files if CONFIG_CGROUP_MEM_RES_CTLR_SWAP
      cgroup: convert memcg controller to the new cftype interface
      cgroup: remove cgroup_add_file[s]()
      cgroup: relocate __d_cgrp() and __d_cft()
      cgroup: introduce struct cfent
      cgroup: implement cgroup_rm_cftypes()
      cgroup: use negative bias on css-&amp;gt;refcnt to block css_tryget()
      cgroup: make css-&amp;gt;refcnt clearing on cgroup removal optional

Ying Han (2):
      mm: rename is_mlocked_vma() to mlocked_vma_newpage()
      memcg: add mlock statistic in memory.stat

&lt;/pre&gt;</description>
    <dc:creator>Michal Hocko</dc:creator>
    <dc:date>2012-05-22T15:57:28</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78819">
    <title>[PATCH] memcg/hugetlb: Add failcnt support for hugetlb extension</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78819</link>
    <description>&lt;pre&gt;From: "Aneesh Kumar K.V" &amp;lt;aneesh.kumar&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;

Expose the failcnt details to userspace similar to memory and memsw.

Signed-off-by: Aneesh Kumar K.V &amp;lt;aneesh.kumar&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;
---
 include/linux/hugetlb.h |    2 +-
 mm/memcontrol.c         |   40 ++++++++++++++++++++++++++--------------
 2 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index ee80bc8..cfe3cf5c 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -219,7 +219,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct hstate {
 unsigned int surplus_huge_pages_node[MAX_NUMNODES];
 #ifdef CONFIG_MEM_RES_CTLR_HUGETLB
 /* mem cgroup control files */
-struct cftype mem_cgroup_files[4];
+struct cftype mem_cgroup_files[5];
 #endif
 char name[HSTATE_NAME_LEN];
 };
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f142ea9..bacb0df 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4189,7 +4189,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; out:
 static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)
 {
 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
-int type, name;
+int type, name, idx;
 
 type = MEMFILE_TYPE(event);
 name = MEMFILE_ATTR(event);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4197,24 +4197,29 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)
 if (!do_swap_account &amp;amp;&amp;amp; type == _MEMSWAP)
 return -EOPNOTSUPP;
 
-switch (name) {
-case RES_MAX_USAGE:
-if (type == _MEM)
+switch (type) {
+case _MEM:
+if (name == RES_MAX_USAGE)
 res_counter_reset_max(&amp;amp;memcg-&amp;gt;res);
-else if (type == _MEMHUGETLB) {
-int idx = MEMFILE_IDX(event);
-res_counter_reset_max(&amp;amp;memcg-&amp;gt;hugepage[idx]);
-} else
-res_counter_reset_max(&amp;amp;memcg-&amp;gt;memsw);
-break;
-case RES_FAILCNT:
-if (type == _MEM)
+else
 res_counter_reset_failcnt(&amp;amp;memcg-&amp;gt;res);
+break;
+case _MEMSWAP:
+if (name == RES_MAX_USAGE)
+res_counter_reset_max(&amp;amp;memcg-&amp;gt;memsw);
 else
 res_counter_reset_failcnt(&amp;amp;memcg-&amp;gt;memsw);
 break;
+case _MEMHUGETLB:
+idx = MEMFILE_IDX(event);
+if (name == RES_MAX_USAGE)
+res_counter_reset_max(&amp;amp;memcg-&amp;gt;hugepage[idx]);
+else
+res_counter_reset_failcnt(&amp;amp;memcg-&amp;gt;hugepage[idx]);
+break;
+default:
+BUG();
 }
-
 return 0;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -5299,8 +5304,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int __init mem_cgroup_hugetlb_file_init(int idx)
 cft-&amp;gt;trigger  = mem_cgroup_reset;
 cft-&amp;gt;read = mem_cgroup_read;
 
-/* NULL terminate the last cft */
+/* Add the failcntfile */
 cft = &amp;amp;h-&amp;gt;mem_cgroup_files[3];
+snprintf(cft-&amp;gt;name, MAX_CFTYPE_NAME, "hugetlb.%s.failcnt", buf);
+cft-&amp;gt;private  = __MEMFILE_PRIVATE(idx, _MEMHUGETLB, RES_FAILCNT);
+cft-&amp;gt;trigger  = mem_cgroup_reset;
+cft-&amp;gt;read = mem_cgroup_read;
+
+/* NULL terminate the last cft */
+cft = &amp;amp;h-&amp;gt;mem_cgroup_files[4];
 memset(cft, 0, sizeof(*cft));
 
 WARN_ON(cgroup_add_cftypes(&amp;amp;mem_cgroup_subsys, h-&amp;gt;mem_cgroup_files));
&lt;/pre&gt;</description>
    <dc:creator>Aneesh Kumar K.V</dc:creator>
    <dc:date>2012-05-22T11:43:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78812">
    <title>[PATCH 1/2] mm/memblock: cleanup on duplicate VA/PA conversion</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78812</link>
    <description>&lt;pre&gt;The overall memblock has been organized into the memory regions
and reserved regions. Initially, the memory regions and reserved
regions are stored in the predetermined arrays of "struct memblock
_region". It's possible for the arrays to be enlarged when we have
newly added regions for them, but no enough space there. Under the
situation, We will created double-sized array to meet the requirement.
However, the original implementation converted the VA (Virtual Address)
of the newly allocated array of regions to PA (Physical Address), then
translate back when we allocates the new array from slab. That's
actually unnecessary.

The patch removes the duplicate VA/PA conversion.

Signed-off-by: Gavin Shan &amp;lt;shangw&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;
---
 mm/memblock.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index a44eab3..eae06ea 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -212,14 +212,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int __init_memblock memblock_double_array(struct memblock_type *type)
 if (use_slab) {
 new_array = kmalloc(new_size, GFP_KERNEL);
 addr = new_array ? __pa(new_array) : 0;
-} else
+} else {
 addr = memblock_find_in_range(0, MEMBLOCK_ALLOC_ACCESSIBLE, new_size, sizeof(phys_addr_t));
+new_array = addr ? __va(addr) : 0;
+}
 if (!addr) {
 pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n",
        memblock_type_name(type), type-&amp;gt;max, type-&amp;gt;max * 2);
 return -1;
 }
-new_array = __va(addr);
 
 memblock_dbg("memblock: %s array is doubled to %ld at [%#010llx-%#010llx]",
  memblock_type_name(type), type-&amp;gt;max * 2, (u64)addr, (u64)addr + new_size - 1);
&lt;/pre&gt;</description>
    <dc:creator>Gavin Shan</dc:creator>
    <dc:date>2012-05-22T08:31:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78782">
    <title>[PATCH] hugetlb: fix resv_map leak in error path</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78782</link>
    <description>&lt;pre&gt;
When called for anonymous (non-shared) mappings,
hugetlb_reserve_pages() does a resv_map_alloc().  It depends on
code in hugetlbfs's vm_ops-&amp;gt;close() to release that allocation.

However, in the mmap() failure path, we do a plain unmap_region()
without the remove_vma() which actually calls vm_ops-&amp;gt;close().

This is a decent fix.  This leak could get reintroduced if
new code (say, after hugetlb_reserve_pages() in
hugetlbfs_file_mmap()) decides to return an error.  But, I think
it would have to unroll the reservation anyway.

This hasn't been extensively tested.  Pretty much compile and
boot tested along with Christoph's test case:

http://marc.info/?l=linux-mm&amp;amp;m=133728900729735

Signed-off-by: Dave Hansen &amp;lt;dave&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;
Acked-by: Mel Gorman &amp;lt;mel&amp;lt; at &amp;gt;csn.ul.ie&amp;gt;
ecked-by: KOSAKI Motohiro &amp;lt;kosaki.motohiro&amp;lt; at &amp;gt;jp.fujitsu.com&amp;gt;
Reported/tested-by: Christoph Lameter &amp;lt;cl&amp;lt; at &amp;gt;linux.com&amp;gt;

---

 linux-2.6.git-dave/mm/hugetlb.c |   28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff -puN mm/hugetlb.c~hugetlb-fix-leak mm/hugetlb.c
--- linux-2.6.git/mm/hugetlb.c~hugetlb-fix-leak2012-05-21 13:24:38.369857759 -0700
+++ linux-2.6.git-dave/mm/hugetlb.c2012-05-21 13:24:38.377857849 -0700
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2157,6 +2157,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void hugetlb_vm_op_open(struct vm
 kref_get(&amp;amp;reservations-&amp;gt;refs);
 }
 
+static void resv_map_put(struct vm_area_struct *vma)
+{
+struct resv_map *reservations = vma_resv_map(vma);
+
+if (!reservations)
+return;
+kref_put(&amp;amp;reservations-&amp;gt;refs, resv_map_release);
+}
+
 static void hugetlb_vm_op_close(struct vm_area_struct *vma)
 {
 struct hstate *h = hstate_vma(vma);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2173,7 +2182,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void hugetlb_vm_op_close(struct v
 reserve = (end - start) -
 region_count(&amp;amp;reservations-&amp;gt;regions, start, end);
 
-kref_put(&amp;amp;reservations-&amp;gt;refs, resv_map_release);
+resv_map_put(vma);
 
 if (reserve) {
 hugetlb_acct_memory(h, -reserve);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2990,12 +2999,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int hugetlb_reserve_pages(struct inode *
 set_vma_resv_flags(vma, HPAGE_RESV_OWNER);
 }
 
-if (chg &amp;lt; 0)
-return chg;
+if (chg &amp;lt; 0) {
+ret = chg;
+goto out_err;
+}
 
 /* There must be enough pages in the subpool for the mapping */
-if (hugepage_subpool_get_pages(spool, chg))
-return -ENOSPC;
+if (hugepage_subpool_get_pages(spool, chg)) {
+ret = -ENOSPC;
+goto out_err;
+}
 
 /*
  * Check enough hugepages are available for the reservation.
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3004,7 +3017,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int hugetlb_reserve_pages(struct inode *
 ret = hugetlb_acct_memory(h, chg);
 if (ret &amp;lt; 0) {
 hugepage_subpool_put_pages(spool, chg);
-return ret;
+goto out_err;
 }
 
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3021,6 +3034,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int hugetlb_reserve_pages(struct inode *
 if (!vma || vma-&amp;gt;vm_flags &amp;amp; VM_MAYSHARE)
 region_add(&amp;amp;inode-&amp;gt;i_mapping-&amp;gt;private_list, from, to);
 return 0;
+out_err:
+resv_map_put(vma);
+return ret;
 }
 
 void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
diff -puN Documentation/stable_kernel_rules.txt~hugetlb-fix-leak Documentation/stable_kernel_rules.txt
_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Dave Hansen</dc:creator>
    <dc:date>2012-05-21T20:28:14</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78770">
    <title>[PATCH] slab+slob: dup name string</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78770</link>
    <description>&lt;pre&gt;The slub allocator creates a copy of the name string, and
frees it later. I would like all caches to behave the same,
whether it is the slab+slob starting to create a copy of it itself,
or the slub ceasing to.

This patch creates copies of the name string for slob and slab,
adopting slub behavior for them all.

For the slab, we can't really do it before the kmalloc caches are
up. We need to rely that caches created before the state was set to
EARLY will never be destroyed.

Signed-off-by: Glauber Costa &amp;lt;glommer&amp;lt; at &amp;gt;parallels.com&amp;gt;
CC: Christoph Lameter &amp;lt;cl&amp;lt; at &amp;gt;linux.com&amp;gt;
CC: Pekka Enberg &amp;lt;penberg&amp;lt; at &amp;gt;cs.helsinki.fi&amp;gt;
CC: David Rientjes &amp;lt;rientjes&amp;lt; at &amp;gt;google.com&amp;gt;
---
 mm/slab.c |   10 ++++++++--
 mm/slob.c |   12 ++++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index e901a36..cabd217 100644
--- a/mm/slab.c
+++ b/mm/slab.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2118,6 +2118,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void __kmem_cache_destroy(struct kmem_cache *cachep)
 kfree(l3);
 }
 }
+kfree(cachep-&amp;gt;name);
 kmem_cache_free(&amp;amp;cache_cache, cachep);
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2526,9 +2527,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; kmem_cache_create (const char *name, size_t size, size_t align,
 BUG_ON(ZERO_OR_NULL_PTR(cachep-&amp;gt;slabp_cache));
 }
 cachep-&amp;gt;ctor = ctor;
-cachep-&amp;gt;name = name;
 
-if (setup_cpu_cache(cachep, gfp)) {
+/* Can't do strdup while kmalloc is not up */
+if (g_cpucache_up &amp;gt; EARLY)
+cachep-&amp;gt;name = kstrdup(name, GFP_KERNEL);
+else
+cachep-&amp;gt;name = name;
+
+if (!cachep-&amp;gt;name || setup_cpu_cache(cachep, gfp)) {
 __kmem_cache_destroy(cachep);
 cachep = NULL;
 goto oops;
diff --git a/mm/slob.c b/mm/slob.c
index 8105be4..8f10d36 100644
--- a/mm/slob.c
+++ b/mm/slob.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -575,7 +575,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct kmem_cache *kmem_cache_create(const char *name, size_t size,
 GFP_KERNEL, ARCH_KMALLOC_MINALIGN, -1);
 
 if (c) {
-c-&amp;gt;name = name;
+c-&amp;gt;name = kstrdup(name, GFP_KERNEL);
+if (!c-&amp;gt;name) {
+slob_free(c, sizeof(struct kmem_cache));
+c = NULL;
+goto out;
+}
 c-&amp;gt;size = size;
 if (flags &amp;amp; SLAB_DESTROY_BY_RCU) {
 /* leave room for rcu footer at the end of object */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -589,7 +594,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct kmem_cache *kmem_cache_create(const char *name, size_t size,
 c-&amp;gt;align = ARCH_SLAB_MINALIGN;
 if (c-&amp;gt;align &amp;lt; align)
 c-&amp;gt;align = align;
-} else if (flags &amp;amp; SLAB_PANIC)
+}
+out:
+if (!c &amp;amp;&amp;amp; (flags &amp;amp; SLAB_PANIC))
 panic("Cannot create slab cache %s\n", name);
 
 kmemleak_alloc(c, sizeof(struct kmem_cache), 1, GFP_KERNEL);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -602,6 +609,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void kmem_cache_destroy(struct kmem_cache *c)
 kmemleak_free(c);
 if (c-&amp;gt;flags &amp;amp; SLAB_DESTROY_BY_RCU)
 rcu_barrier();
+kfree(c-&amp;gt;name);
 slob_free(c, sizeof(struct kmem_cache));
 }
 EXPORT_SYMBOL(kmem_cache_destroy);
&lt;/pre&gt;</description>
    <dc:creator>Glauber Costa</dc:creator>
    <dc:date>2012-05-21T15:18:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.mm/78743">
    <title>[PATCH 0/2] swap: improve swap I/O rate - V2</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.mm/78743</link>
    <description>&lt;pre&gt;From: Ehrhardt Christian &amp;lt;ehrhardt&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;

From: Christian Ehrhardt &amp;lt;ehrhardt&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;

* Update in V2 *
- Adapted the documentation patch according to feedback of Minchan Kim
- Added the Acks I got to V1 so far

In an memory overcommitment scneario with KVM I ran into a lot of waits for
swap. While checking the I/O done on the swap disks I found almost all I/Os
to be done as single page 4k request. Despite the fact that swap in is a
batch of 1&amp;lt;&amp;lt;page-cluster pages as swap readahead and swap out is a list of
pages written in shrink_page_list.

[1/2 swap in improvment]
The read patch shows improvements of up to 50% swap throughput, much happier
guest systems and even when running with comparable throughput a lot I/O per
seconds saved leaving resources in the SAN for other consumers.

[2/2 documentation]
While doing so I also realized that the documentation for
proc/sys/vm/page-cluster is no more matching the code

Kind regards,
Christian Ehrhardt


Christian Ehrhardt (2):
  swap: allow swap readahead to be merged
  documentation: update how page-cluster affects swap I/O

 Documentation/sysctl/vm.txt |   12 ++++++++++--
 mm/swap_state.c             |    5 +++++
 2 files changed, 15 insertions(+), 2 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo&amp;lt; at &amp;gt;kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: &amp;lt;a href=mailto:"dont&amp;lt; at &amp;gt;kvack.org"&amp;gt; email&amp;lt; at &amp;gt;kvack.org &amp;lt;/a&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>ehrhardt&lt; at &gt;linux.vnet.ibm.com</dc:creator>
    <dc:date>2012-05-21T08:09:13</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.kernel.mm">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.kernel.mm</link>
  </textinput>
</rdf:RDF>

