From: Dave Chinner <david@fromorbit.com>
To: Ben Myers <bpm@sgi.com>
Cc: Brian Candler <B.Candler@pobox.com>,
Eric Sandeen <sandeen@sandeen.net>,
xfs@oss.sgi.com
Subject: Re: df bigger than ls?
Date: Fri, 9 Mar 2012 13:57:25 +1100 [thread overview]
Message-ID: <20120309025725.GT5091@dastard> (raw)
In-Reply-To: <20120309015603.GZ8545@sgi.com>
On Thu, Mar 08, 2012 at 07:56:03PM -0600, Ben Myers wrote:
> On Fri, Mar 09, 2012 at 11:17:10AM +1100, Dave Chinner wrote:
> > On Thu, Mar 08, 2012 at 10:23:48AM -0600, Ben Myers wrote:
> > > On Thu, Mar 08, 2012 at 01:10:54PM +1100, Dave Chinner wrote:
> > > > On Wed, Mar 07, 2012 at 12:04:26PM -0600, Eric Sandeen wrote:
> > Alex and I discussed this problem briefly awhile ago. What is the best
> > > way to lose when you hit ENOSPC (project quotas) or EDQUOT in
> > > xfs_iomap_write_delay? You want to be fair; one user hitting his quota
> > > shouldn't be able to steal some other user's block reservations unless
> > > you really are near ENOSPC for the entire filesystem.
> > >
> > > I suggested something like... track inodes with preallocated block
> > > reservations in LRU order and by dquot, so that the poor fella who is at
> > > EDQUOT will first clean up the preallocations that resulted in quota
> > > being enforced, try again, and then work on preallocations of other
> > > users only if it can help in his situation. IIRC Alex shut me down when
> > > he heard LRU. ;)
> >
> > And I agree with Alex. Nothing additional needs to be tracked on top
> > of inodes with speculative prealloc. Just the search filter would
> > need to be different (i.e. only select inodes with a specific dquot
> > attached).
>
> Yeah, maybe not. A single list of inodes with speculative prealloc does
> seem a good place to start.
Except it involves growing the inode by a struct listhead. Keeping
per-inode memory usage down is extremely important, and growing it
by 16 bytes for a rare corner case is not a particularly good
tradeoff. Especially as using a radix tree tag for tracking doesn't
involve any increase in memory usage and tag based scans are
lock-free and quite efficient.
> Later maybe you would not want to
> scan/filter through all of them and we could add additional lists for
> dquots. My suggestion of using LRU was because I think that the oldest
> unused speculative preallocs should be the first to go. One chronic
> over-quota user shouldn't be able to punish everyone else.
Sure. But we only need to check if the inode with prealloc
belongs to the user/group/project that hit EDQUOT before taking
action. We don't need an LRU for that.
Indeed, I don't believe that removing the entire preallocation on
each inode is the right thing to do, either. Chopping it in half is
probably the right thing to do so that we free up lots of space in
the case of excessive (large preallocation) but don't cause
significant extra fragmentation for the work that currently requires
it.
If we still get EDQUOT after trimming speculative preallocations, we
can try a second time. If reducing speculative preallocations by 75%
doesn't avoid the EDQUOT (or ENOSPC), then I think we can consider it
a real error....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-03-09 2:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 15:54 df bigger than ls? Brian Candler
2012-03-07 17:16 ` Brian Candler
2012-03-07 18:04 ` Eric Sandeen
2012-03-08 2:10 ` Dave Chinner
2012-03-08 2:17 ` Eric Sandeen
2012-03-08 9:10 ` Brian Candler
2012-03-08 9:28 ` Dave Chinner
2012-03-08 16:23 ` Ben Myers
2012-03-09 0:17 ` Dave Chinner
2012-03-09 1:56 ` Ben Myers
2012-03-09 2:57 ` Dave Chinner [this message]
2012-03-08 8:04 ` Arkadiusz Miśkiewicz
2012-03-08 10:03 ` Dave Chinner
2012-03-08 8:50 ` Brian Candler
2012-03-08 9:59 ` Brian Candler
2012-03-08 10:22 ` Dave Chinner
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=20120309025725.GT5091@dastard \
--to=david@fromorbit.com \
--cc=B.Candler@pobox.com \
--cc=bpm@sgi.com \
--cc=sandeen@sandeen.net \
--cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox