Re: [PATCH 01/11] IMA: use rbtree instead of radix tree for inode information cache

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dave Chinner
Date: Monday, October 25, 2010 - 4:22 pm

On Mon, Oct 25, 2010 at 02:41:18PM -0400, Eric Paris wrote:

I'm not sure this is the right fix, though.

Realistically, there is a 1:1 relationship between the inode and the
IMA information. I fail to see why an external index is needed here
at all - just use a separate structure to store the IMA information
that the inode points to. That makes the need for a new global index
and global lock go away completely.

You're already adding 8 bytes to the inode, so why not make it a
pointer. We've got 4 conditions:

1. not configured - no overhead
2. configured, boot time disabled - 8 bytes per inode
3. configured, boot time enabled, runtime disabled - 8 bytes per
inode + small IMA structure
4. configured, boot time enabled, runtime enabled - 8 bytes per
inode + large IMA structure

Anyone who wants the option of runtime enablement can take the extra
allocation overhead, but otherwise nobody is affected apart from 8
bytes of additional memory per inode. I doubt that will change
anything unless it increases the size of the inode enough to push it
over slab boundaries. And if LSM stacking is introduced, then that 8
bytes per inode overhead will go away, anyway.

This approach doesn't introduce new global lock and lookup overhead
into the main VFS paths, allows you to remove a bunch of code and
has a path forward for removing the 8 byte per inode overhead as
well. Seems like the best compromise to me....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 07/11] IMA: move read counter into struct inode, Eric Paris, (Mon Oct 25, 11:41 am)
[PATCH 08/11] IMA: only allocate iint when needed, Eric Paris, (Mon Oct 25, 11:42 am)
[PATCH 11/11] IMA: fix the ToMToU logic, Eric Paris, (Mon Oct 25, 11:42 am)
Re: [PATCH 01/11] IMA: use rbtree instead of radix tree fo ..., Christoph Hellwig, (Mon Oct 25, 1:57 pm)
Re: [PATCH 01/11] IMA: use rbtree instead of radix tree fo ..., Dave Chinner, (Mon Oct 25, 4:22 pm)