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

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

 



On Saturday 16 August 2014 at 10:23:08, Edward Shishkin wrote:	
> [...]
> >>
> >> So I need to find a way to take rwsem in a read-biased mode... Any 
> >> advice is
> >> accepted, including "give up with adding of yet another lock and go with
> >> multiple transactions" :)
> >
> >
> > IMHO this is too complicated.
> >
> > Why don't you want to grab, say, 20M per iteration?
> > It should work without any problems, just maintain a
> > counter of blocks allocated in the iteration..

I see it mostly like a "good to have" thing. When the system is under load,
FITRIM implemented in this "simple" way will be ineffective: it will miss
some blocks that are temporarily allocated (journal, etc.) even though it is
theoretically possible to stop accepting new transactions, commit all existing
ones and perform discard while the system is artificially made idle, then
resume everything.

So I've been trying to check if this is feasible. Looks like it isn't.

> add the counter to the struct reiser4_context and
> set it to zero at the beginning of every iteration.
> use get_current_context() to access the counter.

Is it needed? The simple way is just a loop consisting of
- grab space
- allocate blocks forward from start position (initially 0) until end of
  partition or limit reached
- update start position to `last allocated block + 1`
- put allocated space to the delete set
- mark for force-committing
- reiser4_txn_restart_current()
- if we've reached end of partition earlier, break, otherwise loop

-- 
Ivan Shapovalov / intelfx /

Attachment: signature.asc
Description: This is a digitally signed message part.


[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