All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH 03/10 v3] ext4: add physical block and status member into extent status tree
Date: Wed, 30 Jan 2013 10:43:33 +0800	[thread overview]
Message-ID: <20130130024332.GA12111@gmail.com> (raw)
In-Reply-To: <20130129172814.GC4261@thunk.org>

On Tue, Jan 29, 2013 at 12:28:14PM -0500, Theodore Ts'o wrote:
> On Tue, Jan 29, 2013 at 01:34:15PM +0800, Zheng Liu wrote:
> > 
> > Another choice is like this:
> > 
> >         struct extent_status {
> >                 ...
> >                 ext4_fsblk_t es_pblk;   /* first physical block */
> >         };
> > 
> >         #define EXTENT_STATUS_WRITTEN   (1ULL << 60)
> >         #define EXTENT_STATUS_UNWRITTEN (1ULL << 61)
> >         #define EXTENT_STATUS_DELAYED   (1ULL << 62)
> > 
> > When we want to set extent status, we will need to do like the following:
> > 
> >         es->es_pblk |= EXTENT_STATUS_WRITTEN;
> > 
> > This can make us avoid non-protable code.  I am happy to refine this
> > patch if you think the latter one is better.
> 
> This is probably the way I would have done it myself, but the then you
> need to make sure that all of the places where es_pblk is used you
> have to mask off the high bits.
> 
> At this point, though, I don't think it's worth it to make the change
> now, especially since we're almost at -rc6, I want to make sure this
> gets into linux-next and so we get lots of testing.
> 
> As a matter of fact, I've already started testing the v3 vesion of the
> extent status patches from January 23rd, with the v2 version of the
> slab reclaim patch.  It's in the unstable portion of the ext4 git
> tree, at:
> 
>       http://repo.or.cz/w/ext4-patch-queue.git /
>       git://repo.or.cz/ext4-patch-queue.git
> 
> I'm waiting for your next version of your patch series before I move
> it into the dev branch which will get fed into linux-next; my
> understanding is you're just about ready to push it out, right?

Yes, I am running xfstests to make sure that the patch series doesn't
break anything.  Later it will be sent out.

> 
> If we want to move away from using bitfields, we can do that as a
> separate patch that gets submitted later, since that's pretty easy to
> audit and verify for correctness.  Also, I've since tested clang and
> noted that it supports bitfields for unsigned long long.  There is
> some differences between how gcc and clang handles sign extension for
> unsigned long values, though:
> 
> #include <stdio.h>
> struct s
> {
>         unsigned long long a:2;
>         unsigned long long b:40;
>         unsigned long long c:22;
> };
> 
> int main()
> {
>         struct s t = {1, 2, 3};
>         printf("0x%llx\n",(t.b-8));
> }
> 
> Gcc 4.7.2 will print "0xfffffffffa", while clang 3.0-6 will print
> "0xfffffffffffffffa" for the same program.

Clang is first coming in my mind.  I know that some one try to use it
to build a linux kernel and get a lot of problems that are about gcc
extension.  But for us it seems that things are not too bad. ;)

> 
> I don't think this is a huge issue for us, but it's worth keeping in
> mind...
> 
> So let's go ahead and keep the bitfields at least for the initial
> patch submission.

Yes, just keep in mind and go ahead.

Thanks for teaching me a lot,
                                                - Zheng

  reply	other threads:[~2013-01-30  2:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 12:03 [PATCH 00/10 v3] ext4: extent status tree (step2) Zheng Liu
2013-01-23 12:03 ` [PATCH 01/10 v3] ext4: refine extent status tree Zheng Liu
2013-01-23 12:03 ` [PATCH 02/10 v3] ext4: remove EXT4_MAP_FROM_CLUSTER flag Zheng Liu
2013-01-23 12:03 ` [PATCH 03/10 v3] ext4: add physical block and status member into extent status tree Zheng Liu
2013-01-29  3:03   ` Theodore Ts'o
2013-01-29  5:34     ` Zheng Liu
2013-01-29 17:28       ` Theodore Ts'o
2013-01-30  2:43         ` Zheng Liu [this message]
2013-02-03  3:03           ` Theodore Ts'o
2013-02-03  5:21             ` Zheng Liu
2013-02-03  8:19               ` Dan Carpenter
2013-02-03 14:57                 ` Theodore Ts'o
2013-02-03  7:30             ` Sam Ravnborg
2013-01-23 12:03 ` [PATCH 04/10 v3] ext4: adjust interfaces of " Zheng Liu
2013-01-23 12:03 ` [PATCH 05/10 v3] ext4: track all extent status in " Zheng Liu
2013-01-23 12:03 ` [PATCH 06/10 v3] ext4: lookup block mapping " Zheng Liu
2013-01-23 12:03 ` [PATCH 07/10 v3] ext4: remove single extent cache Zheng Liu
2013-01-23 12:03 ` [PATCH 08/10 v3] fs: allow for fs-specific objects to be pruned as part of pruning inodes Zheng Liu
2013-01-23 12:03 ` [PATCH 09/10 v3] ext4: adjust some functions for reclaiming extents from extent status tree Zheng Liu
2013-01-23 12:04 ` [PATCH 10/10 v3] ext4: reclaim " Zheng Liu

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=20130130024332.GA12111@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wenqing.lz@taobao.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.