Lines Matching full:space
5 #include "space-info.h"
8 #include "free-space-cache.h"
15 * HOW DOES SPACE RESERVATION WORK
23 * 1) space_info. This is the ultimate arbiter of how much space we can use.
27 * determining if there is space to make an allocation. There is a space_info
33 * much space is accounted for in space_info->bytes_may_use.
63 * enough space
74 * Flushes various things attempting to free up space.
77 * This is called by anything that either subtracts space from
81 * completed. If it can the space is added to space_info->bytes_may_use and
103 * reclaim space so we can make new reservations.
111 * metadata space.
114 * Look at the delalloc comment to get an idea of how much space is reserved
115 * for delayed allocation. We can reclaim some of this space simply by
117 * reclaim the bulk of this space.
120 * We have a block reserve for the outstanding delayed refs space, and every
122 * to reclaim space, but we want to hold this until the end because COW can
127 * We will skip this the first time through space reservation, because of
128 * overcommit and we don't want to have a lot of useless metadata space when
133 * items, and extent tree items. Loads of space could be freed up by these
148 * reserve more space than is currently free in the currently allocate
149 * metadata space. This only happens with metadata, data does not allow
153 * btrfs_can_overcommit(), but it only applies to unallocated space. If there
154 * is no unallocated space to be had, all reservations are kept within the
155 * free space in the allocated metadata chunks.
159 * thing with or without extra unallocated space.
173 * after adding space to the filesystem, we need to clear the full flags
174 * on all the space infos.
186 * Block groups with more than this value (percents) of unusable space will be
360 * space is actually usable. For raid56, the space info used in calc_available_free_space()
369 * 1/2th of the space. If we can flush, don't let us overcommit in calc_available_free_space()
370 * too much, let it overcommit up to 1/8 of the space. in calc_available_free_space()
387 * groups to be writable for metadata space. in writable_total_bytes()
428 * This is for space we already have accounted in space_info->bytes_may_use, so
429 * basically when we're returning space from block_rsv's.
510 /* The free space could be negative in case of overcommit */ in __btrfs_dump_space_info()
589 /* Calc the number of the pages we need flush for space reservation */ in shrink_delalloc()
614 * that likely won't give us the space back we need. in shrink_delalloc()
753 * For metadata space on zoned filesystem, reaching here means we in flush_space()
754 * don't have enough space left in active_total_bytes. Try to in flush_space()
776 * For metadata space on zoned filesystem, allocating a new chunk in flush_space()
797 * bunch of pinned space, so make sure we run the iputs before in flush_space()
838 * We may be flushing because suddenly we have less space than we had in btrfs_calc_reclaim_metadata_size()
840 * space. If that's the case add in our overage so we make sure to put in btrfs_calc_reclaim_metadata_size()
890 * If we have over half of the free space occupied by reservations or in need_preemptive_reclaim()
901 * if our reclaimable space exceeds our clamped free space. in need_preemptive_reclaim()
932 * space before tickets need to wait for things to finish. In the case in need_preemptive_reclaim()
997 * @space_info - the space info we were flushing
1019 btrfs_info(fs_info, "cannot satisfy tickets, dumping space info"); in maybe_fail_all_tickets()
1111 * pretty hard to reclaim space. Think of the case where we in btrfs_async_reclaim_metadata_space()
1112 * freed up a bunch of space and so have a lot of pinned space in btrfs_async_reclaim_metadata_space()
1140 * This handles pre-flushing of metadata space before we get to the point that
1144 * watermark of space by flushing whichever reservation pool is currently the
1177 * out the block rsv's space from the bytes_may_use. If that in btrfs_preempt_reclaim_metadata_space()
1190 * because that's space we can't touch. Subtract it from the in btrfs_preempt_reclaim_metadata_space()
1241 * Space is freed from flushing delalloc in one of two ways.
1243 * 1) compression is on and we allocate less space than we reserved
1244 * 2) we are overwriting existing space
1246 * For #1 that extra space is reclaimed as soon as the delalloc pages are
1248 * length to ->bytes_reserved, and subtracts the reserved space from
1259 * thus have been truncated and freed up space. But again this space is not
1264 * This is where we reclaim all of the pinned space generated by running the
1270 * so if we now have space to allocate do the force chunk allocation.
1425 * the available space. in priority_reclaim_metadata_space()
1472 * Delete us from the list. After we unlock the space in wait_reserve_ticket()
1474 * space for this ticket. If that would happen, then the in wait_reserve_ticket()
1475 * ticket's task would not known that space was reserved in wait_reserve_ticket()
1476 * despite getting an error, resulting in a space leak in wait_reserve_ticket()
1497 * @space_info: space info for the reservation
1543 * releasing reserved space (if an error happens the expectation is that in handle_reserve_ticket()
1544 * space wasn't reserved at all). in handle_reserve_ticket()
1572 * and freeing space, like there is with flushing delayed refs or in maybe_clamp_preempt()
1587 * Try to reserve bytes from the block_rsv's space
1590 * @space_info: space info we want to allocate from
1594 * This will reserve orig_bytes number of bytes from the space info associated
1595 * with the block_rsv. If there is not enough space it will make an attempt to
1596 * flush out space to make room. It will do this by flushing delalloc if
1599 * space already.
1636 * Carry on if we have enough space (short-circuit) OR call in __reserve_bytes()
1690 * We will do the space reservation dance during log replay, in __reserve_bytes()
1712 * Trye to reserve metadata bytes from the block_rsv's space
1719 * This will reserve orig_bytes number of bytes from the space info associated
1720 * with the block_rsv. If there is not enough space it will make an attempt to
1721 * flush out space to make room. It will do this by flushing delalloc if
1724 * space already.
1753 * This will reserve bytes from the data space info. If there is not enough
1754 * space then we will attempt to flush space as specified by flush.
1777 /* Dump all the space infos when we abort a transaction due to ENOSPC. */
1782 btrfs_info(fs_info, "dumping space info:"); in btrfs_dump_space_info_for_trans_abort()