Tomas M:
> I noticed CONFIG_AUFS_BRANCH_MAX_32767 is still commented out in 
> local.mk so I didn't use it yet. Do you recommend it shouldn't be used 
> at all?

It is up to linux memory allocation system.
When you add a branch, aufs re-allocate some arrays for branch
management. Basically an element in the array is a pointer.
In x86 + 32bit + 4kb page size world, MAX_1023 means that aufs allocates
one page at most for an array in branch management.
As you can guess, on 64bit + 4kb page size system, MAX_511 will
allocates one page at most.

So when you compile aufs for such system, you will meet this warning,
(from module.c)
#if AUFS_BRANCH_MAX > 511 && BITS_PER_LONG == 64 && PAGE_SIZE == 4096
#warning For 4k pagesize and 64bit environment, \
        CONFIG_AUFS_BRANCH_MAX_511 or smaller is recommended.
#endif

To allocate large memory which requires several pages, is not
preferable.
If kmalloc() in linux kernel supports several 128kb(for 32bit) or
256kb(for 64bit) allocations, you can enable MAX_32767 in safe.
Actually, I don't know the exact limit of kmalloc. (I've heared it
support upto 128kb). Additonally, I didn't think over 1024 branches is
important. So I left this issue alone.
If you really need such large branches, it is worth to rewrite branch
management code to call kernel function other than kmalloc().
When the size is larger than a single page, I will call
__get_free_pages().


> In Kconfig.in documentation, there is written that the larger value 
> consumes more system resources and has an impact to performance. What 
> 'larger value' does this refer to? Does it mean the 'larger value' of 
> ACTIVE BRANCHES IN AUFS UNION? (this is completely understandable) or 
> does it mean the 'larger value' of CONFIG_AUFS_BRANCH_MAX?

It is ACTIVE BRANCHES IN AUFS UNION, as you wrote.
But if I rewrite code to call other allocate function, it may depend
upon CONFIG_AUFS_BRANCH_MAX.


> So in general, MAX_511 should be ABSOLUTELY THE SAME like MAX_32767, am 
> I right?

If kmalloc() doesn't support 128kb, MAX_32767 will not work.


> And in general, if I use only 10 branches in my aufs, it should have the 
> same performance for all CONFIG_AUFS_BRANCH_MAX_* settings, am I correct?

Yes, you are correct.


By the way, I've found one issue while I was refering to the source code
to write this mail.
Introducing CONFIG_AUFS_HINOTIFY and other features, the element of an
array becomes a larger object than a pointer.
So the array will be larger than a page at most.


Junjiro Okajima

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to