From: Miao Xie <miaox@cn.fujitsu.com>
To: Chris Mason <chris.mason@oracle.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>,
David Sterba <dave@jikos.cz>, Ito <t-itoh@jp.fujitsu.com>,
Itaru Kitayama <kitayama@cl.bb4u.ne.jp>
Subject: Re: [PATCH V4] btrfs: implement delayed inode items operation
Date: Wed, 23 Mar 2011 22:20:21 +0800 [thread overview]
Message-ID: <4D8A01A5.9040905@cn.fujitsu.com> (raw)
In-Reply-To: <4D8953A4.4040008@cn.fujitsu.com>
On wed, 23 Mar 2011 09:57:56 +0800, Miao Xie wrote:
> On Mon, 21 Mar 2011 08:08:17 -0400, Chris Mason wrote:
>>>> I also think that code is racing with the code that frees delayed nodes,
>>>> but haven't yet triggered my debugging printks to prove either one.
>>>
>>> We free delayed nodes when we want to destroy the inode, at that time, just one task,
>>> which is destroying inode, can access the delayed nodes, so I think ACCESS_ONCE() is
>>> enough. What do you think about?
>>
>> Great, I see what you mean. The bigger problem right now is that we may do
>> a lot of operations in destroy_inode(), which can block the slab
>> shrinkers on our metadata operations. That same stress.sh -n 50 run is
>> running into OOM.
>>
>> So we need to rework the part where the final free is done. We could
>> keep a ref on the inode until the delayed items are complete, or we
>> could let the inode go and make a way to lookup the delayed node when
>> the inode is read.
>
> I find the slab shrinkers just reclaim inodes which are in the inode_unused
> list, so if we free delayed nodes before moving the inode into the inode_unused
> list, we can avoid blocking the slab shrinker. Thus maybe we can fix the above
> problem by moving btrfs_remove_delayed_node() from btrfs_destroy_inode()
> to btrfs_drop_inode(). How do you think about?
This method is not good, because we may do delayed insertion/deletion and free
the delayed node when we release the inode, but we may access its delayed node
soon.
After reading the lockdep message reported by Kitayama, I guess the reason of the slab
shrinker block may not be that we do a lot of operations in destroy_inode(), maybe the
real reason is that we pass GFP_KERNEL into kzalloc()(in cache_block_group()), which makes
the slab shrinkers hang up. (I don't trigger OOM by running stress.sh till now, so I
can't locate this bug.)
Thanks
Miao
>
>>
>> I'll read more today.
>>
>> -chris
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2011-03-23 14:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 9:24 [PATCH V4] btrfs: implement delayed inode items operation Miao Xie
2011-03-21 0:33 ` Chris Mason
2011-03-21 5:05 ` Miao Xie
2011-03-21 12:08 ` Chris Mason
2011-03-23 1:57 ` Miao Xie
2011-03-23 14:20 ` Miao Xie [this message]
2011-03-22 2:33 ` Itaru Kitayama
2011-03-22 3:12 ` Miao Xie
2011-03-22 3:50 ` Itaru Kitayama
2011-03-22 10:03 ` Miao Xie
2011-03-22 13:33 ` Itaru Kitayama
2011-03-23 1:27 ` Miao Xie
2011-03-23 3:24 ` Itaru Kitayama
2011-03-23 4:00 ` Miao Xie
2011-03-23 4:19 ` Itaru Kitayama
2011-03-23 9:47 ` Miao Xie
2011-03-24 3:38 ` Itaru Kitayama
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=4D8A01A5.9040905@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=chris.mason@oracle.com \
--cc=dave@jikos.cz \
--cc=kitayama@cl.bb4u.ne.jp \
--cc=linux-btrfs@vger.kernel.org \
--cc=t-itoh@jp.fujitsu.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.