Re: [PATCH 14/38] Remove struct mm_struct::exe_file et al

From: Matt Helsley
Date: Tue May 26 2009 - 07:36:30 EST

I don't see any mention in the changelog of the point brought up by Ingo:

You also haven't responded to my comment about holding mmap

Also, please consider combining with Ingo's point with mine: the mmap
semaphore will be held for the duration of that long VMA walk. Plus
any userspace task can trigger that walk as often as they like via

It also appears you haven't responded to Eric and Andrew's suggestion
of a struct path in place of a file reference:

Lastly, please keep me on Cc for future revisions of this patch since
I am interested in following changes to the implementation of

-Matt Helsley

----- Forwarded message from Alexey Dobriyan <adobriyan@xxxxxxxxx> -----

From: Alexey Dobriyan <adobriyan@xxxxxxxxx>
To: akpm@xxxxxxxxxxxxxxxxxxxx
Subject: [PATCH 14/38] Remove struct mm_struct::exe_file et al
Date: Fri, 22 May 2009 08:55:08 +0400
Cc: xemul@xxxxxxxxxxxxx, containers@xxxxxxxxxxxxxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx, dave@xxxxxxxxxxxxxxxxxx,
mingo@xxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx,
Alexey Dobriyan <adobriyan@xxxxxxxxx>

Commit 925d1c401fa6cfd0df5d2e37da8981494ccdec07 aka "procfs task exe
introduced struct mm_struct::exe_file and struct

The rationale is weak: unifying MMU and no-MMU version of /proc/*/exe
For this a) struct mm_struct becomes bigger, b) mmap/munmap/exit become
c) patch adds more code than removes in fact.

After commit 8feae13110d60cc6287afabc2887366b0eb226c2 aka
"NOMMU: Make VMAs per MM as for MMU-mode linux" no-MMU kernels also
maintain list of VMAs in ->mmap, so we can switch back for MMU version
of /proc/*/exe.

This also helps C/R, no need to save and restore ->exe_file and to count
additional references to check if there is a leak of struct file outside
group of checkpointed resources.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
fs/exec.c | 2 -
fs/proc/base.c | 105
include/linux/mm.h | 12 -----
include/linux/mm_types.h | 6 ---
include/linux/proc_fs.h | 20 ---------
kernel/fork.c | 3 -
mm/mmap.c | 22 ++--------
mm/nommu.c | 16 +------
8 files changed, 36 insertions(+), 150 deletions(-)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at