All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Helsley <matthltc@us.ibm.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Matt Helsley <matthltc@us.ibm.com>,
	xemul@parallels.com, containers@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, dave@linux.vnet.ibm.com,
	mingo@elte.hu, torvalds@linux-foundation.org
Subject: Re: [PATCH 14/38] Remove struct mm_struct::exe_file et al
Date: Mon, 1 Jun 2009 10:30:30 -0700	[thread overview]
Message-ID: <20090601173030.GL9285@us.ibm.com> (raw)
In-Reply-To: <20090531215427.GA29534@x200.localdomain>

On Mon, Jun 01, 2009 at 01:54:27AM +0400, Alexey Dobriyan wrote:
> On Tue, May 26, 2009 at 04:24:15PM -0700, Andrew Morton wrote:
> > On Tue, 26 May 2009 04:36:18 -0700
> > Matt Helsley <matthltc@us.ibm.com> wrote:
> > 
> > > I don't see any mention in the changelog of the point brought up by Ingo:
> > > 
> > > http://lkml.org/lkml/2009/4/10/105
> > 
> > Nor of Eric's comments.
> > 
> > Alexey, pleeeze don't do this.  We (read: I) heavily depend upon patch
> > submitters to keep track of outstanding issues and review comments,
> > etc.
> > 
> > If the patch submitter simply blows these things off then it devolves
> > to me having to keep track of each patch's issue list as well as the
> > patch itself.  My workload goes up by a factor of N and the error rate
> > goes up by N^2 :(
> 
> grmbh..
> 
> "Security" and "holding ->mmap_sem" were answered and dismissed.
> 
> You can't do readlink(2) on /proc/*/exe if you can't ptrace task.
> So no new possible holes are created.

Yes, I messed up: you answered the security question.

I still like that exe_file avoids the VMA walk with mmap_sem held. Holding
mmap_sem seems like a bigger performance difference than adding a branch
based on vm_flags in the VMA add/remove/split/merge code. Wouldn't vm_flags
be cache-hot? If so the typical cost added is an && and the branch
itself. Performance-related side effects of those are extra instruction fetches
and, perhaps most of all, typical branch costs like pipeline stalls and
flushes.

I suspect you could avoid most of the hypothesized performance difference
introduced by exe_file (if it's even measurable) by marking the branch
unlikely(). I guess that flag is unlikely since it's only applied
during exec by the kernel, the splits or removals of these areas are
probably near-constant in number, and they usually take place shortly after
exec anyway.

Of course if branch prediction hardware is very good then it may be
even better to leave these alone.

> 
> ->mmap_sem was held since /proc/*/exe was added and nobody cared.

"nobody cared" isn't a good reason to put it back. That kind of argument just
as easily supports exe_file: "I added code to the VMA paths and nobody cared."
Of course now you care about these changes to the VMA paths and I care
about holding mmap_sem...

> And, again, you can't readlink _any_ /proc/*/exe.

Yup. Sorry about that again.

In summary: I think the performance benefits of this patch have yet to be
established and really the only benefit I agree with is the nice reduction
in code.

Cheers,
	-Matt Helsley

  parent reply	other threads:[~2009-06-01 17:30 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 11:36 [PATCH 14/38] Remove struct mm_struct::exe_file et al Matt Helsley
     [not found] ` <20090526113618.GJ28083-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-26 23:24   ` Andrew Morton
2009-05-26 23:24 ` Andrew Morton
     [not found]   ` <20090526162415.fb9cefef.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2009-05-31 21:54     ` Alexey Dobriyan
2009-05-31 21:54       ` Alexey Dobriyan
     [not found]       ` <20090531215427.GA29534-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-05-31 22:19         ` Andrew Morton
2009-05-31 22:19           ` Andrew Morton
     [not found]           ` <20090531151953.8f8b14b5.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2009-05-31 23:15             ` Linus Torvalds
2009-05-31 23:15               ` Linus Torvalds
     [not found]               ` <alpine.LFD.2.01.0905311613260.3435-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-05-31 23:50                 ` Andrew Morton
2009-05-31 23:50                   ` Andrew Morton
     [not found]                   ` <20090531165026.376a914c.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2009-06-01  0:02                     ` Linus Torvalds
2009-06-01  0:02                       ` Linus Torvalds
2009-06-03 23:04             ` [PATCH 1/9] exec_path 1/9: introduce ->exec_path and switch /proc/*/exe Alexey Dobriyan
2009-06-03 23:04               ` Alexey Dobriyan
     [not found]               ` <20090603230422.GB853-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-06-03 23:05                 ` [PATCH 2/9] exec_path 2/9: switch audit to ->exec_path Alexey Dobriyan
2009-06-03 23:05                 ` [PATCH 3/9] exec_path 3/9: switch TOMOYO " Alexey Dobriyan
2009-06-03 23:05                   ` Alexey Dobriyan
2009-06-03 23:06                 ` [PATCH 4/9] exec_path 4/9: switch oprofile " Alexey Dobriyan
2009-06-03 23:06                   ` Alexey Dobriyan
2009-06-03 23:06                 ` [PATCH 5/9] exec_path 5/9: make struct spu_context::owner task_struct Alexey Dobriyan
2009-06-03 23:06                 ` [PATCH 6/9] exec_path 6/9: add struct spu::tsk Alexey Dobriyan
2009-06-03 23:06                   ` Alexey Dobriyan
2009-06-03 23:07                 ` [PATCH 7/9] exec_path 7/9: switch cell SPU thing to ->exec_path Alexey Dobriyan
2009-06-03 23:07                 ` [PATCH 8/9] exec_path 8/9: remove ->exe_file et al Alexey Dobriyan
2009-06-03 23:08                 ` [PATCH 9/9] exec_path 9/9: remove VM_EXECUTABLE Alexey Dobriyan
2009-06-03 23:36                 ` [PATCH 1/9] exec_path 1/9: introduce ->exec_path and switch /proc/*/exe Linus Torvalds
2009-06-04  7:55                 ` Matt Helsley
2009-06-05 10:45                 ` Christoph Hellwig
2009-06-06  7:22                 ` Al Viro
2009-06-03 23:05               ` [PATCH 2/9] exec_path 2/9: switch audit to ->exec_path Alexey Dobriyan
2009-06-03 23:06               ` [PATCH 5/9] exec_path 5/9: make struct spu_context::owner task_struct Alexey Dobriyan
2009-06-03 23:07               ` [PATCH 7/9] exec_path 7/9: switch cell SPU thing to ->exec_path Alexey Dobriyan
2009-06-03 23:07               ` [PATCH 8/9] exec_path 8/9: remove ->exe_file et al Alexey Dobriyan
2009-06-03 23:08               ` [PATCH 9/9] exec_path 9/9: remove VM_EXECUTABLE Alexey Dobriyan
     [not found]                 ` <20090603230810.GJ853-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-06-04  7:24                   ` Matt Helsley
2009-06-04  7:24                 ` Matt Helsley
2009-06-03 23:36               ` [PATCH 1/9] exec_path 1/9: introduce ->exec_path and switch /proc/*/exe Linus Torvalds
2009-06-04  7:55               ` Matt Helsley
2009-06-04  8:10                 ` Matt Helsley
     [not found]                 ` <20090604075532.GU9285-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-04  8:10                   ` Matt Helsley
2009-06-04 15:07                   ` Linus Torvalds
2009-06-04 15:07                 ` Linus Torvalds
2009-06-04 21:30                   ` Matt Helsley
     [not found]                     ` <20090604213033.GZ9285-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-04 22:42                       ` Alexey Dobriyan
2009-06-04 22:42                     ` Alexey Dobriyan
     [not found]                       ` <20090604224239.GA10666-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-06-05  3:49                         ` Matt Helsley
2009-06-05  3:49                       ` Matt Helsley
     [not found]                   ` <alpine.LFD.2.01.0906040803410.4880-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-06-04 21:30                     ` Matt Helsley
2009-06-05 10:45               ` Christoph Hellwig
     [not found]                 ` <20090605104517.GA11713-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2009-06-05 15:10                   ` Linus Torvalds
2009-06-05 15:10                 ` Linus Torvalds
2009-06-05 15:41                   ` Alexey Dobriyan
     [not found]                     ` <20090605154147.GA16766-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-06-05 15:49                       ` Linus Torvalds
2009-06-05 15:49                     ` Linus Torvalds
     [not found]                       ` <alpine.LFD.2.01.0906050848520.6847-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-06-05 16:09                         ` Alexey Dobriyan
2009-06-05 16:09                       ` Alexey Dobriyan
     [not found]                         ` <20090605160943.GA5262-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-06-05 16:48                           ` Linus Torvalds
2009-06-05 16:48                             ` Linus Torvalds
     [not found]                             ` <alpine.LFD.2.01.0906050942450.6847-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-06-05 17:46                               ` Alexey Dobriyan
2009-06-05 17:46                             ` Alexey Dobriyan
     [not found]                   ` <alpine.LFD.2.01.0906050808551.6847-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-06-05 15:41                     ` Alexey Dobriyan
2009-06-06  7:22               ` Al Viro
2009-06-15 22:10                 ` Alexey Dobriyan
     [not found]                 ` <20090606072244.GA13497-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2009-06-15 22:10                   ` Alexey Dobriyan
2009-06-01 17:30         ` [PATCH 14/38] Remove struct mm_struct::exe_file et al Matt Helsley
2009-06-01 17:30       ` Matt Helsley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-05-26 11:36 Matt Helsley
2009-05-22  4:54 [PATCH 01/38] cred: #include init.h in cred.h Alexey Dobriyan
2009-05-22  4:55 ` [PATCH 14/38] Remove struct mm_struct::exe_file et al Alexey Dobriyan
     [not found] ` <1242968132-1044-1-git-send-email-adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-05-22  4:55   ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090601173030.GL9285@us.ibm.com \
    --to=matthltc@us.ibm.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.