Posts tagged “linux”
16 posts Subscribe by RSS
16 posts
O_DIRECT alignment on Linux: ask statx instead of guessing
Linux O_DIRECT alignment of buffer address, offset and length varies by filesystem and kernel. Get it with STATX_DIOALIGN (6.1) and STATX_DIO_READ_ALIGN (6.14), and check stx_mask.
Why clock_gettime() may not show up in strace: the Linux vDSO
Your program calls clock_gettime(), yet strace shows no such call. A look at the vDSO the Linux kernel maps into each process, and how to read a syscall trace with it in mind.
Pinned to CPUs 0-7 but running only on 2-3: how Linux cpusets narrow your affinity mask
The kernel silently intersects your sched_setaffinity mask with the CPUs your cpuset/cgroup allows and the CPUs that exist. How to see the real set and diagnose EINVAL, per the man pages.
Finding false sharing with perf c2c: reading code that fights over one cache line
Adding threads but not getting faster? Find false sharing with Linux perf c2c: record and report options, reading offsets, CPU support differences and fixes, per the official docs.
The Linux kernel rbtree: a red-black tree with embedded nodes and no stored comparator
Linux's red-black tree never stores a comparator. Embedded nodes, your own search loop, helpers taking per-call compare functions, colour bits, cached and augmented trees, lockless lookup in v6.17.
write() succeeded. Is the data on disk? Short writes, late errors and fsync on Linux
A successful write() does not mean the data is on disk. Handling short writes, Linux 4.13+ writeback error reporting, what fsync and fdatasync cover, and when the directory needs fsync too.
Reading Linux Transparent Huge Pages settings: enabled, per-size controls, madvise and khugepaged
THP has a top-level enabled file and per-size hugepages-<size>kB/enabled files. It covers inherit, MADV_HUGEPAGE/MADV_NOHUGEPAGE and khugepaged, and how to check real use in /proc and sysfs.
Linux memory overcommit: overcommit_memory 0, 1, 2 and reading CommitLimit
What the three vm.overcommit_memory modes do, how to read CommitLimit and Committed_AS in /proc/meminfo, and what to check before switching to mode 2, based on the kernel documentation.
Reading Linux PSI: some, full, avg and total in /proc/pressure
What some and full, avg10/avg60/avg300 and total in /proc/pressure measure, how PSI differs from iowait, and the limits on pressure triggers, based on the kernel documentation.
Linux minor vs major page faults: what ru_minflt and ru_majflt count
On Linux, getrusage's ru_minflt and ru_majflt split page faults by whether I/O was needed. What the two counters measure, and why a major fault count is not a count of disk reads (man-pages 6.19).
Is a load average of 4.0 high? What Linux load average counts and what 1, 5 and 15 minutes mean
Linux load average isn't CPU usage. It's a decaying average of runnable (R) and uninterruptible (D) tasks. How the kernel computes it, how to read it against CPU count, and how PSI differs.
real, user and sys in time output: wall-clock time vs CPU time
What real, user and sys in time output count according to POSIX, why user + sys can exceed real, and how the shell's time differs from /usr/bin/time on Linux.
Linux free shows almost no free memory? Read available first
A small free column does not mean Linux is out of memory. How free derives buff/cache, available and used from /proc/meminfo, and why routinely dropping caches can hurt performance.
Why TIME-WAIT sockets pile up: TCP's 2×MSL, Linux's 60 seconds, and what tcp_fin_timeout doesn't change
Why the side that closes a TCP connection first sits in TIME-WAIT, RFC 9293's 2×MSL versus Linux's fixed 60 seconds, what tcp_fin_timeout actually controls, and tcp_tw_reuse's default.
What chmod 755 and 644 mean: permission digits, rwx, and x on directories
What chmod 755 means, based on POSIX: how octal digits map to rwx, which permission class applies, directory permissions, umask, and recursive chmod.
Deleted a file but the disk space didn't come back? unlink and open files
Deleting a large file with rm doesn't always free space in df. The POSIX rules on link counts and open files, why du and df disagree, and how to find the cause and get space back on Linux.
No posts match. Try another word.