Changeset c0d814a in mainline for kernel/generic/src/mm/frame.c
- Timestamp:
- 2025-04-10T20:02:30Z (4 days ago)
- Children:
- b8b031f
- Parents:
- a92290d (diff), 90dd8aee (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Wayne Thornton <wmthornton-dev@…> (2025-04-10 20:02:30)
- git-committer:
- GitHub <noreply@…> (2025-04-10 20:02:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/frame.c
ra92290d rc0d814a 72 72 * available. 73 73 */ 74 static MUTEX_INITIALIZE(mem_avail_mtx, MUTEX_ACTIVE);74 static IRQ_SPINLOCK_INITIALIZE(mem_avail_lock); 75 75 static CONDVAR_INITIALIZE(mem_avail_cv); 76 76 static size_t mem_avail_req = 0; /**< Number of frames requested. */ … … 951 951 #endif 952 952 953 /* 954 * Since the mem_avail_mtx is an active mutex, we need to 955 * disable interrupts to prevent deadlock with TLB shootdown. 956 */ 957 ipl_t ipl = interrupts_disable(); 958 mutex_lock(&mem_avail_mtx); 953 /* Disabled interrupts needed to prevent deadlock with TLB shootdown. */ 954 irq_spinlock_lock(&mem_avail_lock, true); 959 955 960 956 if (mem_avail_req > 0) … … 966 962 967 963 while (gen == mem_avail_gen) 968 condvar_wait(&mem_avail_cv, &mem_avail_mtx); 969 970 mutex_unlock(&mem_avail_mtx); 971 interrupts_restore(ipl); 964 condvar_wait(&mem_avail_cv, &mem_avail_lock); 965 966 irq_spinlock_unlock(&mem_avail_lock, true); 972 967 973 968 #ifdef CONFIG_DEBUG … … 1027 1022 irq_spinlock_unlock(&zones.lock, true); 1028 1023 1029 /* 1030 * Signal that some memory has been freed. 1031 * Since the mem_avail_mtx is an active mutex, 1032 * we need to disable interruptsto prevent deadlock 1033 * with TLB shootdown. 1034 */ 1035 1036 ipl_t ipl = interrupts_disable(); 1037 mutex_lock(&mem_avail_mtx); 1024 /* Signal that some memory has been freed. */ 1025 1026 /* Disabled interrupts needed to prevent deadlock with TLB shootdown. */ 1027 irq_spinlock_lock(&mem_avail_lock, true); 1038 1028 1039 1029 if (mem_avail_req > 0) … … 1045 1035 } 1046 1036 1047 mutex_unlock(&mem_avail_mtx); 1048 interrupts_restore(ipl); 1037 irq_spinlock_unlock(&mem_avail_lock, true); 1049 1038 1050 1039 if (!(flags & FRAME_NO_RESERVE))
Note:
See TracChangeset
for help on using the changeset viewer.