xfs
[Top] [All Lists]

Re: Review: fix block reservation to work with per-cpu counters

To: David Chinner <dgc@xxxxxxx>
Subject: Re: Review: fix block reservation to work with per-cpu counters
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 8 Jan 2007 10:52:03 +0000
Cc: xfs-dev@xxxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <20070108061040.GD44411608@melbourne.sgi.com>
References: <20070108061040.GD44411608@melbourne.sgi.com>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
On Mon, Jan 08, 2007 at 05:10:40PM +1100, David Chinner wrote:
> Currently, XFS_IOC_SET_RESBLKS will not work properly when
> per-cpu superblock counters are enabled. Reservations can be lost
> silently as they are applied to the incore superblock instead of
> the currently active counters.
> 
> Rather than try to shoe-horn the current reservation code into
> the per-cpu counters or vice-versa, we lock the superblock
> and snap the current counter state and work on that number.
> Once we work out exactly how much we need to "allocate" to
> the reserved area, we drop the lock and call xfs_mod_incore_sb()
> which will do all the right things w.r.t to the counter state.
> 
> If we fail to get as much as we want (i.e. ENOSPC is returned)
> we go back to the start and try to allocate as much of what is
> left.
> 
> Comments?

Sounds okay.  Reservations shouldn't be frequent enough for this
to have a performance impact.


<Prev in Thread] Current Thread [Next in Thread>