* Re: + mm-remove-struct-mm_struct-exe_file-et-al.patch added to -mm tree
[not found] <200903302344.n2UNi3xd027136@imap1.linux-foundation.org>
@ 2009-03-31 14:40 ` Oleg Nesterov
2009-04-01 0:32 ` Matt Helsley
0 siblings, 1 reply; 5+ messages in thread
From: Oleg Nesterov @ 2009-03-31 14:40 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, adobriyan, dhowells, ebiederm, hch, matthltc
s/mm-commits/lkml/
On 03/30, Andrew Morton wrote:
>
> From: Alexey Dobriyan <adobriyan@gmail.com>
>
> Commit 925d1c401fa6cfd0df5d2e37da8981494ccdec07 ("procfs task exe
> symlink"). introduced struct mm_struct::exe_file and struct
> mm_struct::num_exe_file_vmas.
>
> The rationale is weak: unifying MMU and no-MMU version of /proc/*/exe
> code. For this a) struct mm_struct becomes bigger, b) mmap/munmap/exit
> become slower, c) patch adds more code than removes in fact.
>
> ->exe_file maybe well defined, but doesn't make sense always. After
> original executable is unmapped, /proc/*/exe will still report it and,
> more importantly, pin corresponding struct file.
I never liked the change which introduced mm->exe_file, so I vote for
this patch.
But, as a advocatus diaboli... There was anotrher reason for ->exe_file,
iirc.
bprm->file->f_op->mmap() can change vma->vm_file, this means proc_exe_link()
can report the "wrong" path. The original file is not pinned in this case.
Matt?
Oleg.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: + mm-remove-struct-mm_struct-exe_file-et-al.patch added to -mm tree
2009-03-31 14:40 ` + mm-remove-struct-mm_struct-exe_file-et-al.patch added to -mm tree Oleg Nesterov
@ 2009-04-01 0:32 ` Matt Helsley
2009-04-01 1:13 ` Alexey Dobriyan
2009-04-01 1:40 ` Oleg Nesterov
0 siblings, 2 replies; 5+ messages in thread
From: Matt Helsley @ 2009-04-01 0:32 UTC (permalink / raw)
To: Oleg Nesterov
Cc: akpm, linux-kernel, adobriyan, dhowells, ebiederm, hch, matthltc
On Tue, Mar 31, 2009 at 04:40:51PM +0200, Oleg Nesterov wrote:
> s/mm-commits/lkml/
>
> On 03/30, Andrew Morton wrote:
> >
> > From: Alexey Dobriyan <adobriyan@gmail.com>
> >
> > Commit 925d1c401fa6cfd0df5d2e37da8981494ccdec07 ("procfs task exe
> > symlink"). introduced struct mm_struct::exe_file and struct
> > mm_struct::num_exe_file_vmas.
> >
> > The rationale is weak: unifying MMU and no-MMU version of /proc/*/exe
> > code. For this a) struct mm_struct becomes bigger, b) mmap/munmap/exit
> > become slower, c) patch adds more code than removes in fact.
> >
> > ->exe_file maybe well defined, but doesn't make sense always. After
> > original executable is unmapped, /proc/*/exe will still report it and,
> > more importantly, pin corresponding struct file.
>
> I never liked the change which introduced mm->exe_file, so I vote for
> this patch.
>
> But, as a advocatus diaboli... There was anotrher reason for ->exe_file,
> iirc.
>
> bprm->file->f_op->mmap() can change vma->vm_file, this means proc_exe_link()
> can report the "wrong" path. The original file is not pinned in this case.
>
> Matt?
That's _my_ reason for it. However no mainline code does that and hence it was
not the reason Andrew accepted it.
I still prefer ->exe_file because I think it's a win not to walk the
VMAs with mmap sem when doing a readlink on /proc/*/exe. It's also less
sensitive to the order in which VMAs appear should that ever change.
Cheers,
-Matt Helsley
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: + mm-remove-struct-mm_struct-exe_file-et-al.patch added to -mm tree
2009-04-01 0:32 ` Matt Helsley
@ 2009-04-01 1:13 ` Alexey Dobriyan
2009-04-01 12:55 ` David Howells
2009-04-01 1:40 ` Oleg Nesterov
1 sibling, 1 reply; 5+ messages in thread
From: Alexey Dobriyan @ 2009-04-01 1:13 UTC (permalink / raw)
To: Matt Helsley; +Cc: Oleg Nesterov, akpm, linux-kernel, dhowells, ebiederm, hch
On Tue, Mar 31, 2009 at 05:32:23PM -0700, Matt Helsley wrote:
> On Tue, Mar 31, 2009 at 04:40:51PM +0200, Oleg Nesterov wrote:
> > s/mm-commits/lkml/
> >
> > On 03/30, Andrew Morton wrote:
> > >
> > > From: Alexey Dobriyan <adobriyan@gmail.com>
> > >
> > > Commit 925d1c401fa6cfd0df5d2e37da8981494ccdec07 ("procfs task exe
> > > symlink"). introduced struct mm_struct::exe_file and struct
> > > mm_struct::num_exe_file_vmas.
> > >
> > > The rationale is weak: unifying MMU and no-MMU version of /proc/*/exe
> > > code. For this a) struct mm_struct becomes bigger, b) mmap/munmap/exit
> > > become slower, c) patch adds more code than removes in fact.
> > >
> > > ->exe_file maybe well defined, but doesn't make sense always. After
> > > original executable is unmapped, /proc/*/exe will still report it and,
> > > more importantly, pin corresponding struct file.
> >
> > I never liked the change which introduced mm->exe_file, so I vote for
> > this patch.
> >
> > But, as a advocatus diaboli... There was anotrher reason for ->exe_file,
> > iirc.
> >
> > bprm->file->f_op->mmap() can change vma->vm_file, this means proc_exe_link()
> > can report the "wrong" path. The original file is not pinned in this case.
> >
> > Matt?
>
> That's _my_ reason for it. However no mainline code does that and hence it was
> not the reason Andrew accepted it.
>
> I still prefer ->exe_file because I think it's a win not to walk the
> VMAs with mmap sem when doing a readlink on /proc/*/exe.
readlink on /proc/*/exe is rare, so nobody cares. ps(1) and top(1) here
don't readlink it, e. g. Number of vmas is usually small enough and, as
was mentioned, file is mapped low, so it'd be among the first VMAs.
> It's also less sensitive to the order in which VMAs appear should that ever
> change.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: + mm-remove-struct-mm_struct-exe_file-et-al.patch added to -mm tree
2009-04-01 0:32 ` Matt Helsley
2009-04-01 1:13 ` Alexey Dobriyan
@ 2009-04-01 1:40 ` Oleg Nesterov
1 sibling, 0 replies; 5+ messages in thread
From: Oleg Nesterov @ 2009-04-01 1:40 UTC (permalink / raw)
To: Matt Helsley; +Cc: akpm, linux-kernel, adobriyan, dhowells, ebiederm, hch
On 03/31, Matt Helsley wrote:
>
> On Tue, Mar 31, 2009 at 04:40:51PM +0200, Oleg Nesterov wrote:
> >
> > But, as a advocatus diaboli... There was anotrher reason for ->exe_file,
> > iirc.
> >
> > bprm->file->f_op->mmap() can change vma->vm_file, this means proc_exe_link()
> > can report the "wrong" path. The original file is not pinned in this case.
>
> That's _my_ reason for it. However no mainline code does that and hence it was
> not the reason Andrew accepted it.
Good.
> I still prefer ->exe_file because I think it's a win not to walk the
> VMAs with mmap sem when doing a readlink on /proc/*/exe. It's also less
> sensitive to the order in which VMAs appear should that ever change.
I agree with Alexey, I don't think the VMAs walking can be a problem.
But even if it is problem, we could make a much more simple patch
to avoid it? Just add "struct path exe_path" to ->mm, no?
Oleg.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: + mm-remove-struct-mm_struct-exe_file-et-al.patch added to -mm tree
2009-04-01 1:13 ` Alexey Dobriyan
@ 2009-04-01 12:55 ` David Howells
0 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2009-04-01 12:55 UTC (permalink / raw)
To: Alexey Dobriyan
Cc: dhowells, Matt Helsley, Oleg Nesterov, akpm, linux-kernel,
ebiederm, hch
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> and, as was mentioned, file is mapped low, so it'd be among the first VMAs.
Not so on NOMMU. The file is mapped wherever the allocator happens to throw up
a sufficient quantity of contiguous pages. It may not even be mapped in RAM.
David
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-01 12:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200903302344.n2UNi3xd027136@imap1.linux-foundation.org>
2009-03-31 14:40 ` + mm-remove-struct-mm_struct-exe_file-et-al.patch added to -mm tree Oleg Nesterov
2009-04-01 0:32 ` Matt Helsley
2009-04-01 1:13 ` Alexey Dobriyan
2009-04-01 12:55 ` David Howells
2009-04-01 1:40 ` Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox