MCPcopy Create free account
hub / github.com/F-Stack/f-stack / swapclear

Function swapclear

freebsd/vm/vm_swapout.c:866–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864}
865
866static void
867swapclear(struct proc *p)
868{
869 struct thread *td;
870
871 PROC_LOCK_ASSERT(p, MA_OWNED);
872
873 FOREACH_THREAD_IN_PROC(p, td) {
874 thread_lock(td);
875 td->td_flags |= TDF_INMEM;
876 td->td_flags &= ~TDF_SWAPINREQ;
877 TD_CLR_SWAPPED(td);
878 if (TD_CAN_RUN(td)) {
879 if (setrunnable(td, 0)) {
880#ifdef INVARIANTS
881 /*
882 * XXX: We just cleared TDI_SWAPPED
883 * above and set TDF_INMEM, so this
884 * should never happen.
885 */
886 panic("not waking up swapper");
887#endif
888 }
889 } else
890 thread_unlock(td);
891 }
892 p->p_flag &= ~(P_SWAPPINGIN | P_SWAPPINGOUT);
893 p->p_flag |= P_INMEM;
894}
895
896static int
897swapout(struct proc *p)

Callers 2

faultinFunction · 0.85
swapoutFunction · 0.85

Calls 2

setrunnableFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected