All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <Anand.Jain@oracle.com>
To: kreijack@inwind.it, dsterba@suse.cz, Chris Mason <clm@fb.com>
Cc: Miao Xie <miaox@cn.fujitsu.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH RFC 0/5] Scan all devices to build fs device list
Date: Tue, 09 Sep 2014 11:26:17 +0800	[thread overview]
Message-ID: <540E7359.4050000@oracle.com> (raw)
In-Reply-To: <540DE427.4040008@inwind.it>



>>   Since we are on the topic of scanning. A point on improving the
>>   btrfs-progs scan method which I am working on...
>>
>>     - Scan of all system devices is an expensive task. But btrfs-progs
>>       do it very liberally. Due to this there are some serious problem
>>       like - btrfs fi show is too slow when scrub is running.
>>
>>     - The worst is Single btrfs-progs thread scans for btrfs
>>       devices multiple times. Mainly because most of the functions
>>       uses check_mounted() which in turn calls scan, think of
>>       multi device btrfs config.
>
> Using libblkid (see your proposal below) would help in this case,
> because the values would be cached.

   may be, let me try / report. but first I need to search for a system
   with at least 100+  LUNs.


>>     - The problem would be more prominent in larger server with 1000's
>>       of LUNs / devices.
>>
>>     - lblkid can be the only method to scan for devices. (The other
>>       method we have as of now is of canning /proc/partitions, which
>>       lblkid also does).
>>
>>    what I am planning -
>>      Use btrfs control ioctl to help btrfs-progs check_mounted() to know
>>        if a (multi) device is mounted.
>>      Build kernel's fs_devices list in the user-space using btrfs
>>        control ioctl.
>>      Do device scan only once per btrfs-progs thread.
>
> You are talking about a ioctl: why not use (extending them when needed)
> the sysfs information ?

  yeah, I understand I am the only person talking about ioctl,
  and all others recommend sysfs. I understand I am wrong, but
  just by mass. and I still have no idea why not ioctl ?
  Problem with sysfs:
   - Note that sysfs supports only one parameter value with max length
   u64, to rebuilt entire kernel's fs_uuid list in the user space
   that would be quite a lot of sysfs files. should that be fine ?
   Further we would need another traverser tool (python ?) to read
   all these sysfs files. ? so that we could create fs_uuid list
   in the user-space.

   - we would need all info about the kernel fs_uuid, even when the
  device is not mounted.

   - thinking of nested seed with sysfs is more complicated, as we would
  have same btrfs_device at multiple fs_devices. still we must represent
  them in the sysfs.

   - as of now fs_uuid can grow infinite with just "a" device.
    ref: [PATCH 1/2] btrfs: device list could grow infinite
    can't imagine anybody traversing through /sysfs to understand
    what btrfs-kernel think of devices. user would prefer a cli
    to know that instead.

   - sysfs layout has to be dynamic based on fs_uuids list changes,
   devices added, removed, mounted replaced etc.. isn't it making
   more unstable ?


appreciate your comments

Anand

  reply	other threads:[~2014-09-09  3:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 13:36 [PATCH RFC 0/5] Scan all devices to build fs device list Miao Xie
2014-09-03 13:36 ` [PATCH 1/5] block: export disk_class and disk_type for btrfs Miao Xie
2014-09-03 13:36 ` [PATCH 2/5] Btrfs: don't return btrfs_fs_devices if the caller doesn't want it Miao Xie
2014-09-03 13:36 ` [PATCH 3/5] Btrfs: restructure btrfs_scan_one_device Miao Xie
2014-09-03 13:36 ` [PATCH 4/5] Btrfs: restructure btrfs_get_bdev_and_sb and pick up some code used later Miao Xie
2014-09-03 13:36 ` [PATCH 5/5] Btrfs: scan all the devices and build the fs device list by btrfs's self Miao Xie
2014-09-06 11:48   ` Goffredo Baroncelli
2014-09-09  4:06     ` Miao Xie
2014-09-06 20:05 ` [PATCH RFC 0/5] Scan all devices to build fs device list Chris Mason
2014-09-08  9:09   ` David Sterba
2014-09-08 11:04     ` Anand Jain
2014-09-08 17:15       ` Goffredo Baroncelli
2014-09-09  3:26         ` Anand Jain [this message]
2014-09-09 20:31           ` Goffredo Baroncelli
2014-09-10  6:06             ` Anand Jain
2014-09-08 16:59     ` Goffredo Baroncelli

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=540E7359.4050000@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miaox@cn.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.