Changeset 10005fd in mainline


Ignore:
Timestamp:
2025-03-06T20:13:51Z (3 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
d6fe2a1
Parents:
4d42a1b
Message:

hr: remove vol→halt_please bit and vol→halt_lock

RW locks are not write-starved now

Location:
uspace/srv/bd/hr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/hr.c

    r4d42a1b r10005fd  
    249249        fibril_mutex_initialize(&new_volume->lock); /* XXX: will remove this */
    250250
    251         fibril_mutex_initialize(&new_volume->halt_lock);
    252         new_volume->halt_please = false;
    253 
    254251        fibril_rwlock_initialize(&new_volume->extents_lock);
    255252        fibril_rwlock_initialize(&new_volume->states_lock);
  • uspace/srv/bd/hr/raid1.c

    r4d42a1b r10005fd  
    344344
    345345        /*
    346          * this is to allow adding hotspare or start a rebuild on
    347          * very busy array, because of how rwlocks are implemented
    348          * in HelenOS (no writer priority, so if there are multiple
    349          * continuos readers, writer will never own the lock)
    350          */
    351         if (vol->halt_please) {
    352                 fibril_mutex_lock(&vol->halt_lock);
    353                 fibril_mutex_unlock(&vol->halt_lock);
    354         }
    355 
    356         /*
    357346         * extent order has to be locked for the whole IO duration,
    358347         * so that workers have consistent targets
     
    591580        errno_t rc = EOK;
    592581
    593         fibril_mutex_lock(&vol->halt_lock);
    594         vol->halt_please = true;
    595582        fibril_rwlock_write_lock(&vol->extents_lock);
    596583        fibril_rwlock_write_lock(&vol->states_lock);
     
    651638        fibril_rwlock_write_unlock(&vol->states_lock);
    652639        fibril_rwlock_write_unlock(&vol->extents_lock);
    653         vol->halt_please = false;
    654         fibril_mutex_unlock(&vol->halt_lock);
    655640
    656641        return rc;
  • uspace/srv/bd/hr/var.h

    r4d42a1b r10005fd  
    106106        fibril_rwlock_t states_lock;
    107107
    108         /* for halting IO requests when a REBUILD start waits */
    109         bool halt_please;
    110         fibril_mutex_t halt_lock;
    111 
    112108        _Atomic bool state_changed;
    113109        _Atomic uint64_t rebuild_blk;
Note: See TracChangeset for help on using the changeset viewer.