Changeset 1b20da0 in mainline for kernel/generic/src/synch/futex.c


Ignore:
Timestamp:
2018-02-28T17:52:03Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3061bc1
Parents:
df6ded8
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
Message:

style: Remove trailing whitespace on non-empty lines, in certain file types.

Command used: tools/srepl '\([^[:space:]]\)\s\+$' '\1' -- *.c *.h *.py *.sh *.s *.S *.ag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/futex.c

    rdf6ded8 r1b20da0  
    3535 * @file
    3636 * @brief       Kernel backend for futexes.
    37  * 
    38  * Kernel futex objects are stored in a global hash table futex_ht 
     37 *
     38 * Kernel futex objects are stored in a global hash table futex_ht
    3939 * where the physical address of the futex variable (futex_t.paddr)
    40  * is used as the lookup key. As a result multiple address spaces 
    41  * may share the same futex variable. 
    42  * 
     40 * is used as the lookup key. As a result multiple address spaces
     41 * may share the same futex variable.
     42 *
    4343 * A kernel futex object is created the first time a task accesses
    44  * the futex (having a futex variable at a physical address not 
     44 * the futex (having a futex variable at a physical address not
    4545 * encountered before). Futex object's lifetime is governed by
    4646 * a reference count that represents the number of all the different
     
    4848 * physical address of the futex variable. A futex object is freed
    4949 * when the last task having accessed the futex exits.
    50  * 
     50 *
    5151 * Each task keeps track of the futex objects it accessed in a list
    52  * of pointers (futex_ptr_t, task->futex_list) to the different futex 
     52 * of pointers (futex_ptr_t, task->futex_list) to the different futex
    5353 * objects.
    54  * 
     54 *
    5555 * To speed up translation of futex variables' virtual addresses
    5656 * to their physical addresses, futex pointers accessed by the
    5757 * task are furthermore stored in a concurrent hash table (CHT,
    5858 * task->futexes->ht). A single lookup without locks or accesses
    59  * to the page table translates a futex variable's virtual address 
    60  * into its futex kernel object. 
     59 * to the page table translates a futex variable's virtual address
     60 * into its futex kernel object.
    6161 */
    6262
     
    119119
    120120/** Mutex protecting the global futex hash table.
    121  * 
     121 *
    122122 * Acquire task specific TASK->futex_list_lock before this mutex.
    123123 */
     
    125125
    126126/** Global kernel futex hash table. Lock futex_ht_lock before accessing.
    127  * 
     127 *
    128128 * Physical address of the futex variable is the lookup key.
    129129 */
     
    170170        if (interrupts_disabled()) {
    171171                /* Invoke the blocking cht_destroy in the background. */
    172                 workq_global_enqueue_noblock(&task->futexes->destroy_work, 
     172                workq_global_enqueue_noblock(&task->futexes->destroy_work,
    173173                        destroy_task_cache);
    174174        } else {
     
    181181static void destroy_task_cache(work_t *work)
    182182{
    183         struct futex_cache *cache = 
     183        struct futex_cache *cache =
    184184                member_to_inst(work, struct futex_cache, destroy_work);
    185185       
    186         /* 
     186        /*
    187187         * Destroy the cache before manually freeing items of the cache in case
    188188         * table resize is in progress.
     
    216216                 * task have already terminated, so they have also definitely
    217217                 * exited their CHT futex cache protecting rcu reader sections.
    218                  * Moreover release_ref() only frees the futex if this is the 
     218                 * Moreover release_ref() only frees the futex if this is the
    219219                 * last task referencing the futex. Therefore, only threads
    220220                 * of this task may have referenced the futex if it is to be freed.
     
    273273        futex_t *futex = find_cached_futex(uaddr);
    274274       
    275         if (futex) 
     275        if (futex)
    276276                return futex;
    277277
     
    319319
    320320        if (futex_ptr_link) {
    321                 futex_ptr_t *futex_ptr 
     321                futex_ptr_t *futex_ptr
    322322                        = member_to_inst(futex_ptr_link, futex_ptr_t, cht_link);
    323323               
     
    333333
    334334
    335 /** 
    336  * Returns a kernel futex for the physical address @a phys_addr and caches 
     335/**
     336 * Returns a kernel futex for the physical address @a phys_addr and caches
    337337 * it in this task under the virtual address @a uaddr (if not already cached).
    338338 */
     
    341341        futex_t *futex = malloc(sizeof(futex_t), 0);
    342342       
    343         /* 
    344          * Find the futex object in the global futex table (or insert it 
     343        /*
     344         * Find the futex object in the global futex table (or insert it
    345345         * if it is not present).
    346346         */
     
    360360        spinlock_unlock(&futex_ht_lock);
    361361       
    362         /* 
    363          * Cache the link to the futex object for this task. 
     362        /*
     363         * Cache the link to the futex object for this task.
    364364         */
    365365        futex_ptr_t *fut_ptr = malloc(sizeof(futex_ptr_t), 0);
     
    382382               
    383383                futex_ptr_t *dup = member_to_inst(dup_link, futex_ptr_t, cht_link);
    384                 futex = dup->futex;             
     384                futex = dup->futex;
    385385        }
    386386
     
    402402        futex_t *futex = get_futex(uaddr);
    403403       
    404         if (!futex) 
     404        if (!futex)
    405405                return (sys_errno_t) ENOENT;
    406406
     
    473473
    474474/*
    475  * Operations of a task's CHT that caches mappings of futex user space 
     475 * Operations of a task's CHT that caches mappings of futex user space
    476476 * virtual addresses to kernel futex objects.
    477477 */
Note: See TracChangeset for help on using the changeset viewer.