Changeset aeb6f25 in mainline for kernel/generic/src/sysinfo/sysinfo.c


Ignore:
Timestamp:
2010-04-26T20:09:02Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b4ad39f
Parents:
acda8f0
Message:

Do copy_to_uspace() when not holding the sysinfo spinlock. The opposit may
result in a situation when the spinlock is held for an excessive period of time
because copy_to_uspace() blocked on a memory management mutex.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/sysinfo/sysinfo.c

    racda8f0 raeb6f25  
    729729           binary data since we request a dry run */
    730730        sysinfo_return_t ret = sysinfo_get_item_uspace(path_ptr, path_size, true);
     731
     732        spinlock_unlock(&sysinfo_lock);
     733        interrupts_restore(ipl);
     734       
    731735        int rc;
    732736       
     
    737741                rc = EINVAL;
    738742       
    739         spinlock_unlock(&sysinfo_lock);
    740         interrupts_restore(ipl);
    741        
    742743        return (unative_t) rc;
    743744}
     
    770771           binary data since we request a dry run */
    771772        sysinfo_return_t ret = sysinfo_get_item_uspace(path_ptr, path_size, true);
     773
     774        spinlock_unlock(&sysinfo_lock);
     775        interrupts_restore(ipl);
     776       
    772777        int rc;
    773778       
     
    779784                rc = EINVAL;
    780785       
    781         spinlock_unlock(&sysinfo_lock);
    782         interrupts_restore(ipl);
    783        
    784786        return (unative_t) rc;
    785787}
     
    814816        /* Get the item */
    815817        sysinfo_return_t ret = sysinfo_get_item_uspace(path_ptr, path_size, false);
     818
     819        spinlock_unlock(&sysinfo_lock);
     820        interrupts_restore(ipl);
     821
    816822        int rc;
    817823       
     
    831837                free(ret.data.data);
    832838       
    833         spinlock_unlock(&sysinfo_lock);
    834         interrupts_restore(ipl);
    835        
    836839        return (unative_t) rc;
    837840}
Note: See TracChangeset for help on using the changeset viewer.