* [patch] 2.5 vm bugfix
@ 2003-03-21 15:18 Gerd Knorr
2003-03-22 0:32 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Knorr @ 2003-03-21 15:18 UTC (permalink / raw)
To: Kernel List
Hi,
2.5.x kernels don't look at the VM_DONTEXPAND flag when merging
multiple vmas into one. Fix below.
Gerd
--- linux-2.5.65/mm/mmap.c 2003-03-21 13:03:28.377764776 +0100
+++ linux/mm/mmap.c 2003-03-21 13:09:52.981296152 +0100
@@ -379,6 +379,8 @@
can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags,
struct file *file, unsigned long vm_pgoff, unsigned long size)
{
+ if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND))
+ return 0;
if (vma->vm_file == file && vma->vm_flags == vm_flags) {
if (!file)
return 1; /* anon mapping */
@@ -396,6 +398,8 @@
can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
struct file *file, unsigned long vm_pgoff)
{
+ if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND))
+ return 0;
if (vma->vm_file == file && vma->vm_flags == vm_flags) {
unsigned long vma_size;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] 2.5 vm bugfix
2003-03-21 15:18 [patch] 2.5 vm bugfix Gerd Knorr
@ 2003-03-22 0:32 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2003-03-22 0:32 UTC (permalink / raw)
To: Gerd Knorr; +Cc: linux-kernel
Gerd Knorr <kraxel@bytesex.org> wrote:
>
> Hi,
>
> 2.5.x kernels don't look at the VM_DONTEXPAND flag when merging
> multiple vmas into one. Fix below.
There is but one user of VM_DONTEXPAND in the kernel, and that is you ;)
Can you describe exactly why this driver requires DONTEXPAND? ie: how does
the driver work, and why is it special?
If there is some alternative way of providing the same behaviour we could
remove VM_DONTEXPAND, which would be nice.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-21 22:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21 15:18 [patch] 2.5 vm bugfix Gerd Knorr
2003-03-22 0:32 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).