Re: reiser4: FITRIM ioctl -- how to grab the space?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 08/10/2014 08:52 PM, Ivan Shapovalov wrote:
On Friday 01 August 2014 at 01:19:05, Edward Shishkin wrote:	
On 08/01/2014 12:16 AM, Ivan Shapovalov wrote:
[...]
OK. But it still needs to allocate space (even if just to deallocate it
shortly), which means that someone could get ENOSPC while the discard is in
progress, and this ENOSPC will come from the allocator itself.

Ah, yes of course, we'll illegally occupy someone's reservation with
the following oops...


Do you have any ideas on how to do it gracefully?

Define maximal number of allocated blocks in one iteration
and reserve this amount of blocks at the beginning of each
iteration. Once the limit is exhausted, stop the scan and
force to commit the atom.
This sounds pretty hackish... Isn't there a way to grab all possible space
at the same time?
By all possible space I mean (sbinfo->block_count - sbinfo->blocks_used),
so that `fstrim <mountpoint>` will be efficient even if system is under load
and atoms are being created continuously.


I am afraid that other processes will return ENOSPC, whereas there is
a lot of free disk space.
Assume fstrim grabbed all possible space. A process X , who needs to
reserve space invokes txnmgr_force_commit_all(). Everyone waits for
commits completion. After this fstrim grabs all possible space again
(there is no any queue for free space reclaimers). Process X returns
ENOSPC.

Edward.
--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux