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. Or am I trying to over-engineer too much? Thanks, -- Ivan Shapovalov / intelfx /
Attachment:
signature.asc
Description: This is a digitally signed message part.