Run the last job of gNB pusch channel estimation inline
In case of 1 antenna this prevents the usage of threadpool which eliminates the thread pool overhead. In case of >1 antenna the threadpool contention should be reduced providing smaller benefits.
This commit is contained in:
@@ -480,7 +480,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int nbAarx = 0;
|
|
||||||
int nest_count = 0;
|
int nest_count = 0;
|
||||||
uint64_t noise_amp2 = 0;
|
uint64_t noise_amp2 = 0;
|
||||||
delay_t *delay = &gNB->ulsch[ul_id].delay;
|
delay_t *delay = &gNB->ulsch[ul_id].delay;
|
||||||
@@ -503,9 +502,10 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
initNotifiedFIFO(&respPuschAarx);
|
initNotifiedFIFO(&respPuschAarx);
|
||||||
start_meas(&gNB->pusch_channel_estimation_antenna_processing_stats);
|
start_meas(&gNB->pusch_channel_estimation_antenna_processing_stats);
|
||||||
int numAntennas = gNB->dmrs_num_antennas_per_thread;
|
int numAntennas = gNB->dmrs_num_antennas_per_thread;
|
||||||
for (int aarx = 0; aarx < gNB->frame_parms.nb_antennas_rx; aarx += numAntennas) {
|
int num_jobs = CEILIDIV(gNB->frame_parms.nb_antennas_rx, numAntennas);
|
||||||
|
for (int job_id = 0; job_id < num_jobs; job_id++) {
|
||||||
union puschAntennaReqUnion id = {.s = {ul_id, 0}};
|
union puschAntennaReqUnion id = {.s = {ul_id, 0}};
|
||||||
id.p = 1 + aarx;
|
id.p = 1 + job_id * numAntennas;
|
||||||
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(puschAntennaProc_t),
|
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(puschAntennaProc_t),
|
||||||
id.p,
|
id.p,
|
||||||
&respPuschAarx,
|
&respPuschAarx,
|
||||||
@@ -517,7 +517,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
rdata->nl = nl;
|
rdata->nl = nl;
|
||||||
rdata->p = p;
|
rdata->p = p;
|
||||||
rdata->symbol = symbol;
|
rdata->symbol = symbol;
|
||||||
rdata->aarx = aarx;
|
rdata->aarx = job_id * numAntennas;
|
||||||
rdata->numAntennas = numAntennas;
|
rdata->numAntennas = numAntennas;
|
||||||
rdata->bwp_start_subcarrier = bwp_start_subcarrier;
|
rdata->bwp_start_subcarrier = bwp_start_subcarrier;
|
||||||
rdata->pusch_pdu = pusch_pdu;
|
rdata->pusch_pdu = pusch_pdu;
|
||||||
@@ -532,15 +532,19 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
rdata->chest_freq = gNB->chest_freq;
|
rdata->chest_freq = gNB->chest_freq;
|
||||||
rdata->rxdataF = gNB->common_vars.rxdataF;
|
rdata->rxdataF = gNB->common_vars.rxdataF;
|
||||||
// Call the nr_pusch_antenna_processing function
|
// Call the nr_pusch_antenna_processing function
|
||||||
pushTpool(&gNB->threadPool, req);
|
if (job_id == num_jobs - 1) {
|
||||||
nbAarx++;
|
// Run the last job inline
|
||||||
|
nr_pusch_antenna_processing(rdata);
|
||||||
LOG_D(PHY, "Added Antenna (count %d) to process, in pipe\n", nbAarx);
|
delNotifiedFIFO_elt(req);
|
||||||
|
} else {
|
||||||
|
pushTpool(&gNB->threadPool, req);
|
||||||
|
}
|
||||||
|
LOG_D(PHY, "Added Antenna (count %d/%d) to process, in pipe\n", job_id, num_jobs);
|
||||||
} // Antenna Loop
|
} // Antenna Loop
|
||||||
|
|
||||||
while (nbAarx > 0) {
|
while (num_jobs - 1 > 0) {
|
||||||
notifiedFIFO_elt_t *req = pullTpool(&respPuschAarx, &gNB->threadPool);
|
notifiedFIFO_elt_t *req = pullTpool(&respPuschAarx, &gNB->threadPool);
|
||||||
nbAarx--;
|
num_jobs--;
|
||||||
delNotifiedFIFO_elt(req);
|
delNotifiedFIFO_elt(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user