Ignore:
Timestamp:
Jun 3, 2017, 4:46:59 PM (7 years ago)
Author:
max@…
Message:

cosmetic, and a few typos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/cluster.c

    r14 r19  
    11/*
    22 * cluster.c - Cluster-Manager related operations
    3  * 
     3 *
    44 * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
    55 *         Mohamed Lamine Karaoui (2015)
     
    6868
    6969    // initialize cluster global parameters
    70         cluster->paddr_width     = info->paddr_width; 
     70        cluster->paddr_width     = info->paddr_width;
    7171        cluster->x_width         = info->x_width;
    7272        cluster->y_width         = info->y_width;
     
    7777    // initialize cluster local parameters
    7878        cluster->cores_nr        = info->cores_nr;
    79     cluster->cores_in_kernel = info->cores_nr;   // all cpus start in kernel mode
    80 
    81     // initialize the lock protectig the embedded kcm allocator
     79    cluster->cores_in_kernel = info->cores_nr; // all cpus start in kernel mode
     80
     81    // initialize the lock protecting the embedded kcm allocator
    8282        spinlock_init( &cluster->kcm_lock );
    8383
    84     // initialises DQDT 
    85     cluster->dqdt_root_level = dqdt_init( info->x_size, 
    86                                           info->y_size, 
     84    // initialises DQDT
     85    cluster->dqdt_root_level = dqdt_init( info->x_size,
     86                                          info->y_size,
    8787                                          info->y_width );
    8888    cluster->threads_var = 0;
     
    9696    // initialises embedded KHM
    9797        khm_init( &cluster->khm );
    98  
    99     // initialises embedded KCM 
     98
     99    // initialises embedded KCM
    100100        kcm_init( &cluster->kcm , KMEM_KCM );
    101101
     
    107107                       info->core[lid].gid );      // gid from boot_info_t
    108108        }
    109        
     109
    110110    // initialises RPC fifo
    111111        rpc_fifo_init( &cluster->rpc_fifo );
     
    114114        spinlock_init( &cluster->pmgr.pref_lock );
    115115    cluster->pmgr.pref_nr = 0;
    116     cluster->pmgr.pref_tbl[0] = XPTR( local_cxy , &process_zero );   
     116    cluster->pmgr.pref_tbl[0] = XPTR( local_cxy , &process_zero );
    117117    for( lpid = 1 ; lpid < CONFIG_MAX_PROCESS_PER_CLUSTER ; lpid++ )
    118118    {
     
    131131        cluster->pmgr.copies_nr[lpid] = 0;
    132132        xlist_root_init( XPTR( local_cxy , &cluster->pmgr.copies_root[lpid] ) );
    133     }   
     133    }
    134134
    135135    hal_wbflush();
     
    148148    uint32_t y = cxy & ((1<<y_width)-1);
    149149
    150     if( x >= cluster->x_size ) return true; 
    151     if( y >= cluster->y_size ) return true; 
     150    if( x >= cluster->x_size ) return true;
     151    if( y >= cluster->y_size ) return true;
    152152
    153153    return false;
     
    188188            sel = lid;
    189189        }
    190     } 
     190    }
    191191    return sel;
    192192}
     
    198198//////////////////////////////////////////////////////////
    199199xptr_t cluster_get_reference_process_from_pid( pid_t pid )
    200 { 
     200{
    201201    xptr_t xp;   // extended pointer on process descriptor
    202202
     
    207207    lpid_t lpid      = LPID_FROM_PID( pid );
    208208
    209     // Check valid PID 
     209    // Check valid PID
    210210    if( lpid >= CONFIG_MAX_PROCESS_PER_CLUSTER )
    211211    {
     
    215215
    216216    if( local_cxy == owner_cxy )   // local cluster is owner cluster
    217     { 
     217    {
    218218        xp = cluster->pmgr.pref_tbl[lpid];
    219219    }
     
    264264    {
    265265        error = EAGAIN;
    266     }   
     266    }
    267267
    268268    // release the processs_manager lock
     
    307307    list_entry_t * iter;
    308308    process_t    * process;
    309    
     309
    310310    LIST_FOREACH( root , iter )
    311311    {
     
    370370    xptr_t copies_entry = XPTR( local_cxy , &process->copies_list );
    371371
    372     // get lock protecting copies_list[lpid] 
     372    // get lock protecting copies_list[lpid]
    373373    remote_spinlock_lock( copies_lock );
    374374
     
    376376    hal_remote_atomic_add( XPTR( owner_cxy , &pm->copies_nr[lpid] ) , 1 );
    377377
    378     // release lock protecting copies_list[lpid] 
     378    // release lock protecting copies_list[lpid]
    379379    remote_spinlock_unlock( copies_lock );
    380380}
     
    396396    xptr_t copies_entry = XPTR( local_cxy , &process->copies_list );
    397397
    398     // get lock protecting copies_list[lpid] 
     398    // get lock protecting copies_list[lpid]
    399399    remote_spinlock_lock( copies_lock );
    400400
     
    402402    hal_remote_atomic_add( XPTR( owner_cxy , &pm->copies_nr[lpid] ) , -1 );
    403403
    404     // release lock protecting copies_list[lpid] 
     404    // release lock protecting copies_list[lpid]
    405405    remote_spinlock_unlock( copies_lock );
    406406}
     
    408408////////////////////////////////////////////////////////////////////////////////////////
    409409// TODO Il me semble que la seule chose que fait ce kernel thread à chaque réveil
    410 // est de mettre à jour la DQDT, et de se rendormir... A-t-on besoin d'un thread ? [AG] 
     410// est de mettre à jour la DQDT, et de se rendormir... A-t-on besoin d'un thread ? [AG]
    411411//////////////////////////////////////////////////////////////////////////////////////////
    412412
     
    437437        isRootMgr = (cluster == root_home) ? true : false;
    438438        cntr      = 0;
    439         period    = (isRootMgr) ? 
    440                 CONFIG_DQDT_ROOTMGR_PERIOD * MSEC_PER_TICK : 
     439        period    = (isRootMgr) ?
     440                CONFIG_DQDT_ROOTMGR_PERIOD * MSEC_PER_TICK :
    441441                CONFIG_DQDT_MGR_PERIOD * MSEC_PER_TICK;
    442442
     
    444444        event_set_priority(&event, E_CHR);
    445445        event_set_handler(&event, &manager_alarm_event_handler);
    446  
     446
    447447        info.event = &event;
    448448        thread_preempt_disable(CURRENT_THREAD);
     
    459459                        if((cntr % 10) == 0)
    460460                        {
    461                                 printk(INFO, "INFO: cpu %d, DQDT update ended [ %u - %u ]\n", 
    462                                        cpu_id, 
    463                                        tm_end, 
     461                                printk(INFO, "INFO: cpu %d, DQDT update ended [ %u - %u ]\n",
     462                                       cpu_id,
     463                                       tm_end,
    464464                                       tm_end - tm_start);
    465465
     
    480480{
    481481        struct thread_s *manager;
    482  
     482
    483483        manager = event_get_senderId(event);
    484  
     484
    485485        thread_preempt_disable(CURRENT_THREAD);
    486486
     
    488488
    489489        sched_wakeup(manager);
    490  
     490
    491491        thread_preempt_enable(CURRENT_THREAD);
    492492
     
    513513        {
    514514                ckey->val = key;
    515                 cluster->keys_tbl[key] = (void *) 0x1; // Reserved 
     515                cluster->keys_tbl[key] = (void *) 0x1; // Reserved
    516516                cluster->next_key = key;
    517517                event_set_error(event, 0);
Note: See TracChangeset for help on using the changeset viewer.