Changeset 611 for trunk/kernel/mm/ppm.c
- Timestamp:
- Jan 9, 2019, 3:02:51 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/ppm.c
r610 r611 210 210 211 211 #if DEBUG_PPM_ALLOC_PAGES 212 thread_t * this = CURRENT_THREAD; 212 213 uint32_t cycle = (uint32_t)hal_get_cycles(); 213 214 if( DEBUG_PPM_ALLOC_PAGES < cycle ) 214 printk("\n[ DBG] in %s : thread %x in process %xenter for %d page(s) / cycle %d\n",215 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 1<<order, cycle );215 printk("\n[%s] thread[%x,%x] enter for %d page(s) / cycle %d\n", 216 __FUNCTION__, this->process->pid, this->trdid, 1<<order, cycle ); 216 217 #endif 217 218 218 219 #if(DEBUG_PPM_ALLOC_PAGES & 0x1) 219 220 if( DEBUG_PPM_ALLOC_PAGES < cycle ) 220 ppm_print( );221 ppm_print("enter ppm_alloc_pages"); 221 222 #endif 222 223 223 224 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 224 225 225 assert( (order < CONFIG_PPM_MAX_ORDER) , 226 "illegal order argument = %x\n" , order );226 // check order 227 assert( (order < CONFIG_PPM_MAX_ORDER) , "illegal order argument = %d\n" , order ); 227 228 228 229 page_t * block = NULL; … … 250 251 cycle = (uint32_t)hal_get_cycles(); 251 252 if( DEBUG_PPM_ALLOC_PAGES < cycle ) 252 printk("\n[ DBG] in %s : thread %x in process %xcannot allocate %d page(s) / cycle %d\n",253 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 1<<order, cycle );253 printk("\n[%s] thread[%x,%x] cannot allocate %d page(s) / cycle %d\n", 254 __FUNCTION__, this->process->pid, this->trdid, 1<<order, cycle ); 254 255 #endif 255 256 … … 289 290 cycle = (uint32_t)hal_get_cycles(); 290 291 if( DEBUG_PPM_ALLOC_PAGES < cycle ) 291 printk("\n[ DBG] in %s : thread %x in process %xexit for %d page(s) / ppn = %x / cycle %d\n",292 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid,292 printk("\n[%s] thread[%x,%x] exit for %d page(s) / ppn = %x / cycle %d\n", 293 __FUNCTION__, this->process->pid, this->trdid, 293 294 1<<order, ppm_page2ppn(XPTR( local_cxy , block )), cycle ); 295 #endif 296 297 #if(DEBUG_PPM_ALLOC_PAGES & 0x1) 298 if( DEBUG_PPM_ALLOC_PAGES < cycle ) 299 ppm_print("exit ppm_alloc_pages"); 294 300 #endif 295 301 … … 307 313 uint32_t cycle = (uint32_t)hal_get_cycles(); 308 314 if( DEBUG_PPM_FREE_PAGES < cycle ) 309 printk("\n[ DBG] in %s : thread %x in process %xenter for %d page(s) / ppn %x / cycle %d\n",310 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid,315 printk("\n[%s] thread[%x,%x] enter for %d page(s) / ppn %x / cycle %d\n", 316 __FUNCTION__, this->process->pid, this->trdid, 311 317 1<<page->order, ppm_page2ppn(XPTR(local_cxy , page)), cycle ); 312 318 #endif … … 314 320 #if(DEBUG_PPM_FREE_PAGES & 0x1) 315 321 if( DEBUG_PPM_FREE_PAGES < cycle ) 316 ppm_print( );322 ppm_print("enter ppm_free_pages"); 317 323 #endif 318 324 … … 331 337 cycle = (uint32_t)hal_get_cycles(); 332 338 if( DEBUG_PPM_FREE_PAGES < cycle ) 333 printk("\n[ DBG] in %s : thread %x in process %xexit for %d page(s) / ppn %x / cycle %d\n",334 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid,339 printk("\n[%s] thread[%x,%x] exit for %d page(s) / ppn %x / cycle %d\n", 340 __FUNCTION__, this->process->pid, this->trdid, 335 341 1<<page->order, ppm_page2ppn(XPTR(local_cxy , page)), cycle ); 336 342 #endif 337 343 344 #if(DEBUG_PPM_FREE_PAGES & 0x1) 345 if( DEBUG_PPM_FREE_PAGES < cycle ) 346 ppm_print("exit ppm_free_pages"); 347 #endif 348 338 349 } // end ppm_free_pages() 339 350 340 ////////////////////// 341 void ppm_print( void)351 /////////////////////////////// 352 void ppm_print( char * string ) 342 353 { 343 354 uint32_t order; … … 350 361 busylock_acquire( &ppm->free_lock ); 351 362 352 printk("\n*** PPM in cluster %x : %d pages ***\n", local_cxy , ppm->pages_nr ); 363 printk("\n*** PPM in cluster %x / %s / %d pages ***\n", 364 local_cxy , string, ppm->pages_nr ); 353 365 354 366 for( order = 0 ; order < CONFIG_PPM_MAX_ORDER ; order++ ) … … 413 425 xptr_t dirty_lock_xp = XPTR( page_cxy , &ppm->dirty_lock ); 414 426 415 // printk("\n@@@ %s : before dirty_list lock aquire\n", __FUNCTION__ );416 417 427 // lock the remote PPM dirty_list 418 428 remote_queuelock_acquire( dirty_lock_xp ); 419 429 420 // printk("\n@@@ %s : after dirty_list lock aquire\n", __FUNCTION__ );421 422 430 // lock the remote page 423 431 remote_busylock_acquire( page_lock_xp ); 424 425 // printk("\n@@@ %s : after page lock aquire\n", __FUNCTION__ );426 432 427 433 // get remote page flags … … 466 472 } 467 473 468 // printk("\n@@@ %s : before page lock release\n", __FUNCTION__ );469 470 474 // unlock the remote page 471 475 remote_busylock_release( page_lock_xp ); 472 476 473 // printk("\n@@@ %s : after page lock release\n", __FUNCTION__ );474 475 477 // unlock the remote PPM dirty_list 476 478 remote_queuelock_release( dirty_lock_xp ); 477 478 // printk("\n@@@ %s : after page lock aquire\n", __FUNCTION__ );479 479 480 480 return done;
Note: See TracChangeset
for help on using the changeset viewer.