Skip to content

Commit

Permalink
prov/rxd: Move the receive repost/remove to earlier in the pkt handling
Browse files Browse the repository at this point in the history
The aim of changes is posting a new recive buffer right away, and don't
wait for finishing the handle of a recive complition. We post a recieve
buffer at once.

The changes have caused the performance part:
The results were run on alltoall test, and it shows us
better results from 64Kb to 4Mb with comparing 'without the current
changes'. But see a little regress from 1b to 64Kb, the diff is
about ~0.08 usec (not bigger).

Signed-off-by: Nikita Gusev <nikita.gusev@intel.com>
  • Loading branch information
nikitaxgusev committed Jul 24, 2019
1 parent 3b15cc3 commit 7f8d168
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
1 change: 0 additions & 1 deletion prov/rxd/src/rxd.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ int rxd_av_insert_dg_addr(struct rxd_av *av, const void *addr,

/* Pkt resource functions */
int rxd_ep_post_buf(struct rxd_ep *ep);
void rxd_release_repost_rx(struct rxd_ep *ep, struct rxd_pkt_entry *pkt_entry);
void rxd_ep_send_ack(struct rxd_ep *rxd_ep, fi_addr_t peer);
struct rxd_pkt_entry *rxd_get_tx_pkt(struct rxd_ep *ep);
struct rxd_x_entry *rxd_get_tx_entry(struct rxd_ep *ep, uint32_t op);
Expand Down
18 changes: 6 additions & 12 deletions prov/rxd/src/rxd_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ static void rxd_remove_rx_pkt(struct rxd_ep *ep, struct rxd_pkt_entry *pkt_entry
}
}

void rxd_release_repost_rx(struct rxd_ep *ep, struct rxd_pkt_entry *pkt_entry)
{
ofi_buf_free(pkt_entry);
rxd_ep_post_buf(ep);
}

static void rxd_complete_rx(struct rxd_ep *ep, struct rxd_x_entry *rx_entry)
{
struct fi_cq_err_entry err_entry;
Expand Down Expand Up @@ -932,7 +926,7 @@ static void rxd_progress_buf_pkts(struct rxd_ep *ep, fi_addr_t peer)
"could not write error entry\n");
ep->peers[base_hdr->peer].rx_seq_no++;
dlist_remove(&pkt_entry->d_entry);
rxd_release_repost_rx(ep, pkt_entry);
ofi_buf_free(pkt_entry);
continue;
}
if (!rx_entry) {
Expand All @@ -951,7 +945,7 @@ static void rxd_progress_buf_pkts(struct rxd_ep *ep, fi_addr_t peer)

ep->peers[base_hdr->peer].rx_seq_no++;
dlist_remove(&pkt_entry->d_entry);
rxd_release_repost_rx(ep, pkt_entry);
ofi_buf_free(pkt_entry);
}
}

Expand Down Expand Up @@ -994,7 +988,7 @@ static void rxd_handle_data(struct rxd_ep *ep, struct rxd_pkt_entry *pkt_entry)
}
free:
rxd_remove_rx_pkt(ep, pkt_entry);
rxd_release_repost_rx(ep, pkt_entry);
ofi_buf_free(pkt_entry);
}

static void rxd_handle_op(struct rxd_ep *ep, struct rxd_pkt_entry *pkt_entry)
Expand Down Expand Up @@ -1062,7 +1056,7 @@ static void rxd_handle_op(struct rxd_ep *ep, struct rxd_pkt_entry *pkt_entry)
rxd_ep_send_ack(ep, base_hdr->peer);
release:
rxd_remove_rx_pkt(ep, pkt_entry);
rxd_release_repost_rx(ep, pkt_entry);
ofi_buf_free(pkt_entry);
}

static void rxd_handle_cts(struct rxd_ep *ep, struct rxd_pkt_entry *pkt_entry)
Expand Down Expand Up @@ -1159,7 +1153,7 @@ void rxd_handle_recv_comp(struct rxd_ep *ep, struct fi_cq_msg_entry *comp)
"got recv completion (type: %s)\n",
rxd_pkt_type_str[(rxd_pkt_type(pkt_entry))]);

ep->posted_bufs--;
rxd_ep_post_buf(ep);

pkt_entry->pkt_size = comp->len;
switch (rxd_pkt_type(pkt_entry)) {
Expand Down Expand Up @@ -1188,7 +1182,7 @@ void rxd_handle_recv_comp(struct rxd_ep *ep, struct fi_cq_msg_entry *comp)
}

rxd_remove_rx_pkt(ep, pkt_entry);
rxd_release_repost_rx(ep, pkt_entry);
ofi_buf_free(pkt_entry);
}

void rxd_handle_error(struct rxd_ep *ep)
Expand Down
6 changes: 0 additions & 6 deletions prov/rxd/src/rxd_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,12 +978,6 @@ void rxd_ep_progress(struct util_ep *util_ep)
}

out:
while (ep->posted_bufs < ep->rx_size) {
ret = rxd_ep_post_buf(ep);
if (ret)
break;
}

fastlock_release(&ep->util_ep.lock);
}

Expand Down

0 comments on commit 7f8d168

Please sign in to comment.