Changeset c0d814a in mainline for kernel/generic/src/mm/frame.c


Ignore:
Timestamp:
2025-04-10T20:02:30Z (4 days ago)
Author:
GitHub <noreply@…>
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)
Message:

Merge pull request #6 from HelenOS/master

Merge pending changes from downstream helenos/master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/frame.c

    ra92290d rc0d814a  
    7272 * available.
    7373 */
    74 static MUTEX_INITIALIZE(mem_avail_mtx, MUTEX_ACTIVE);
     74static IRQ_SPINLOCK_INITIALIZE(mem_avail_lock);
    7575static CONDVAR_INITIALIZE(mem_avail_cv);
    7676static size_t mem_avail_req = 0;  /**< Number of frames requested. */
     
    951951#endif
    952952
    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);
    959955
    960956                if (mem_avail_req > 0)
     
    966962
    967963                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);
    972967
    973968#ifdef CONFIG_DEBUG
     
    10271022        irq_spinlock_unlock(&zones.lock, true);
    10281023
    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);
    10381028
    10391029        if (mem_avail_req > 0)
     
    10451035        }
    10461036
    1047         mutex_unlock(&mem_avail_mtx);
    1048         interrupts_restore(ipl);
     1037        irq_spinlock_unlock(&mem_avail_lock, true);
    10491038
    10501039        if (!(flags & FRAME_NO_RESERVE))
Note: See TracChangeset for help on using the changeset viewer.