From: jing zhang <zj.barak@gmail.com>
To: tytso@mit.edu
Cc: linux-ext4 <linux-ext4@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>, Andreas Dilger <adilger@sun.com>,
Dave Kleikamp <shaggy@linux.vnet.ibm.com>,
"Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [PATCH] ext4: add rb_tree cache to struct ext4_group_info
Date: Sun, 4 Apr 2010 14:26:01 +0800 [thread overview]
Message-ID: <h2kac8f92701004032326v22750abfr458ea51bbfc0b901@mail.gmail.com> (raw)
In-Reply-To: <20100404020656.GC18524@thunk.org>
2010/4/4, tytso@mit.edu <tytso@mit.edu>:
> On Sun, Apr 04, 2010 at 09:26:26AM +0800, jing zhang wrote:
>> > 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?
>
> Maybe. I need to do more investigation to be sure. The code in
> mballoc is subtle, and in some places there is stuff which is vestigal
> or misnamed, but it means that I'm going to be very careful before
> changing things.
>
> It also means that if you submit patches, you need to be very clear
> what you think the surrounding code is doing, why you think it's
> wrong, and how your patch make things better. For example, this:
>
> The function, ext4_mb_discard_group_preallocations(), works alone as
> hard as possible without correct understanding its caller's good
> thinking.
>
> And now try to relieve it in simple way.
>
> is almost useless as a comment. It doesn't help me understand the
> code. "hard as possible"? Huh? "without correct understanding"?
> How can code, unless it's artificially intelligent, have
> understanding? And if you meant the original author had no
> understanding, how do you know that? "caller's good thinking"? Same
> question; the calling code doesn't think.
>
> This sort of explanation isn't helpful in understanding the patch.
>
> - Ted
>
Another good lesson, I got it.
Thanks
- zj
prev parent reply other threads:[~2010-04-04 6:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-28 9:11 [PATCH] ext4: add rb_tree cache to struct ext4_group_info jing zhang
2010-03-28 15:03 ` Eric Sandeen
2010-03-29 13:40 ` jing zhang
2010-03-30 18:29 ` Aneesh Kumar K. V
2010-03-31 14:26 ` jing zhang
2010-04-03 15:34 ` tytso
2010-04-04 1:26 ` jing zhang
2010-04-04 2:06 ` tytso
2010-04-04 6:26 ` jing zhang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=h2kac8f92701004032326v22750abfr458ea51bbfc0b901@mail.gmail.com \
--to=zj.barak@gmail.com \
--cc=adilger@sun.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=shaggy@linux.vnet.ibm.com \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).