Re: [PATCH] TOMOYO: Add garbage collector support. (v2)

From: Tetsuo Handa
Date: Sun May 24 2009 - 20:37:37 EST


------- Forwarded Message

Serge E. Hallyn wrote:
> Quoting Tetsuo Handa (penguin-kernel@xxxxxxxxxxxxxxxxxxx):
> > James Morris wrote:
> > > On Thu, 14 May 2009, Tetsuo Handa wrote:
> > >
> > > > ---
> > > > security/tomoyo/common.c | 456 +++++++++++++++++++-----------------
> > > > security/tomoyo/common.h | 134 ++++++++--
> > > > security/tomoyo/domain.c | 437 +++++++++++++---------------------
> > > > security/tomoyo/file.c | 369 +++++++++++++++--------------
> > > > security/tomoyo/realpath.c | 567 ++++++++++++++++++++++++++++++++++-----------
> > > > security/tomoyo/realpath.h | 25 +
> > > > security/tomoyo/tomoyo.c | 40 +--
> > > > security/tomoyo/tomoyo.h | 13 -
> > > > 8 files changed, 1190 insertions(+), 851 deletions(-)
> > >
> > > This seems like an awfully large and invasive patch just to add GC support
> > > which you didn't originally didn't think was necessary.
> > >
> > > I think it needs review from people outside of your project.
> >
> > I see. Would somebody please review?
>
> Please resend to me privately. (I've deleted it)
>
> -serge
>
Sure.

The key points are:

(1) Should TOMOYO avoid sleeping operations inside a semaphore?

Until #14, TOMOYO was using singly linked list and thus reader process
did not require any locks. But in #15, TOMOYO is using standard doubly
linked list and thus reader process requires a semaphore. This might
dull the system's response. In this patch, I moved sleeping operations
(i.e. kmalloc(GFP_KERNEL)/kfree()) to outside the semaphore protected
code.

(2) Should TOMOYO have GC support?

Several reviewers had been asking me that TOMOYO should release memory
used by deleted policy. At first, I didn't feel it is necessary. But in
#15, TOMOYO uses standard doubly linked list and getting close to be able
to know whether there is a reader process or not. Also, I changed to use
kmalloc(GFP_KERNEL)/kfree() to realize the key point (1) in this patch.
TOMOYO is almost ready to have GC support.

This patch is very large, so I'll create splitted patches if you need.
Thank you for your time.

------- End of Forwarded Message
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/