<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/mman.h, branch v3.0.42</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.42</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.42'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2009-05-02T22:36:10Z</updated>
<entry>
<title>mm: fix Committed_AS underflow on large NR_CPUS environment</title>
<updated>2009-05-02T22:36:10Z</updated>
<author>
<name>KOSAKI Motohiro</name>
<email>kosaki.motohiro@jp.fujitsu.com</email>
</author>
<published>2009-04-30T22:08:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=00a62ce91e554198ef28234c91c36f850f5a3bc9'/>
<id>urn:sha1:00a62ce91e554198ef28234c91c36f850f5a3bc9</id>
<content type='text'>
The Committed_AS field can underflow in certain situations:

&gt;         # while true; do cat /proc/meminfo  | grep _AS; sleep 1; done | uniq -c
&gt;               1 Committed_AS: 18446744073709323392 kB
&gt;              11 Committed_AS: 18446744073709455488 kB
&gt;               6 Committed_AS:    35136 kB
&gt;               5 Committed_AS: 18446744073709454400 kB
&gt;               7 Committed_AS:    35904 kB
&gt;               3 Committed_AS: 18446744073709453248 kB
&gt;               2 Committed_AS:    34752 kB
&gt;               9 Committed_AS: 18446744073709453248 kB
&gt;               8 Committed_AS:    34752 kB
&gt;               3 Committed_AS: 18446744073709320960 kB
&gt;               7 Committed_AS: 18446744073709454080 kB
&gt;               3 Committed_AS: 18446744073709320960 kB
&gt;               5 Committed_AS: 18446744073709454080 kB
&gt;               6 Committed_AS: 18446744073709320960 kB

Because NR_CPUS can be greater than 1000 and meminfo_proc_show() does
not check for underflow.

But NR_CPUS proportional isn't good calculation.  In general,
possibility of lock contention is proportional to the number of online
cpus, not theorical maximum cpus (NR_CPUS).

The current kernel has generic percpu-counter stuff.  using it is right
way.  it makes code simplify and percpu_counter_read_positive() don't
make underflow issue.

Reported-by: Dave Hansen &lt;dave@linux.vnet.ibm.com&gt;
Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Eric B Munson &lt;ebmunson@us.ibm.com&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: &lt;stable@kernel.org&gt;		[All kernel versions]
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: Allow architectures to define additional protection bits</title>
<updated>2008-07-09T06:30:45Z</updated>
<author>
<name>Dave Kleikamp</name>
<email>shaggy@linux.vnet.ibm.com</email>
</author>
<published>2008-07-07T14:28:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b845f313d78e4e259ec449909e3bbadf77b53a6d'/>
<id>urn:sha1:b845f313d78e4e259ec449909e3bbadf77b53a6d</id>
<content type='text'>
This patch allows architectures to define functions to deal with
additional protections bits for mmap() and mprotect().

arch_calc_vm_prot_bits() maps additonal protection bits to vm_flags
arch_vm_get_page_prot() maps additional vm_flags to the vma's vm_page_prot
arch_validate_prot() checks for valid values of the protection bits

Note: vm_get_page_prot() is now pretty ugly, but the generated code
should be identical for architectures that don't define additional
protection bits.

Signed-off-by: Dave Kleikamp &lt;shaggy@linux.vnet.ibm.com&gt;
Acked-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>mm: fix atomic_t overflow in vm</title>
<updated>2008-05-24T16:56:09Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@redhat.com</email>
</author>
<published>2008-05-23T20:04:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=80119ef5c8153e0a6cc5edf00c083dc98a9bd348'/>
<id>urn:sha1:80119ef5c8153e0a6cc5edf00c083dc98a9bd348</id>
<content type='text'>
The atomic_t type is 32bit but a 64bit system can have more than 2^32
pages of virtual address space available.  Without this we overflow on
ludicrously large mappings

