All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/5] btrfs: sysfs: introduce qgroup global attribute groups
Date: Fri, 3 Sep 2021 16:03:58 +0200	[thread overview]
Message-ID: <20210903140358.GF3379@twin.jikos.cz> (raw)
In-Reply-To: <9f48f55f-a4f3-ad0c-e48e-1da02b0ef068@gmx.com>

On Fri, Sep 03, 2021 at 06:30:36AM +0800, Qu Wenruo wrote:
> 
> 
> On 2021/9/3 上午12:28, David Sterba wrote:
> > On Tue, Aug 31, 2021 at 05:48:59PM +0800, Qu Wenruo wrote:
> >> Although we already have info kobject for each qgroup, we don't have
> >> global qgroup info attributes to show things like qgroup flags.
> >>
> >> Add this qgroups attribute groups, and the first member is qgroup_flags,
> >> which is a read-only attribute to show human readable qgroup flags.
> >>
> >> The path is:
> >>   /sys/fs/btrfs/<uuid>/qgroups/qgroup_flags
> >>
> >> The output would look like:
> >>   ON | INCONSISTENT
> >
> > So that's another format of sysfs file, we should try to keep them
> > consistent or follow common practices. The recommended way for sysfs is
> > to have one file per value, and here it follows the known states.
> >
> > So eg
> >
> > /sys/fs/.../qgroups/enabled		-> 0 or 1
> > /sys/fs/.../qgroups/inconsistent	-> 0 or 1
> > ...
> >
> > The files can be also writable so rescan can be triggered from sysfs, or
> > quotas disabled eventually. For the start exporting the state would be
> > sufficient though.
> >
> OK, that sounds indeed better than the current solution.
> 
> Although there may be a small window that one reading 3 attributes could
> get inconsistent view, as it's no longer atomic.
> 
> Would that be a problem?

I hope not, the status can change after reading the sysfs files anyway.

  reply	other threads:[~2021-09-03 14:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  9:48 [PATCH 0/5] btrfs: qgroup: address the performance penalty for subvolume dropping Qu Wenruo
2021-08-31  9:48 ` [PATCH 1/5] btrfs: sysfs: introduce qgroup global attribute groups Qu Wenruo
2021-09-02 16:28   ` David Sterba
2021-09-02 22:30     ` Qu Wenruo
2021-09-03 14:03       ` David Sterba [this message]
2021-08-31  9:49 ` [PATCH 2/5] btrfs: introduce BTRFS_QGROUP_STATUS_FLAGS_MASK for later expansion Qu Wenruo
2021-08-31  9:49 ` [PATCH 3/5] btrfs: introduce BTRFS_QGROUP_RUNTIME_FLAG_CANCEL_RESCAN Qu Wenruo
2021-08-31  9:49 ` [PATCH 4/5] btrfs: introduce BTRFS_QGROUP_RUNTIME_FLAG_NO_ACCOUNTING to skip qgroup accounting Qu Wenruo
2021-08-31  9:49 ` [PATCH 5/5] btrfs: skip subtree scan if it's too high to avoid low stall in btrfs_commit_transaction() Qu Wenruo
2021-09-02 16:25 ` [PATCH 0/5] btrfs: qgroup: address the performance penalty for subvolume dropping David Sterba
2021-09-02 22:28   ` Qu Wenruo

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=20210903140358.GF3379@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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.