All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alexey Dobriyan <adobriyan@gmail.com>,
	Matt Helsley <matthltc@us.ibm.com>,
	yamamoto@valinux.co.jp, Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: akpm@linux-foundation.org, containers@lists.linux-foundation.org,
	xemul@parallels.com, serue@us.ibm.com, dave@linux.vnet.ibm.com,
	orenl@cs.columbia.edu, hch@infradead.org,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/30] Remove struct mm_struct::exe_file et al
Date: Fri, 10 Apr 2009 10:53:05 +0200	[thread overview]
Message-ID: <20090410085305.GC17962@elte.hu> (raw)
In-Reply-To: <20090410023312.GC27788@x200.localdomain>


* Alexey Dobriyan <adobriyan@gmail.com> wrote:

> Commit 925d1c401fa6cfd0df5d2e37da8981494ccdec07 aka "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.

Hm, nommu unification was not the only effect of that original 
patch.

The other effect was to introduce a managed 'which is the first 
executable vma in the mm' abstraction in struct mm. Your patch 
removes that abstraction and re-introduces a linear ->vma_next walk:

> +	down_read(&mm->mmap_sem);
> +	for (vma = mm->mmap; vma; vma = vma->vm_next) {
> +		if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file) {

Which can walk along thousands (or tens of thousands) of vmas until 
it finds the first executable vma. For example on PIE binaries it's 
quite possible to have a lot of non-PROT_EXEC vmas before the first 
EXEC vma is met.

So your revert reintroduces that linear walk. It might not matter 
much (/proc/*/exe might be sufficiently uninteresting in practice to 
not deserve an optimization), but it's still worth a mention and a 
discussion in the changelog.

Thanks,

	Ingo

  parent reply	other threads:[~2009-04-10  8:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10  2:33 [PATCH 02/30] Remove struct mm_struct::exe_file et al Alexey Dobriyan
2009-04-10  2:33 ` Alexey Dobriyan
     [not found] ` <20090410023312.GC27788-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-04-10  3:33   ` Matt Helsley
2009-04-10  8:53   ` Ingo Molnar
2009-04-10  3:33 ` Matt Helsley
2009-04-10  3:33   ` Matt Helsley
2009-04-10  8:53 ` Ingo Molnar [this message]
     [not found]   ` <20090410085305.GC17962-X9Un+BFzKDI@public.gmane.org>
2009-04-10 16:22     ` Eric W. Biederman
2009-04-10 16:22   ` Eric W. Biederman

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=20090410085305.GC17962@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthltc@us.ibm.com \
    --cc=orenl@cs.columbia.edu \
    --cc=serue@us.ibm.com \
    --cc=torvalds@linux-foundation.org \
    --cc=xemul@parallels.com \
    --cc=yamamoto@valinux.co.jp \
    /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.