Signed-off-by: Alan Cox &lt;alan@redhat.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>Don't include linux/config.h from anywhere else in include/</title>
<updated>2006-04-26T11:56:16Z</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2006-04-26T11:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=62c4f0a2d5a188f73a94f2cb8ea0dba3e7cf0a7f'/>
<id>urn:sha1:62c4f0a2d5a188f73a94f2cb8ea0dba3e7cf0a7f</id>
<content type='text'>
Signed-off-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
</content>
</entry>
<entry>
<title>Sanitise linux/mman.h for userspace consumption</title>
<updated>2006-04-25T13:18:07Z</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2006-04-25T13:18:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9cdcb56636717ccb935dc66c5d56681eaa5941c1'/>
<id>urn:sha1:9cdcb56636717ccb935dc66c5d56681eaa5941c1</id>
<content type='text'>
It only really needs to define a few constants and include &lt;asm/mman.h&gt;
when it's used by userspace. Move the rest within #ifdef __KERNEL__

Signed-off-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] overcommit symbolic constants</title>
<updated>2004-09-30T01:41:37Z</updated>
<author>
<name>Andries E. Brouwer</name>
<email>andries.brouwer@cwi.nl</email>
</author>
<published>2004-09-30T01:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=237827056d5d9c86aab9e1f1d66eb4c9d0b6422c'/>
<id>urn:sha1:237827056d5d9c86aab9e1f1d66eb4c9d0b6422c</id>
<content type='text'>
Played a bit with overcommit the past hour.

Am not entirely satisfied with the no overcommit mode 2 -
programs segfault when the system is close to that boundary.
So, instead of the somewhat larger patch that I planned to send,
just symbolic names for the modes.
</content>
</entry>
<entry>
<title>[PATCH] document the macro for translating PROT_ to VM_ bits</title>
<updated>2003-10-05T04:03:09Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2003-10-05T04:03:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=62f75b2956e49a7c3aa58ac642f9acad193a2ac0'/>
<id>urn:sha1:62f75b2956e49a7c3aa58ac642f9acad193a2ac0</id>
<content type='text'>
From: Muli Ben-Yehuda &lt;mulix@mulix.org&gt;

Shed some much-needed light.
</content>
</entry>
<entry>
<title>[PATCH] Common PROT_xxx -&gt; VM_xxx mapping</title>
<updated>2003-09-05T04:42:15Z</updated>
<author>
<name>Jamie Lokier</name>
<email>jamie@shareable.org</email>
</author>
<published>2003-09-05T04:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d04668a76d3780540b30bcbc2bc638f3f31d577d'/>
<id>urn:sha1:d04668a76d3780540b30bcbc2bc638f3f31d577d</id>
<content type='text'>
This moves the mapping of PROT_* bits to VM_* bits from mmap.c to the
common header file &lt;linux/mman.h&gt;.  The mapping is needed for mprotect
too.
</content>
</entry>
<entry>
<title>[PATCH] Security hook for vm_enough_memory</title>
<updated>2003-07-02T15:49:35Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2003-07-02T15:49:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bc75ac4f1dcec256a65b531e2d5be84f5b0fe6bc'/>
<id>urn:sha1:bc75ac4f1dcec256a65b531e2d5be84f5b0fe6bc</id>
<content type='text'>
From: Stephen Smalley &lt;sds@epoch.ncsc.mil&gt;

This patch against 2.5.73 replaces vm_enough_memory with a security hook
per Alan Cox's suggestion so that security modules can completely replace
the logic if desired.

Note that the patch changes the interface to follow the convention of the
other security hooks, i.e.  return 0 if ok or -errno on failure (-ENOMEM in
this case) rather than returning a boolean.  It also exports various
variables and functions required for the vm_enough_memory logic.
</content>
</entry>
<entry>
<title>[PATCH] speed up vm_enough_memory()</title>
<updated>2003-03-22T15:33:34Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@digeo.com</email>
</author>
<published>2003-03-22T15:33:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=295808320a617ba627c96141d27193b295b55bd9'/>
<id>urn:sha1:295808320a617ba627c96141d27193b295b55bd9</id>
<content type='text'>
This function is called a lot.  Every brk().  The atomic_add() against a
global counter hurts on large SMP machines.

The patch simply reduces the rate at which that atomic operation is
performed, by accumulating a per-cpu count which is spilled into the global
counter when the local counter overflows.

It trades off efficiency for a little inaccuracy.

I tried various implementations involving kmalloc_percpu() and open-coded
per-cpu arrays in a generic "per-cpu counter" thing.  They all were
surprisingly sucky - the additional cache misses involved in walking the more
complex data structures really showed up.
</content>
</entry>
</feed>
