Skip to content

Commit

Permalink
Remove tracking exact inner size for now
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Feb 14, 2021
1 parent 805009c commit 3d23691
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub const FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET: u64 = 2;
// Fixed thread size seems to be fastest on GCP setup
pub const NUM_THREADS: u32 = 4;

const TOTAL_BUFFERED_PACKETS: usize = 500_000;
pub const TOTAL_BUFFERED_PACKETS: usize = 500_000;

const MAX_NUM_TRANSACTIONS_PER_BATCH: usize = 128;

Expand Down
5 changes: 3 additions & 2 deletions core/src/tpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! multi-stage transaction processing pipeline in software.
use crate::{
banking_stage::BankingStage,
banking_stage::{BankingStage, TOTAL_BUFFERED_PACKETS},
broadcast_stage::{BroadcastStage, BroadcastStageType, RetransmitSlotsReceiver},
cluster_info::ClusterInfo,
cluster_info_vote_listener::{ClusterInfoVoteListener, VerifiedVoteSender, VoteTracker},
Expand All @@ -19,6 +19,7 @@ use solana_runtime::{
bank_forks::BankForks,
vote_sender_types::{ReplayVoteReceiver, ReplayVoteSender},
};
use solana_streamer::packet::PACKETS_PER_BATCH;
use std::{
net::UdpSocket,
sync::{
Expand Down Expand Up @@ -67,7 +68,7 @@ impl Tpu {
&exit,
&packet_sender,
&poh_recorder,
Some(TOTAL_BUFFERED_PACKETS),
Some((TOTAL_BUFFERED_PACKETS + PACKETS_PER_BATCH - 1) / PACKETS_PER_BATCH),
);
let (verified_sender, verified_receiver) = unbounded();

Expand Down
3 changes: 0 additions & 3 deletions perf/src/cuda_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ pub struct PinnedVec<T: Default + Clone + Sized> {
}

impl<T: Default + Clone + Sized> Reset for PinnedVec<T> {
fn len(&self) -> usize {
self.len()
}
fn reset(&mut self) {
self.resize(0, T::default());
}
Expand Down
7 changes: 2 additions & 5 deletions perf/src/recycler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ impl<T: Default> RecyclerX<T> {
}

pub trait Reset {
fn len(&self) -> usize;
fn reset(&mut self);
fn warm(&mut self, size_hint: usize);
fn set_recycler(&mut self, recycler: Weak<RecyclerX<Self>>)
Expand Down Expand Up @@ -118,13 +117,11 @@ impl<T: Default + Reset + Sized> Recycler<T> {
let should_allocate = self
.recycler
.limit
.map(|limit| self.recycler.outstanding_len.load(Ordering::SeqCst) + t.len() <= limit)
.map(|limit| self.recycler.outstanding_len.load(Ordering::SeqCst) < limit)
.unwrap_or(true);
if should_allocate {
t.set_recycler(Arc::downgrade(&self.recycler));
self.recycler
.outstanding_len
.fetch_add(t.len(), Ordering::SeqCst);
self.recycler.outstanding_len.fetch_add(1, Ordering::SeqCst);
Some(t)
} else {
None
Expand Down

0 comments on commit 3d23691

Please sign in to comment.