Re: [PATCH -mm] vmscan: make mapped executable pages the firstclass citizen

From: Andrew Morton
Date: Thu May 07 2009 - 16:51:35 EST


On Thu, 7 May 2009 17:10:39 +0200
Johannes Weiner <hannes@xxxxxxxxxxx> wrote:

> > +++ linux/mm/nommu.c
> > @@ -1224,6 +1224,8 @@ unsigned long do_mmap_pgoff(struct file
> > added_exe_file_vma(current->mm);
> > vma->vm_mm = current->mm;
> > }
> > + if (vm_flags & VM_EXEC)
> > + set_bit(AS_EXEC, &file->f_mapping->flags);
> > }
>
> I find it a bit ugly that it applies an attribute of the memory area
> (per mm) to the page cache mapping (shared). Because this in turn
> means that the reference through a non-executable vma might get the
> pages rotated just because there is/was an executable mmap around.

Yes, it's not good. That AS_EXEC bit will hang around for arbitrarily
long periods in the inode cache. So we'll have AS_EXEC set on an
entire file because someone mapped some of it with PROT_EXEC half an
hour ago. Where's the sense in that?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/