Changeset 632 for trunk/kernel/libk/remote_barrier.c
- Timestamp:
- May 28, 2019, 2:56:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_barrier.c
r629 r632 506 506 uint32_t nthreads ) 507 507 { 508 page_t * dqt_page;509 508 xptr_t dqt_page_xp; 510 509 page_t * rpc_page; … … 514 513 uint32_t z; // actual DQT size == max(x_size,y_size) 515 514 uint32_t levels; // actual number of DQT levels 516 kmem_req_t req; // kmem request517 515 xptr_t rpc_xp; // extended pointer on RPC descriptors array 518 516 rpc_desc_t * rpc; // pointer on RPC descriptors array … … 522 520 uint32_t y; // Y coordinate in QDT mesh 523 521 uint32_t l; // level coordinate 522 kmem_req_t req; // kmem request 524 523 525 524 // compute size and number of DQT levels … … 554 553 cxy_t ref_cxy = GET_CXY( ref_xp ); 555 554 556 // 1. allocate memory for DQT barrier descriptor in reference cluster 557 if( ref_cxy == local_cxy ) 558 { 559 req.type = KMEM_PAGE; 560 req.size = 2; // 4 pages == 16 Kbytes 561 req.flags = AF_ZERO; 562 dqt_page = kmem_alloc( &req ); 563 dqt_page_xp = XPTR( local_cxy , dqt_page ); 564 } 565 else 566 { 567 rpc_pmem_get_pages_client( ref_cxy, 568 2, 569 &dqt_page ); 570 dqt_page_xp = XPTR( ref_cxy , dqt_page ); 571 } 572 573 if( dqt_page == NULL ) return NULL; 555 // 1. allocate 4 4 Kbytes pages for DQT barrier descriptor in reference cluster 556 dqt_page_xp = ppm_remote_alloc_pages( ref_cxy , 2 ); 557 558 if( dqt_page_xp == XPTR_NULL ) return NULL; 574 559 575 560 // get pointers on DQT barrier descriptor … … 948 933 949 934 // 4. release memory allocated for barrier descriptor 950 xptr_t page_xp = ppm_base2page( barrier_xp ); 951 page_t * page = GET_PTR( page_xp ); 952 953 if( barrier_cxy == local_cxy ) 954 { 955 req.type = KMEM_PAGE; 956 req.ptr = page; 957 kmem_free( &req ); 958 } 959 else 960 { 961 rpc_pmem_release_pages_client( barrier_cxy, 962 page ); 963 } 935 xptr_t page_xp = ppm_base2page( barrier_xp ); 936 cxy_t page_cxy = GET_CXY( page_xp ); 937 page_t * page_ptr = GET_PTR( page_xp ); 938 939 ppm_remote_free_pages( page_cxy , page_ptr ); 964 940 965 941 #if DEBUG_BARRIER_DESTROY
Note: See TracChangeset
for help on using the changeset viewer.