• Sebastian Andrzej Siewior's avatar
    kcov: replace local_irq_save() with a local_lock_t · d5d2c51f
    Sebastian Andrzej Siewior authored
    The kcov code mixes local_irq_save() and spin_lock() in
    kcov_remote_{start|end}().  This creates a warning on PREEMPT_RT because
    local_irq_save() disables interrupts and spin_lock_t is turned into a
    sleeping lock which can not be acquired in a section with disabled
    interrupts.
    
    The kcov_remote_lock is used to synchronize the access to the hash-list
    kcov_remote_map.  The local_irq_save() block protects access to the
    per-CPU data kcov_percpu_data.
    
    There is no compelling reason to change the lock type to raw_spin_lock_t
    to make it work with local_irq_save().  Changing it would require to
    move memory allocation (in kcov_remote_add()) and deallocation outside
    of the locked section.
    
    Adding an unlimited amount of entries to the hashlist will increase the
    IRQ-off time during lookup.  It could be argued that this is debug code
    and the latency does not matter.  There is however no need to do so and
    it would allow to use this facility in an RT enabled build.
    
    Usin...
    d5d2c51f
kcov.c 28.2 KB