Skip to content

Conversation

@heiher
Copy link
Contributor

@heiher heiher commented Feb 4, 2026

get_resident_set_size computed RSS by multiplying the number of pages from /proc/self/statm with a hard-coded 4096-byte page size. This produces incorrect results on systems where the runtime page size is not 4 KiB.

Use sysconf(_SC_PAGESIZE) to determine the actual page size at runtime so the RSS reported in -Z time-passes output is accurate across platforms.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 4, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

`get_resident_set_size` computed RSS by multiplying the number of pages
from `/proc/self/statm` with a hard-coded 4096-byte page size. This
produces incorrect results on systems where the runtime page size is
not 4 KiB.

Use `sysconf(_SC_PAGESIZE)` to determine the actual page size at runtime
so the RSS reported in `-Z time-passes` output is accurate across
platforms.
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 5, 2026

📌 Commit 78b55fc has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 5, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
Fix incorrect RSS on systems with non-4K page size

`get_resident_set_size` computed RSS by multiplying the number of pages from `/proc/self/statm` with a hard-coded 4096-byte page size. This produces incorrect results on systems where the runtime page size is not 4 KiB.

Use `sysconf(_SC_PAGESIZE)` to determine the actual page size at runtime so the RSS reported in `-Z time-passes` output is accurate across platforms.
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
Fix incorrect RSS on systems with non-4K page size

`get_resident_set_size` computed RSS by multiplying the number of pages from `/proc/self/statm` with a hard-coded 4096-byte page size. This produces incorrect results on systems where the runtime page size is not 4 KiB.

Use `sysconf(_SC_PAGESIZE)` to determine the actual page size at runtime so the RSS reported in `-Z time-passes` output is accurate across platforms.
rust-bors bot pushed a commit that referenced this pull request Feb 5, 2026
Rollup of 19 pull requests

Successful merges:

 - #146900 (Add avr_target_feature)
 - #150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152110 (Fix incorrect RSS on systems with non-4K page size)
 - #152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - #152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - #152109 (Convert to inline diagnostics in `rustc_errors`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
rust-bors bot pushed a commit that referenced this pull request Feb 5, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152110 (Fix incorrect RSS on systems with non-4K page size)
 - #152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - #152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - #152109 (Convert to inline diagnostics in `rustc_errors`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
@rust-bors rust-bors bot merged commit e4a7eb7 into rust-lang:main Feb 5, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 5, 2026
rust-timer added a commit that referenced this pull request Feb 5, 2026
Rollup merge of #152110 - heiher:fix-rss, r=jieyouxu

Fix incorrect RSS on systems with non-4K page size

`get_resident_set_size` computed RSS by multiplying the number of pages from `/proc/self/statm` with a hard-coded 4096-byte page size. This produces incorrect results on systems where the runtime page size is not 4 KiB.

Use `sysconf(_SC_PAGESIZE)` to determine the actual page size at runtime so the RSS reported in `-Z time-passes` output is accurate across platforms.
@heiher heiher deleted the fix-rss branch February 5, 2026 12:43
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 6, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - rust-lang/rust#152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - rust-lang/rust#152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - rust-lang/rust#152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - rust-lang/rust#152020 (Remove dummy loads on offload codegen)
 - rust-lang/rust#152023 (Some `rustc_query_system` cleanups)
 - rust-lang/rust#152068 (Convert to inline diagnostics in `rustc_resolve`)
 - rust-lang/rust#152081 (Port depgraph testing attributes to parser)
 - rust-lang/rust#152090 (Port reexport_test_harness_main to attr parser)
 - rust-lang/rust#152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - rust-lang/rust#152108 (Convert to inline diagnostics in `rustc_expand`)
 - rust-lang/rust#152110 (Fix incorrect RSS on systems with non-4K page size)
 - rust-lang/rust#152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - rust-lang/rust#152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - rust-lang/rust#152115 (Convert to inline diagnostics in `rustc_metadata`)
 - rust-lang/rust#152116 (Remove rustdoc GUI flaky test)
 - rust-lang/rust#152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - rust-lang/rust#152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - rust-lang/rust#152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - rust-lang/rust#152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - rust-lang/rust#152109 (Convert to inline diagnostics in `rustc_errors`)
 - rust-lang/rust#152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - rust-lang/rust#152119 (Convert to inline diagnostics in `rustc_middle`)
 - rust-lang/rust#152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - rust-lang/rust#152131 (Port rustc_no_implicit_bounds attribute to parser.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants