From: ebiederm@xmission.com (Eric W. Biederman)
To: Ingo Molnar <mingo@elte.hu>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
Matt Helsley <matthltc@us.ibm.com>,
yamamoto@valinux.co.jp, Peter Zijlstra <a.p.zijlstra@chello.nl>,
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 09:22:28 -0700 [thread overview]
Message-ID: <m1ljq8eawr.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20090410085305.GC17962@elte.hu> (Ingo Molnar's message of "Fri\, 10 Apr 2009 10\:53\:05 +0200")
Ingo Molnar <mingo@elte.hu> writes:
> * 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.
There is also Andrew Morton's suggestion of just keeping a struct path
in mm_struct instead of struct file. That should be the best of both
worlds.
Eric
prev parent reply other threads:[~2009-04-10 16:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-10 2:33 Alexey Dobriyan
2009-04-10 3:33 ` Matt Helsley
2009-04-10 8:53 ` Ingo Molnar
2009-04-10 16:22 ` Eric W. Biederman [this message]
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=m1ljq8eawr.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--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=mingo@elte.hu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome