SShortSingh.
Back to feed

Linux /proc/schedstat Exposes Per-Thread Scheduling Wait, But Metric Has a Flaw

0
·1 views

A developer analyzing Linux thread scheduling found that /proc/[pid]/task/[tid]/schedstat exposes per-thread runqueue wait time, allowing engineers to identify which threads are being denied CPU time on a running system. A bash script was built to delta two snapshots of this file and rank threads by either absolute wait-seconds or a wait-fraction metric calculated as wait divided by total runnable time. Testing revealed a counterintuitive problem: idle kernel threads like ksoftirqd scored a 94.7% wait fraction on a quiet machine, while genuinely starved whisper.cpp threads under heavy load scored only 65.7%. This means the fraction-based metric ranks idle threads as needier than truly starved ones, inverting the severity signal an operator would want. The article concludes that the denominator — a thread's own runnable time — is the root cause of the inversion, leaving the metric unreliable for alerting on real CPU starvation.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer builds CSS-only rotisserie animation with no SVG or images

A frontend developer created a pure CSS art piece depicting nine chickens rotating over a tandoor fire as part of DEV Community's Frontend Challenge: Comfort Food Edition. The entire scene — birds, flames, plated dish, and cabinet — is built using only divs, gradients, and shadows, with no SVG or image files. Rather than rotating the bird shapes, the developer simulates rotation by scrolling a repeating char-pattern gradient vertically inside a fixed silhouette, achieving a seamless loop. Significant effort went into making each chicken readable, with overlapping body parts and strategically darkened drumstick ankles creating a three-dimensional appearance without any 3D CSS. The piece also animates a bird being removed from the spit and served on a plate, complete with onion rings, mint chutney, and coriander.

0
ProgrammingDEV Community ·

Analyst Scans 1,416 Reddit Threads to Surface 8 Business Ideas Backed by Data

A developer who runs a database scanning entrepreneur subreddits for pain points reviewed 1,416 threads to identify viable business opportunities supported by real search volume and competitor weaknesses. Among the top findings was a payment reminder tool tailored for trade contractors, inspired by a Reddit post where a plumber reported $47,000 in unpaid invoices due to inconsistent follow-ups. Another idea involved a family digital vault for storing passwords and financial documents, designed to grant access to a trusted person upon death or inactivity, addressing gaps left by costly and unreliable existing services. Each idea was evaluated against three criteria: a sourced Reddit thread, monthly search volume with year-over-year growth, and a specific failure point of the current market leader. The analysis also flagged practical challenges for each concept, such as SMS compliance hurdles for the contractor reminder tool and encryption requirements for the digital vault.

0
ProgrammingDEV Community ·

How Login Authentication Works: From Browser Click to Server Verification

When a user clicks 'Login', the browser sends their credentials via an HTTP POST request to a backend API endpoint over HTTPS, keeping the data encrypted in transit. The backend first validates the input before querying the database to check whether an account with the provided email exists. Passwords are never stored in plain text; instead, databases hold hashed versions of passwords for security. The server then compares the submitted password against the stored hash to verify the user's identity. If verification succeeds, the backend issues a session or token, which the browser uses to maintain the logged-in state for subsequent requests.

0
ProgrammingDEV Community ·

AI Agents Can Spend Your Money Wrong — Your Card Type Decides Who Pays

AI agents embedded in browsers and apps can now make purchases on behalf of users, but existing consumer protection laws were not written with autonomous software in mind. In the US, debit transactions fall under Regulation E, which hinges on whether a transfer was 'authorized' — a question that remains legally unresolved when an AI acts outside a user's precise intent. Credit cards, governed by the Truth in Lending Act and Regulation Z, offer broader protections, including a dispute right for goods not accepted or not delivered as agreed, without requiring proof of fraud. As of mid-2026, regulators have not issued clear guidance on AI-driven transaction disputes, despite industry calls for clarity from groups like the Consumer Bankers Association. In most erroneous agent-purchase cases, financial liability ultimately falls on the merchant, making accurate transaction record-keeping increasingly important for sellers.

Linux /proc/schedstat Exposes Per-Thread Scheduling Wait, But Metric Has a Flaw · ShortSingh