All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: Cache some system inodes of other nodes.
Date: Fri, 13 Aug 2010 09:20:22 +0800	[thread overview]
Message-ID: <4C649DD6.20104@oracle.com> (raw)
In-Reply-To: <20100813010459.GH22777@mail.oracle.com>

Joel Becker wrote:
> On Fri, Aug 13, 2010 at 08:49:16AM +0800, Tao Ma wrote:
>   
>>> 	I don't see why you don't extend the existing cache and make one
>>> cache.  Make it live the lifetime of the filesystem.  No real reason to
>>> a) have to caches or b) limit the system inodes we might cache.  If we
>>> don't have the lock we're going to re-read them anyway.
>>>       
>> You want me to do:
>> -        struct inode *system_inodes[NUM_SYSTEM_INODES];
>> +        struct inode **system_inodes
>>
>> and do
>> +    system_inodes = kzalloc((NUM_SYSTEM_INODES -
>> GROUP_QUOTA_SYSTEM_INODE) *
>> +                                            sizeof(struct inode *)
>> * osb->max_slots);
>>     
>
> 	Something like that.  I'd be more inclined to have a global
> inode cache, and a per-slot cache.  No need to have max_slots spaces for
> the global inodes.
> 	Actually, why not an rb-tree?  We just want to be able to avoid
> the dir lookup, really, right?  Why pre-alloc anything?  Just have a
> node:
>   
no, this patch doesn't want to reduce dir lookup, although it resolve 
dir lookup somehow. ;) This patch just want to resolve
the problem of (read_disk + journal_checkpoint when we orphan scan 
another slot). It seems that I have put the most
important part of this patch in the head of  the commit log. :)
> 	struct ocfs2_system_inode_cache_node {
> 		struct rb_node sic_node;
> 		int sic_type;
> 		int sic_slot;
> 		u64 sic_blkno;
> 		struct inode *sic_inode;
> 	};
>
> Although frankly a linked-list might work just as well.
>   
rb-tree may be too much for us. I would prefer what Sunil describe in 
another mail. Just use a pointer array should be fine for us.
what we lose is just some pointers that will never be initialized.

Regards,
Tao

  reply	other threads:[~2010-08-13  1:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12  9:03 [Ocfs2-devel] [PATCH] ocfs2: Cache some system inodes of other nodes Tao Ma
2010-08-12  9:43 ` Joel Becker
2010-08-13  0:49   ` Tao Ma
2010-08-13  1:04     ` Joel Becker
2010-08-13  1:20       ` Tao Ma [this message]
2010-08-13  1:03   ` Sunil Mushran
2010-08-13  1:21     ` Tao Ma
2010-08-13  1:28       ` Joel Becker

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=4C649DD6.20104@oracle.com \
    --to=tao.ma@oracle.com \
    --cc=ocfs2-devel@oss.oracle.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.