Re: [PATCH 1/9] exec: add a global execve counter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 11, 2012 at 10:25 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> It should be per-process, signal_struct makes more sense. Or may be
> mm_struct.

I do wonder if we shouldn't just consider the "struct mm_struct"
pointer to *be* the unique exec ID. It's what /proc/pid/mem does, and
it works fine, and allows us to just use a normal pointer as the
unique ID.

Just increment the mm_count for the thing, and hold a reference to it,
and now you're all done.

By definition an execve() will change the mm struct, and if you have a
refcount to the old one, it won't be re-used. And it's not a huge
allocation, although it would definitely be good to put that thing on
a diet.

And as long as we use 'mm_count', not 'mm_users', it won't pin
anything else in memory. That's part of the whole point of the
doubly-refcounted thing.

                      Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux