Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/diskio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use std::{
};

use anyhow::anyhow;
use tracing::{error, trace, warn};
use tracing::{debug, error, trace, warn};

use crate::{
diskio::immediate::{FileState, IncrementalFileWriter},
Expand Down Expand Up @@ -474,12 +474,10 @@ pub(super) fn get_executor<'a>(
fn effective_thread_count(ram_budget: usize, thread_count: IoThreadCount) -> usize {
match thread_count {
IoThreadCount::Default(n) if n > 1 && ram_budget < LOW_MEMORY_THRESHOLD => {
warn!(
"using single-threaded unpacking due to low memory \
(ram budget: {} < {} threshold), \
set RUSTUP_IO_THREADS to override",
debug!(
"using single-threaded unpacking due to low memory (ram budget: {} < {} threshold), set RUSTUP_IO_THREADS to override",
Size::new(ram_budget),
Size::new(LOW_MEMORY_THRESHOLD)
Size::new(LOW_MEMORY_THRESHOLD),
);
1
}
Expand Down
8 changes: 3 additions & 5 deletions src/diskio/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use super::{Executor, Item, Kind, get_executor};
use super::{Item, Kind, get_executor};
use crate::{process::TestProcess, test::test_dir};

impl Item {
Expand All @@ -21,8 +21,7 @@ fn test_incremental_file(io_threads: &str) -> anyhow::Result<()> {

let mut written = 0;
let mut file_finished = false;
let mut io_executor: Box<dyn Executor> =
get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?);
let mut io_executor = get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?);
let (item, mut sender) = Item::write_file_segmented(
work_dir.path().join("scratch"),
0o666,
Expand Down Expand Up @@ -88,8 +87,7 @@ fn test_complete_file(io_threads: &str) -> anyhow::Result<()> {
vars.insert("RUSTUP_IO_THREADS".to_string(), io_threads.to_string());
let tp = TestProcess::with_vars(vars);

let mut io_executor: Box<dyn Executor> =
get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?);
let mut io_executor = get_executor(32 * 1024 * 1024, tp.process.io_thread_count()?);
let mut chunk = io_executor.get_buffer(10);
chunk.extend(b"0123456789");
assert_eq!(chunk.len(), 10);
Expand Down
Loading