<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/mm/util.c, branch v3.2.38</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/mm/util.c?h=v3.2.38</id>
<link rel='self' href='https://git.amat.us/linux/atom/mm/util.c?h=v3.2.38'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-10-31T13:20:12Z</updated>
<entry>
<title>mm: Map most files to use export.h instead of module.h</title>
<updated>2011-10-31T13:20:12Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-10-16T06:01:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b95f1b31b75588306e32b2afd32166cad48f670b'/>
<id>urn:sha1:b95f1b31b75588306e32b2afd32166cad48f670b</id>
<content type='text'>
The files changed within are only using the EXPORT_SYMBOL
macro variants.  They are not using core modular infrastructure
and hence don't need module.h but only the export.h header.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>mm: nommu: sort mm-&gt;mmap list properly</title>
<updated>2011-05-25T15:39:05Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-25T00:11:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6038def0d11b322019d0dbb43f2a611247dfbdb6'/>
<id>urn:sha1:6038def0d11b322019d0dbb43f2a611247dfbdb6</id>
<content type='text'>
When I was reading nommu code, I found that it handles the vma list/tree
in an unusual way.  IIUC, because there can be more than one
identical/overrapped vmas in the list/tree, it sorts the tree more
strictly and does a linear search on the tree.  But it doesn't applied to
the list (i.e.  the list could be constructed in a different order than
the tree so that we can't use the list when finding the first vma in that
order).

Since inserting/sorting a vma in the tree and link is done at the same
time, we can easily construct both of them in the same order.  And linear
searching on the tree could be more costly than doing it on the list, it
can be converted to use the list.

Also, after the commit 297c5eee3724 ("mm: make the vma list be doubly
linked") made the list be doubly linked, there were a couple of code need
to be fixed to construct the list properly.

Patch 1/6 is a preparation.  It maintains the list sorted same as the tree
and construct doubly-linked list properly.  Patch 2/6 is a simple
optimization for the vma deletion.  Patch 3/6 and 4/6 convert tree
traversal to list traversal and the rest are simple fixes and cleanups.

This patch:

@vma added into @mm should be sorted by start addr, end addr and VMA
struct addr in that order because we may get identical VMAs in the @mm.
However this was true only for the rbtree, not for the list.

This patch fixes this by remembering 'rb_prev' during the tree traversal
like find_vma_prepare() does and linking the @vma via __vma_link_list().
After this patch, we can iterate the whole VMAs in correct order simply by
using @mm-&gt;mmap list.

[akpm@linux-foundation.org: avoid duplicating __vma_link_list()]
Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Acked-by: Greg Ungerer &lt;gerg@uclinux.org&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Paul Mundt &lt;lethal@linux-sh.org&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&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>Fix common misspellings</title>
<updated>2011-03-31T14:26:23Z</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@profusion.mobi</email>
</author>
<published>2011-03-31T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>urn:sha1:25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>kernel: kmem_ptr_validate considered harmful</title>
<updated>2011-01-07T06:50:16Z</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ccd35fb9f4da856b105ea0f1e0cab3702e8ae6ba'/>
<id>urn:sha1:ccd35fb9f4da856b105ea0f1e0cab3702e8ae6ba</id>
<content type='text'>
This is a nasty and error prone API. It is no longer used, remove it.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
</entry>
<entry>
<title>export __get_user_pages_fast() function</title>
<updated>2010-10-24T08:51:24Z</updated>
<author>
<name>Xiao Guangrong</name>
<email>xiaoguangrong@cn.fujitsu.com</email>
</author>
<published>2010-08-22T11:08:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=45888a0c6edc305495b6bd72a30e66bc40b324c6'/>
<id>urn:sha1:45888a0c6edc305495b6bd72a30e66bc40b324c6</id>
<content type='text'>
This function is used by KVM to pin process's page in the atomic context.

Define the 'weak' function to avoid other architecture not support it

Acked-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
</content>
</entry>
<entry>
<title>mm: use memdup_user</title>
<updated>2010-08-10T03:44:54Z</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2010-08-10T00:18:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=90d7404558fbe6f369d5e27b5ea3ef1e57562d3d'/>
<id>urn:sha1:90d7404558fbe6f369d5e27b5ea3ef1e57562d3d</id>
<content type='text'>
Use memdup_user when user data is immediately copied into the
allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = memdup_user(from,size);
   if (
-      to==NULL
+      IS_ERR(to)
                 || ...) {
   &lt;+... when != goto l1;
-  -ENOMEM
+  PTR_ERR(to)
   ...+&gt;
   }
-  if (copy_from_user(to, from, size) != 0) {
-    &lt;+... when != goto l2;
-    -EFAULT
-    ...+&gt;
-  }
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.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>slab: Generify kernel pointer validation</title>
<updated>2010-04-09T17:09:50Z</updated>
<author>
<name>Pekka Enberg</name>
<email>penberg@cs.helsinki.fi</email>
</author>
<published>2010-04-07T16:23:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fc1c183353a113c71675fecd0485e5aa0fe68d72'/>
<id>urn:sha1:fc1c183353a113c71675fecd0485e5aa0fe68d72</id>
<content type='text'>
As suggested by Linus, introduce a kern_ptr_validate() helper that does some
sanity checks to make sure a pointer is a valid kernel pointer.  This is a
preparational step for fixing SLUB kmem_ptr_validate().

Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Matt Mackall &lt;mpm@selenic.com&gt;
Cc: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nommu: don't need get_unmapped_area() for NOMMU</title>
<updated>2010-01-16T20:15:40Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-01-16T01:01:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=efc1a3b16930c41d64ffefde16b87d82f603a8a0'/>
<id>urn:sha1:efc1a3b16930c41d64ffefde16b87d82f603a8a0</id>
<content type='text'>
get_unmapped_area() is unnecessary for NOMMU as no-one calls it.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Greg Ungerer &lt;gerg@snapgear.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>mm: move sys_mmap_pgoff from util.c</title>
<updated>2009-12-30T20:23:27Z</updated>
<author>
<name>Hugh Dickins</name>
<email>hugh.dickins@tiscali.co.uk</email>
</author>
<published>2009-12-30T20:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=66f0dc481e5b802ab363b979fc1753410c7d82b5'/>
<id>urn:sha1:66f0dc481e5b802ab363b979fc1753410c7d82b5</id>
<content type='text'>
Move sys_mmap_pgoff() from mm/util.c to mm/mmap.c and mm/nommu.c,
where we'd expect to find such code: especially now that it contains
the MAP_HUGETLB handling.  Revert mm/util.c to how it was in 2.6.32.

This patch just ignores MAP_HUGETLB in the nommu case, as in 2.6.32,
whereas 2.6.33-rc2 reported -ENOSYS.  Perhaps validate_mmap_request()
should reject it with -EINVAL?  Add that later if necessary.

Signed-off-by: Hugh Dickins &lt;hugh.dickins@tiscali.co.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fix a struct file leak in do_mmap_pgoff()</title>
<updated>2009-12-11T11:44:57Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2009-12-01T01:12:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8c7b49b3ecd48923eb64ff57e07a1cdb74782970'/>
<id>urn:sha1:8c7b49b3ecd48923eb64ff57e07a1cdb74782970</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
