Skip to content

Conversation

@sergey-dryabzhinsky
Copy link
Contributor

Take 2 for issue #4510

Pull recent code from origin
New take on facebook#4510, add new preprocessor var to always choose logical cores over physical
@meta-cla meta-cla bot added the CLA Signed label Nov 6, 2025
@sergey-dryabzhinsky
Copy link
Contributor Author

Add new preprocessor var for cflags -DZSTDCLI_AUTO_THREADING_LOGICAL

@sergey-dryabzhinsky sergey-dryabzhinsky changed the title Issue 4510 preprocessor var to always use all logical cores [WIP] Issue 4510 preprocessor var to always use all logical cores Nov 6, 2025
Simplify output construction
@sergey-dryabzhinsky sergey-dryabzhinsky changed the title [WIP] Issue 4510 preprocessor var to always use all logical cores Issue 4510 preprocessor var to always use all logical cores Nov 7, 2025
@sergey-dryabzhinsky
Copy link
Contributor Author

Ready for review

@sergey-dryabzhinsky
Copy link
Contributor Author

sergey-dryabzhinsky commented Nov 25, 2025

Here some testing:
1 system:
CPU: 6-core/12-thread i7-6850K
OS: Proxmox3/ Debian7 + container OpenVZ6 (4 cores setup)

cmd1: grep -P 'cores|siblings' /proc/cpuinfo - as expected shows physical cpu attribs

siblings        : 12
cpu cores       : 6
siblings        : 12
cpu cores       : 6
siblings        : 12
cpu cores       : 6
siblings        : 12
cpu cores       : 6

cmd2: grep -c processor /proc/cpuinfo - as expected, equal to container setup

4

cmd3: w/o patch zstd -vv -T0 /dev/zero - not expected, wrong number of cores

*** Zstandard CLI (64-bit) v1.5.7, by Yann Collet ***
Note: 2 physical core(s) detected
Compressing with 2 worker threads
--zstd=wlog=21,clog=16,hlog=17,slog=1,mml=5,tlen=0,strat=2
--format=.zst --no-sparse --block-size=0 --memory=134217728 --threads=2 --content-size
zstd: /dev/zero is not a regular file -- ignored

cmd4: w/o patch zstd -vv -T0 --auto-threads=logical /dev/zero - shows number as expected

 *** Zstandard CLI (64-bit) v1.5.7, by Yann Collet ***
Note: 4 logical core(s) detected
Compressing with 4 worker threads
--zstd=wlog=21,clog=16,hlog=17,slog=1,mml=5,tlen=0,strat=2
--format=.zst --no-sparse --block-size=0 --memory=134217728 --threads=4 --content-size
zstd: /dev/zero is not a regular file -- ignored

@sergey-dryabzhinsky
Copy link
Contributor Author

With patch not working as expected.

@sergey-dryabzhinsky sergey-dryabzhinsky marked this pull request as draft November 25, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant