lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 4 Apr 2010 09:26:26 +0800
From:	jing zhang <zj.barak@...il.com>
To:	tytso@....edu
Cc:	linux-ext4 <linux-ext4@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Andreas Dilger <adilger@....com>,
	Dave Kleikamp <shaggy@...ux.vnet.ibm.com>,
	"Aneesh Kumar K. V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: Re: [PATCH] ext4: add rb_tree cache to struct ext4_group_info

2010/4/3, tytso@....edu <tytso@....edu>:
> On Wed, Mar 31, 2010 at 10:26:45PM +0800, jing zhang wrote:
>>
>> With the added cache, there is over 50% probability that the operation,
>>        rb_first(&(grp->bb_free_root));
>> can be saved, when there are multiple nodes in tree.
>>
>> It seems what is added is following what is called O(1), one of the
>> works by Mr. Ingo Molnar, but I am not sure, and let's ask Mr. Ingo
>> Molnar.
>
> Sure, but does it matter?  The red-black tree is per-block group, and
> rb_first() is O(ln n), and it's cleared after every transaction
> commit.  Have you measured how deep it gets?  Have you measured how
> much CPU time this would actually save?
>

Thanks for these questions, which were out of my consideration.

> I'm almost certiain the code complexity isn't worth it.  For example,
> your patch is buggy.  There are places where the red black tree is
> manipulated, and where the node pointed at by bb_free_cache could get
> freed.  For example, see release_blocks_on_commit() and
> ext4_mb_free_metadata().

I will check release_blocks_on_commit() and ext4_mb_free_metadata()
again next week.

>
> That being said, I'm not convinced ext4_mb_generate_from_freelist() is
> (a) necessary, or (b) bug-free, either.  The whole point of having
> extents in bb_free_root tree is that those extents aren't safe to be
> placed in the buddy bitmap.  And ext4_mb_generate_from_freelist()
> isn't freeing the nodes from the rbtree.  Fortunately it looks like
> ext4_mb_generate_from_freelist is only getting called when the buddy
> bitmap is being set up, so the rbtree should be empty during those
> times.
>
> I need to do some more investigation, but I think the function can be
> removed entirely.

Do you mean that ext4_mb_generate_from_freelist() can be removed entirely?

       - zj
>
> 						- Ted
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