Lines Matching full:we
24 * recover, so we don't allow failure here. Also, we allocate in a context that
25 * we don't want to be issuing transactions from, so we need to tell the
28 * We don't reserve any space for the ticket - we are going to steal whatever
29 * space we require from transactions as they commit. To ensure we reserve all
30 * the space required, we need to set the current reservation of the ticket to
31 * zero so that we know to steal the initial transaction overhead from the
43 * set the current reservation to zero so we know to steal the basic in xlog_cil_ticket_alloc()
51 * After the first stage of log recovery is done, we know where the head and
52 * tail of the log are. We need this log initialisation done before we can
55 * Here we allocate a log ticket to track space usage during a CIL push. This
56 * ticket is passed to xlog_write() directly so that we don't slowly leak log
86 * If we do this allocation within xlog_cil_insert_format_items(), it is done
88 * the memory allocation. This means that we have a potential deadlock situation
89 * under low memory conditions when we have lots of dirty metadata pinned in
90 * the CIL and we need a CIL commit to occur to free memory.
92 * To avoid this, we need to move the memory allocation outside the
99 * process, we cannot share the buffer between the transaction commit (which
102 * unreliable, but we most definitely do not want to be allocating and freeing
109 * the incoming modification. Then during the formatting of the item we can swap
110 * the active buffer with the new one if we can't reuse the existing buffer. We
112 * it's size is right, otherwise we'll free and reallocate it at that point.
145 * Ordered items need to be tracked but we do not wish to write in xlog_cil_alloc_shadow_bufs()
146 * them. We need a logvec to track the object, but we do not in xlog_cil_alloc_shadow_bufs()
156 * We 64-bit align the length of each iovec so that the start in xlog_cil_alloc_shadow_bufs()
157 * of the next one is naturally aligned. We'll need to in xlog_cil_alloc_shadow_bufs()
167 * that space to ensure we can align it appropriately and not in xlog_cil_alloc_shadow_bufs()
173 * if we have no shadow buffer, or it is too small, we need to in xlog_cil_alloc_shadow_bufs()
180 * We free and allocate here as a realloc would copy in xlog_cil_alloc_shadow_bufs()
181 * unnecessary data. We don't use kmem_zalloc() for the in xlog_cil_alloc_shadow_bufs()
182 * same reason - we don't need to zero the data area in in xlog_cil_alloc_shadow_bufs()
238 * If there is no old LV, this is the first time we've seen the item in in xfs_cil_prepare_item()
239 * this CIL context and so we need to pin it. If we are replacing the in xfs_cil_prepare_item()
241 * buffer for later freeing. In both cases we are now switching to the in xfs_cil_prepare_item()
261 * CIL, store the sequence number on the log item so we can in xfs_cil_prepare_item()
272 * For delayed logging, we need to hold a formatted buffer containing all the
280 * guaranteed to be large enough for the current modification, but we will only
281 * use that if we can't reuse the existing lv. If we can't reuse the existing
282 * lv, then simple swap it out for the shadow lv. We don't free it - that is
285 * We don't set up region headers during this process; we simply copy the
286 * regions into the flat buffer. We can do this because we still have to do a
288 * ophdrs during the iclog write means that we can support splitting large
292 * Hence what we need to do now is change the rewrite the vector array to point
293 * to the copied region inside the buffer we just allocated. This allows us to
307 /* Bail out if we didn't find a log item. */ in xlog_cil_insert_format_items()
382 * as well. Remove the amount of space we added to the checkpoint ticket from
401 * We can do this safely because the context can't checkpoint until we in xlog_cil_insert_items()
402 * are done so it doesn't matter exactly how we update the CIL. in xlog_cil_insert_items()
420 * reservation has to grow as well as the current reservation as we in xlog_cil_insert_items()
421 * steal from tickets so we can correctly determine the space used in xlog_cil_insert_items()
430 /* do we need space for more log record headers? */ in xlog_cil_insert_items()
446 * If we've overrun the reservation, dump the tx details before we move in xlog_cil_insert_items()
462 * We do this here so we only need to take the CIL lock once during in xlog_cil_insert_items()
513 * pagb_lock. Note that we need a unbounded workqueue, otherwise we might
570 * Mark all items committed and clear busy extents. We free the log vector
571 * chains in a separate pass so that we unpin the log items as quickly as
582 * If the I/O failed, we're aborting the commit and already shutdown. in xlog_cil_committed()
583 * Wake any commit waiters before aborting the log items so we don't in xlog_cil_committed()
629 * If the current sequence is the same as xc_push_seq we need to do a flush. If
631 * flushed and we don't need to do anything - the caller will wait for it to
635 * Hence we can allow log forces to run racily and not issue pushes for the
636 * same sequence twice. If we get a race between multiple pushes for the same
671 * As we are about to switch to a new, empty CIL context, we no longer in xlog_cil_push_work()
682 * Check if we've anything to push. If there is nothing, then we don't in xlog_cil_push_work()
683 * move on to a new sequence number and so we have to be able to push in xlog_cil_push_work()
700 * We are now going to push this context, so add it to the committing in xlog_cil_push_work()
701 * list before we do anything else. This ensures that anyone waiting on in xlog_cil_push_work()
710 * waiting on. If the CIL is not empty, we get put on the committing in xlog_cil_push_work()
712 * an empty CIL and an unchanged sequence number means we jumped out in xlog_cil_push_work()
728 * remove the items from the CIL. We don't need the CIL lock in xlog_cil_push_work()
762 * The switch is now done, so we can drop the context lock and move out in xlog_cil_push_work()
763 * of a shared context. We can't just go straight to the commit record, in xlog_cil_push_work()
764 * though - we need to synchronise with previous and future commits so in xlog_cil_push_work()
766 * that we process items during log IO completion in the correct order. in xlog_cil_push_work()
768 * For example, if we get an EFI in one checkpoint and the EFD in the in xlog_cil_push_work()
769 * next (e.g. due to log forces), we do not want the checkpoint with in xlog_cil_push_work()
771 * we must strictly order the commit records of the checkpoints so in xlog_cil_push_work()
776 * Hence we need to add this context to the committing context list so in xlog_cil_push_work()
782 * committing list. This also ensures that we can do unlocked checks in xlog_cil_push_work()
793 * begin the transaction. We need to account for the space used by the in xlog_cil_push_work()
796 * The LSN we need to pass to the log items on transaction commit is in xlog_cil_push_work()
797 * the LSN reported by the first log vector write. If we use the commit in xlog_cil_push_work()
798 * record lsn then we can move the tail beyond the grant write head. in xlog_cil_push_work()
819 * now that we've written the checkpoint into the log, strictly in xlog_cil_push_work()
826 * Avoid getting stuck in this loop because we were woken by the in xlog_cil_push_work()
869 * now the checkpoint commit is complete and we've attached the in xlog_cil_push_work()
870 * callbacks to the iclog we can assign the commit LSN to the context in xlog_cil_push_work()
896 * We need to push CIL every so often so we don't cache more than we can fit in
909 * The cil won't be empty because we are called while holding the in xlog_cil_push_background()
910 * context lock so whatever we added to the CIL will still be there in xlog_cil_push_background()
915 * Don't do a background push if we haven't used up all the in xlog_cil_push_background()
930 * Drop the context lock now, we can't hold that if we need to sleep in xlog_cil_push_background()
931 * because we are over the blocking threshold. The push_lock is still in xlog_cil_push_background()
938 * If we are well over the space limit, throttle the work that is being in xlog_cil_push_background()
981 * If the CIL is empty or we've already pushed the sequence then in xlog_cil_push_now()
982 * there's no work we need to do. in xlog_cil_push_now()
1012 * To do this, we need to format the item, pin it in memory if required and
1013 * account for the space used by the transaction. Once we have done that we
1015 * transaction to the checkpoint context so we carry the busy extents through
1033 * Do all necessary memory allocation before we lock the CIL. in xlog_cil_commit()
1055 * This needs to be done before we drop the CIL context lock because we in xlog_cil_commit()
1057 * to disk. If we don't, then the CIL checkpoint can race with us and in xlog_cil_commit()
1058 * we can run checkpoint completion before we've updated and unlocked in xlog_cil_commit()
1078 * We only need to push if we haven't already pushed the sequence
1079 * number given. Hence the only time we will trigger a push here is
1082 * We return the current commit lsn to allow the callers to determine if a
1097 * check to see if we need to force out the current context. in xlog_cil_force_seq()
1105 * See if we can find a previous sequence still committing. in xlog_cil_force_seq()
1106 * We need to wait for all previous sequence commits to complete in xlog_cil_force_seq()
1113 * Avoid getting stuck in this loop because we were woken by the in xlog_cil_force_seq()
1137 * Hence by the time we have got here it our sequence may not have been in xlog_cil_force_seq()
1143 * Hence if we don't find the context in the committing list and the in xlog_cil_force_seq()
1147 * it means we haven't yet started the push, because if it had started in xlog_cil_force_seq()
1148 * we would have found the context on the committing list. in xlog_cil_force_seq()
1160 * We detected a shutdown in progress. We need to trigger the log force in xlog_cil_force_seq()
1162 * we are already in a shutdown state. Hence we can't return in xlog_cil_force_seq()
1164 * LSN is already stable), so we return a zero LSN instead. in xlog_cil_force_seq()
1173 * We can't rely on just the log item being in the CIL, we have to check
1192 * current sequence, we're in a new checkpoint. in xfs_log_item_in_current_chkpt()