[PATCH v3 0/1] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-10-27 Thread Piotr Kwapulinski
ated tests done. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- Changes since V2: Information from Documentation/vm/numa_memory_policy.txt removed. Please let me know what else I should do to let this patch to be accepted. --- mm/mempolicy.c | 4 +++- 1 file changed, 3

[PATCH v3 0/1] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-10-27 Thread Piotr Kwapulinski
ated tests done. Signed-off-by: Piotr Kwapulinski --- Changes since V2: Information from Documentation/vm/numa_memory_policy.txt removed. Please let me know what else I should do to let this patch to be accepted. --- mm/mempolicy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

Re: Rewording language in mbind(2) to "threads" not "processes"

2016-10-25 Thread Piotr Kwapulinski
Hi Michael, I spent a couple of hours trying to review your patch. Unfortunately nowadays I spend no more than an hour per day for whole my linux kernel activity. It may take longer time for me to review it. This patch touches some areas of the kernel I'm still not an expert of (though I'm

Re: Rewording language in mbind(2) to "threads" not "processes"

2016-10-25 Thread Piotr Kwapulinski
Hi Michael, I spent a couple of hours trying to review your patch. Unfortunately nowadays I spend no more than an hour per day for whole my linux kernel activity. It may take longer time for me to review it. This patch touches some areas of the kernel I'm still not an expert of (though I'm

