All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <Anand.Jain@oracle.com>
To: dsterba@suse.cz, Gui Hecheng <guihc.fnst@cn.fujitsu.com>,
	linux-btrfs@vger.kernel.org, clm@fb.com
Subject: Re: [PATCH 2/2 RESEND] btrfs: introduce shrinker for rb_tree that keeps valid btrfs_devices
Date: Mon, 26 Jan 2015 17:44:20 +0800	[thread overview]
Message-ID: <54C60C74.7000500@oracle.com> (raw)
In-Reply-To: <20150123181001.GT13289@twin.jikos.cz>



I think we won't need this patch. the coming sysfs changes will
have entry point to handle missing devices/FSID. (inspired by md).
That will be much cleaner to trigger the clean up based on the
device FS changes.
The proposed fix in this Patch, can it handle things like when
customer decides to overwrite btrfs device with ext FS. ? would
that still leave some stale fs_devices. ?

Thanks, Anand.


On 01/24/2015 02:10 AM, David Sterba wrote:
> On Thu, Jan 15, 2015 at 04:53:08PM +0800, Gui Hecheng wrote:
>> The following patch:
>> 	btrfs: remove empty fs_devices to prevent memory runout
>>
>> introduces @valid_dev_root aiming at recording @btrfs_device objects that
>> have corresponding block devices with btrfs.
>> But if a block device is broken or unplugged, no one tells the
>> @valid_dev_root to cleanup the "dead" objects.
>>
>> To recycle the memory occuppied by those "dead"s, we could rely on
>> the shrinker. The shrinker's scan function will traverse the
>> @valid_dev_root and trys to open the devices one by one, if it fails
>> or encounters a non-btrfs it will remove the "dead" @btrfs_device.
>
> I don't see why shrinker is used here.
>
> linux.git/linux/shrinker.h:
>
> "A callback you can register to apply pressure to ageable caches."
>
> How is guaranteed that it will take action at the right time?
> --
> 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
>

  reply	other threads:[~2015-01-26  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15  8:53 [PATCH v2 1/2 RESEND] btrfs: remove empty fs_devices to prevent memory runout Gui Hecheng
2015-01-15  8:53 ` [PATCH 2/2 RESEND] btrfs: introduce shrinker for rb_tree that keeps valid btrfs_devices Gui Hecheng
2015-01-23 18:10   ` David Sterba
2015-01-26  9:44     ` Anand Jain [this message]
2015-01-19  1:36 ` [PATCH v2 1/2 RESEND] btrfs: remove empty fs_devices to prevent memory runout Gui Hecheng
2015-01-19  2:26 ` [PATCH v3 1/2] " Gui Hecheng

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=54C60C74.7000500@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=guihc.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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.