SShortSingh.
Back to feed

How Page Tables Translate Virtual to Physical Memory Addresses

0
·5 views

Programs use virtual addresses, and the CPU converts each one to a physical address using page tables, which are data structures in memory written by the kernel and read by hardware. On x86-64, a 4096-byte page offset passes through unchanged while the remaining bits index a four-level tree of 512-entry tables, each exactly one page in size. This tree structure avoids wasting memory on empty regions of the address space, since unmapped areas need no lower-level tables. To avoid the cost of up to four memory reads per access, the CPU caches recent translations in the TLB, which the kernel must invalidate when mappings change. Each entry also carries permission and presence bits that the CPU checks on every access, raising a page fault when a check fails.

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 ·

Rejecting Stale In-Memory Updates with a Revision Check Inside a Lock

The article explains that locking only the final assignment still lets a stale editor overwrite newer work, so the acceptance check must run together with the write. It presents a Python example where a cell stores an integer revision alongside an immutable string payload. A replacement must supply the revision it read, and under a single lock the cell either rejects a mismatched update or assigns the value and increments the revision. The author notes that the revision rule is application-level policy layered on top of primitive locking, and that all access must go through the cell's interface. Unit tests cover stale writes, identical payloads, reverting to an old value, concurrent contenders, and invalid inputs, and the author reports five test methods passing locally.

0
ProgrammingDEV Community ·

Trader holds cash all day as Bitcoin slides below $68,000 after US inflation data

On Friday, November 13, 2026, a trader made no trades and kept the experiment's funds in USDT while Bitcoin fell below $70,000 and reached about $67,568. Roughly $1.64 billion in liquidations occurred and the fear and greed index read 20, signaling extreme fear. A failed rebound followed a US producer price inflation release at 10:30, and Bitcoin later dropped further from a sideways range near $68,400–$69,100 to around $68,190 by evening. The trader had written predetermined buy triggers in advance, none of which were met, and the account ended near $15.94 versus about $17.05 at the start. The author stresses that an 'oversold' reading describes past moves rather than predicting a recovery.

0
ProgrammingDEV Community ·

Transactional email evidence gaps can hide behind accepted API requests

A DEV Community article argues that marketplaces should choose transactional email services based on the evidence they can retain after a payment settles. It says an accepted API submission is only a checkpoint and does not prove a buyer received a receipt. The author recommends tracking which settled orders lack receipt evidence, how old those gaps are, and where in the workflow progress stopped. The piece suggests separating missing submission evidence from missing delivery evidence, since each requires different owners and access. Its alert thresholds are presented as illustrative starting points rather than vendor performance guarantees.

0
ProgrammingDEV Community ·

Muffle: An Offline Android Geofencing Design That Preserves Battery Life

A developer built an automatic sound manager after being embarrassed by a phone ringing during a quiet prayer session. Existing apps often relied on constant cloud syncing, data collection, or unreliable cellular connections to track location. The developer chose Google Play Services' GeofencingClient, which lets the operating system monitor geographic boundaries and wake the app only on entry or exit events. To survive device reboots, which can clear registered geofences, the design stores routines in a local Room database and re-registers them on BOOT_COMPLETED. The approach proved far more battery-efficient than the initial method of polling location every minute from a foreground service.