Re: [PATCH v3 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-10-12 Thread Piotr Kwapulinski
Hi Michael, On Wed, Oct 12, 2016 at 09:55:16AM +0200, Michael Kerrisk (man-pages) wrote: > Hello Piotr, > > On 10/10/2016 06:23 PM, Piotr Kwapulinski wrote: > > The MPOL_LOCAL mode has been implemented by > > Peter Zijlstra <a.p.zijls..

Re: [PATCH v3 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-10-12 Thread Piotr Kwapulinski
Hi Michael, On Wed, Oct 12, 2016 at 09:55:16AM +0200, Michael Kerrisk (man-pages) wrote: > Hello Piotr, > > On 10/10/2016 06:23 PM, Piotr Kwapulinski wrote: > > The MPOL_LOCAL mode has been implemented by > > Peter Zijlstra > > (commit: 479e2802d09f1e18a97262c

[PATCH v3 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-10-10 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra <a.p.zijls...@chello.nl> (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- This version fixes grammar --- man2/mbind.2

[PATCH v3 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-10-10 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski --- This version fixes grammar --- man2/mbind.2 | 28 man2/set_mempolicy.2

[PATCH v2 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-10-09 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra <a.p.zijls...@chello.nl> (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- This version adds more details about MPOL_L

[PATCH v2 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-10-09 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski --- This version adds more details about MPOL_LOCAL mode: 1. difference between MPOL_LOCAL and MPOL_DEFAULT 2

[PATCH 1/1] man/set_mempolicy.2,mbind.2: forbid static or relative flags for local NUMA mode

2016-09-27 Thread Piotr Kwapulinski
Add documentation for the following patch: [PATCH v2 0/1] mm/mempolicy.c: forbid static or relative flags for local NUMA mode Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- man2/mbind.2 | 35 +++ man2/set_mempolicy.

[PATCH 1/1] man/set_mempolicy.2,mbind.2: forbid static or relative flags for local NUMA mode

2016-09-27 Thread Piotr Kwapulinski
Add documentation for the following patch: [PATCH v2 0/1] mm/mempolicy.c: forbid static or relative flags for local NUMA mode Signed-off-by: Piotr Kwapulinski --- man2/mbind.2 | 35 +++ man2/set_mempolicy.2 | 35 +++ 2

[PATCH v2 0/1] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-27 Thread Piotr Kwapulinski
ated tests done. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- Changes since V1: Adds "mbind" to changelog. Updates numa_memory_policy.txt. Based on more recent kernel version. The following patch updates man-pages: [PATCH 1/1] man/set_mempolicy.2,mbind.2:

[PATCH v2 0/1] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-27 Thread Piotr Kwapulinski
ated tests done. Signed-off-by: Piotr Kwapulinski --- Changes since V1: Adds "mbind" to changelog. Updates numa_memory_policy.txt. Based on more recent kernel version. The following patch updates man-pages: [PATCH 1/1] man/set_mempolicy.2,mbind.2: forbid static or relative flags

[PATCH 1/1] mm/mempolicy.c: add MPOL_LOCAL NUMA memory policy documentation

2016-09-27 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra <a.p.zijls...@chello.nl> (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- Documentation/vm/numa_memory_policy.txt | 8

[PATCH 1/1] mm/mempolicy.c: add MPOL_LOCAL NUMA memory policy documentation

2016-09-27 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski --- Documentation/vm/numa_memory_policy.txt | 8 mm/mempolicy.c | 4 2

[PATCH 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-09-27 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra <a.p.zijls...@chello.nl> (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- man2/mbind.2 | 16 ++

[PATCH 0/1] man/set_mempolicy.2,mbind.2: add MPOL_LOCAL NUMA memory policy documentation

2016-09-27 Thread Piotr Kwapulinski
The MPOL_LOCAL mode has been implemented by Peter Zijlstra (commit: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8). Add the documentation for this mode. Signed-off-by: Piotr Kwapulinski --- man2/mbind.2 | 16 man2/set_mempolicy.2 | 11 ++- 2 files changed, 22

Re: [PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-20 Thread Piotr Kwapulinski
Also I noticed that MPOL_NUMA > itself is missing in the man page... > > On 09/18/2016 01:29 PM, Piotr Kwapulinski wrote: > > The MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES flags are irrelevant > > when setting them for MPOL_LOCAL NUMA memory policy via set_mempolicy. &

Re: [PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-20 Thread Piotr Kwapulinski
Also I noticed that MPOL_NUMA > itself is missing in the man page... > > On 09/18/2016 01:29 PM, Piotr Kwapulinski wrote: > > The MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES flags are irrelevant > > when setting them for MPOL_LOCAL NUMA memory policy via set_mempolicy. &

Re: [PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-20 Thread Piotr Kwapulinski
On Mon, Sep 19, 2016 at 05:57:17PM -0700, David Rientjes wrote: > On Sun, 18 Sep 2016, Piotr Kwapulinski wrote: > > > The MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES flags are irrelevant > > when setting them for MPOL_LOCAL NUMA memory policy via set_mempolicy. > > Retu

Re: [PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-20 Thread Piotr Kwapulinski
On Mon, Sep 19, 2016 at 05:57:17PM -0700, David Rientjes wrote: > On Sun, 18 Sep 2016, Piotr Kwapulinski wrote: > > > The MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES flags are irrelevant > > when setting them for MPOL_LOCAL NUMA memory policy via set_mempolicy. > > Retu

Re: [PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-20 Thread Piotr Kwapulinski
On Mon, Sep 19, 2016 at 01:52:05PM +0200, Michal Hocko wrote: > On Sun 18-09-16 13:29:43, Piotr Kwapulinski wrote: > > The MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES flags are irrelevant > > when setting them for MPOL_LOCAL NUMA memory policy via set_mempolicy. > > Return

Re: [PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-20 Thread Piotr Kwapulinski
On Mon, Sep 19, 2016 at 01:52:05PM +0200, Michal Hocko wrote: > On Sun 18-09-16 13:29:43, Piotr Kwapulinski wrote: > > The MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES flags are irrelevant > > when setting them for MPOL_LOCAL NUMA memory policy via set_mempolicy. > > Return

[PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-18 Thread Piotr Kwapulinski
e. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- mm/mempolicy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 2da72a5..27b07d1 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -276,7 +276,9 @@ static

[PATCH] mm/mempolicy.c: forbid static or relative flags for local NUMA mode

2016-09-18 Thread Piotr Kwapulinski
e. Signed-off-by: Piotr Kwapulinski --- mm/mempolicy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 2da72a5..27b07d1 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -276,7 +276,9 @@ static struct mempolicy *mpol_new(unsigned

Re: [PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-08 Thread Piotr Kwapulinski
On Thu, Apr 07, 2016 at 06:31:09PM +0200, Michal Hocko wrote: > On Thu 07-04-16 18:11:29, Piotr Kwapulinski wrote: > > On Mon, Apr 04, 2016 at 05:26:43PM +0200, Vlastimil Babka wrote: > > > On 04/04/2016 09:31 AM, Michal Hocko wrote: > > > >On Sat 02-04-16 21:

Re: [PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-08 Thread Piotr Kwapulinski
On Thu, Apr 07, 2016 at 06:31:09PM +0200, Michal Hocko wrote: > On Thu 07-04-16 18:11:29, Piotr Kwapulinski wrote: > > On Mon, Apr 04, 2016 at 05:26:43PM +0200, Vlastimil Babka wrote: > > > On 04/04/2016 09:31 AM, Michal Hocko wrote: > > > >On Sat 02-04-16 21:

Re: [PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-07 Thread Piotr Kwapulinski
On Mon, Apr 04, 2016 at 05:26:43PM +0200, Vlastimil Babka wrote: > On 04/04/2016 09:31 AM, Michal Hocko wrote: > >On Sat 02-04-16 21:17:31, Piotr Kwapulinski wrote: > >>Currently the mmap(MAP_FIXED) discards the overlapping part of the > >>existing VMA(s). > >>

Re: [PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-07 Thread Piotr Kwapulinski
On Mon, Apr 04, 2016 at 05:26:43PM +0200, Vlastimil Babka wrote: > On 04/04/2016 09:31 AM, Michal Hocko wrote: > >On Sat 02-04-16 21:17:31, Piotr Kwapulinski wrote: > >>Currently the mmap(MAP_FIXED) discards the overlapping part of the > >>existing VMA(s). > >>

Re: [PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-07 Thread Piotr Kwapulinski
On Mon, Apr 04, 2016 at 05:26:43PM +0200, Vlastimil Babka wrote: > On 04/04/2016 09:31 AM, Michal Hocko wrote: > >On Sat 02-04-16 21:17:31, Piotr Kwapulinski wrote: > >>Currently the mmap(MAP_FIXED) discards the overlapping part of the > >>existing VMA(s). > >>

Re: [PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-07 Thread Piotr Kwapulinski
On Mon, Apr 04, 2016 at 05:26:43PM +0200, Vlastimil Babka wrote: > On 04/04/2016 09:31 AM, Michal Hocko wrote: > >On Sat 02-04-16 21:17:31, Piotr Kwapulinski wrote: > >>Currently the mmap(MAP_FIXED) discards the overlapping part of the > >>existing VMA(s). > >>

[PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
flag right before unmapping the VMA. The tile arch is the dependency of mmap_flags. I did the isolated tests and also tested it with Gentoo full installation. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- arch/tile/mm/elf.c | 1 + include/linu

[PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
flag right before unmapping the VMA. The tile arch is the dependency of mmap_flags. I did the isolated tests and also tested it with Gentoo full installation. Signed-off-by: Piotr Kwapulinski --- arch/tile/mm/elf.c | 1 + include/linux/mm.h | 3

[PATCH 3/3] man/mremap.2: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
mremap.2 man page update for MREAP_DONTUNMAP flag of mremap. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- It should be considered to be merged only in case the patch "[PATCH 2/3] mm/mremap.c: don't unmap the overlapping VMA(s)" is merged. --- ma

[PATCH 1/3] man/mmap.2: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
mmap.2 man page update for MAP_DONTUNMAP flag of mmap. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- It should be considered to be merged only in case the patch "[PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)" is merged. ---

[PATCH 3/3] man/mremap.2: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
mremap.2 man page update for MREAP_DONTUNMAP flag of mremap. Signed-off-by: Piotr Kwapulinski --- It should be considered to be merged only in case the patch "[PATCH 2/3] mm/mremap.c: don't unmap the overlapping VMA(s)" is merged. --- man2/mre

[PATCH 1/3] man/mmap.2: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
mmap.2 man page update for MAP_DONTUNMAP flag of mmap. Signed-off-by: Piotr Kwapulinski --- It should be considered to be merged only in case the patch "[PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)" is merged. --- man2/mmap.2 | 32 ++-- 1 fi

[PATCH 2/3] mm/mremap.c: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
occurs. No existing mapping(s) is discarded. The implementation tests the MAP_DONTUNMAP flag and scans the AS for the overlapping VMA(s) right before unmapping the area. I did the isolated tests and also tested it with Gentoo full installation. Signed-off-by: Piotr Kwapulinski <kwapulinski

[PATCH 2/3] mm/mremap.c: don't unmap the overlapping VMA(s)

2016-04-02 Thread Piotr Kwapulinski
occurs. No existing mapping(s) is discarded. The implementation tests the MAP_DONTUNMAP flag and scans the AS for the overlapping VMA(s) right before unmapping the area. I did the isolated tests and also tested it with Gentoo full installation. Signed-off-by: Piotr Kwapulinski --- include/uapi/linux

Re: [PATCH v2] mm/mprotect.c: don't imply PROT_EXEC on non-exec fs

2016-02-28 Thread Piotr Kwapulinski
On Fri, Feb 26, 2016 at 12:20:32PM -0800, Andrew Morton wrote: > On Wed, 27 Jan 2016 17:29:37 +0100 Piotr Kwapulinski > <kwapulinski.pi...@gmail.com> wrote: > > > The mprotect(PROT_READ) fails when called by the READ_IMPLIES_EXEC binary > > on a memory mapped

Re: [PATCH v2] mm/mprotect.c: don't imply PROT_EXEC on non-exec fs

2016-02-28 Thread Piotr Kwapulinski
On Fri, Feb 26, 2016 at 12:20:32PM -0800, Andrew Morton wrote: > On Wed, 27 Jan 2016 17:29:37 +0100 Piotr Kwapulinski > wrote: > > > The mprotect(PROT_READ) fails when called by the READ_IMPLIES_EXEC binary > > on a memory mapped file located on non-exec fs. The mprote

[PATCH v2] mm/mprotect.c: don't imply PROT_EXEC on non-exec fs

2016-01-27 Thread Piotr Kwapulinski
the official 3.19.0-47-generic Ubuntu 14.04 kernel and it seems to work. Signed-off-by: Piotr Kwapulinski --- The difference between v1 is that the prot variable is reset to reqprot for each loop iteration (thanks to Konstantin Khlebnikov for pointing this out). rier means "(current->per

[PATCH v2] mm/mprotect.c: don't imply PROT_EXEC on non-exec fs

2016-01-27 Thread Piotr Kwapulinski
the official 3.19.0-47-generic Ubuntu 14.04 kernel and it seems to work. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- The difference between v1 is that the prot variable is reset to reqprot for each loop iteration (thanks to Konstantin Khlebnikov for pointing this out)

Re: [PATCH v3] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-24 Thread Piotr Kwapulinski
On Mon, Nov 23, 2015 at 02:14:01PM -0800, Andrew Morton wrote: > On Mon, 23 Nov 2015 18:36:42 +0100 Piotr Kwapulinski > wrote: > > > The following flag comparison in mmap_region makes no sense: > > > > if (!(vm_flags & MAP_FIXED)) > > return -ENOMEM; &

Re: [PATCH v3] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-24 Thread Piotr Kwapulinski
On Mon, Nov 23, 2015 at 02:14:01PM -0800, Andrew Morton wrote: > On Mon, 23 Nov 2015 18:36:42 +0100 Piotr Kwapulinski > <kwapulinski.pi...@gmail.com> wrote: > > > The following flag comparison in mmap_region makes no sense: > > > > if (!(vm_flags &am

[PATCH v3] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-23 Thread Piotr Kwapulinski
pared with VM_* flags. MAP_FIXED has the same value as VM_MAYREAD. Hitting the rlimit is a slow path and find_vma_intersection should realize that there is no overlapping VMA for !MAP_FIXED case pretty quickly. Remove the code that makes no sense. Signed-off-by: Piotr Kwapulinski --- mm/mmap.c |

[PATCH v3] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-23 Thread Piotr Kwapulinski
pared with VM_* flags. MAP_FIXED has the same value as VM_MAYREAD. Hitting the rlimit is a slow path and find_vma_intersection should realize that there is no overlapping VMA for !MAP_FIXED case pretty quickly. Remove the code that makes no sense. Signed-off-by: Piotr Kwapulinski <kwapulinsk

[PATCH v2 2/2] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-20 Thread Piotr Kwapulinski
pared with VM_* flags. MAP_FIXED has the same value as VM_MAYREAD. It has no user visible effect. Remove the code that makes no sense. Signed-off-by: Piotr Kwapulinski --- I made a mistake in a changelog in a previous version of this patch. I'm Sorry for the confusion. This patch may be considered

[PATCH v2 1/2] mm: fix incorrect behavior when process virtual address space limit is exceeded

2015-11-20 Thread Piotr Kwapulinski
its arch_setup_additional_pages as the user of mmap_region has to be specific about its mmap flags now. Signed-off-by: Piotr Kwapulinski --- arch/tile/mm/elf.c | 1 + include/linux/mm.h | 3 ++- mm/mmap.c | 7 --- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/tile/mm/e

[PATCH v2 1/2] mm: fix incorrect behavior when process virtual address space limit is exceeded

2015-11-20 Thread Piotr Kwapulinski
its arch_setup_additional_pages as the user of mmap_region has to be specific about its mmap flags now. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- arch/tile/mm/elf.c | 1 + include/linux/mm.h | 3 ++- mm/mmap.c | 7 --- 3 files changed, 7 insertions(+), 4

[PATCH v2 2/2] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-20 Thread Piotr Kwapulinski
pared with VM_* flags. MAP_FIXED has the same value as VM_MAYREAD. It has no user visible effect. Remove the code that makes no sense. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- I made a mistake in a changelog in a previous version of this patch. I'm Sorry for the confu

Re: [PATCH] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-18 Thread Piotr Kwapulinski
On Tue, Nov 17, 2015 at 04:52:51PM -0800, Andrew Morton wrote: > On Tue, 17 Nov 2015 18:26:38 +0100 Piotr Kwapulinski > wrote: > > > The following flag comparison in mmap_region is not fully correct: > > > > if (!(vm_flags & MAP_FIXED)) > > &g

Re: [PATCH] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-18 Thread Piotr Kwapulinski
On Tue, Nov 17, 2015 at 04:52:51PM -0800, Andrew Morton wrote: > On Tue, 17 Nov 2015 18:26:38 +0100 Piotr Kwapulinski > <kwapulinski.pi...@gmail.com> wrote: > > > The following flag comparison in mmap_region is not fully correct: > > > > if (!(vm_flags & MAP

[PATCH] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-17 Thread Piotr Kwapulinski
oves this condition. Signed-off-by: Piotr Kwapulinski --- mm/mmap.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 2ce04a6..02422ea 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1547,13 +1547,6 @@ unsigned long mmap_region(struct file *file, unsigned long

[PATCH] mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region

2015-11-17 Thread Piotr Kwapulinski
oves this condition. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- mm/mmap.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 2ce04a6..02422ea 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1547,13 +1547,6 @@ unsigned long mmap_region(s

[PATCH] mm: fix incorrect behavior when process virtual address space limit is exceeded

2015-11-16 Thread Piotr Kwapulinski
lag only is sufficient. However the MAP_ANONYMOUS and MAP_PRIVATE flags are passed for the completeness of the solution. Signed-off-by: Piotr Kwapulinski --- arch/tile/mm/elf.c | 1 + include/linux/mm.h | 3 ++- mm/mmap.c | 7 --- 3 files changed, 7 insertions(+), 4 deletions(-) di

[PATCH] mm: fix incorrect behavior when process virtual address space limit is exceeded

2015-11-16 Thread Piotr Kwapulinski
lag only is sufficient. However the MAP_ANONYMOUS and MAP_PRIVATE flags are passed for the completeness of the solution. Signed-off-by: Piotr Kwapulinski <kwapulinski.pi...@gmail.com> --- arch/tile/mm/elf.c | 1 + include/linux/mm.h | 3 ++- mm/mmap.c | 7 --- 3 files changed

[PATCH] mm/mmap.c: optimization of do_mmap_pgoff function

2015-06-06 Thread Piotr Kwapulinski
The simple check for zero length memory mapping may be performed earlier. It causes that in case of zero length memory mapping some unnecessary code is not executed at all. It does not make the code less readable and saves some CPU cycles. Signed-off-by: Piotr Kwapulinski --- mm/mmap.c | 6

[PATCH] mm/mmap.c: optimization of do_mmap_pgoff function

2015-06-06 Thread Piotr Kwapulinski
The simple check for zero length memory mapping may be performed earlier. It causes that in case of zero length memory mapping some unnecessary code is not executed at all. It does not make the code less readable and saves some CPU cycles. Signed-off-by: Piotr Kwapulinski kwapulinski.pi