Understanding the basic shape of Unix virtual memory management

Although their implementations vary in detail, every modern Unix system(ie, everyone with mmap() ) has some basic constraints that shape thegeneral outline of their virtual memory system. While I'm talking about virtual memory statistics , it's worth running downthis basic shape and what creates it.

(I say this partly because I spend part of writing yesterday's entry sorting bits of this out in my own head.)

The fundamental mmap() operation is to glue some resource (such as a


What do we mean when we talk about something's memory usage?

Robert Haas writes :

It should be possible for a reasonably intelligent human being (inwhich category I place myself) to answer simple questions about systemmemory usage, such as "How much memory is my database using?" or "Howmuch memory is my web server using?" relatively simply.

One of the problems is that the question being asked here is notwell defined. There are several things that this question couldmean (talking only about a single process in order to simplifylife):

  1. how much virtual

Notes on what Linux's /proc/<pid>/smaps fields mean

Because I was just digging around in the kernel source to determinethis (it's a long story), here is some notes about what the fieldsof the smaps file mean and how they're calculated. The factoryfor this particular sausage is fs/proc/task_mmu.c (at leastas of the current git tree).

For each VMA mapping that gets listed in smaps , the kernel walks allof the PTEs associated with it and looks at all of the known pages. EachPTE


How to use systemd to just run some stuff on boot

Suppose that you have some things that you want to get run whenyour system boots, much like rc.local . Theyaren't necessarily daemons, you don't want to wire them up tothe whole systemd magic infrastructure, you just want to runsomething. Let us assume that you have some shell scripts forsimplicity (if you don't, it's easy to convert what you needinto one or more shell scripts).

When I was converting my old init.d stuff to systemd


A Yum plugin I would like: using a local DVD as a repo source

It's become obvious to me that, to put it one way, Fedora 16 iswhere all of the update action is and Fedora 15 is not getting manychanged packages (this is probably well known among people whoactually pay attention to how Fedora is structured). This meansthat I really need to upgrade my home machine from Fedora 15 toFedora 16. Because I'm sane I'll be doing this with a yum upgrade , which means that I needto get several gigabytes


An insight on the purpose of comments: volume control

Comments are an enduringly popular thing in social networking (even,it turns out, in some forms of social networking that don't seem tohave them on first appearance). Ostensibly one reason for this is thepower of feedback , but that's not a complete answer; assome people have noted you can have feedbackwithout comments as such, especially if you're doing it within a closedsystem.

I've recently had a realization about a core reason why comments aregood within a closed social


What my physical desk is like

A while back I read The shrinking desk ,where the author winds up asking other sysadmins how messy theirdesks are. As it happens, I have a slightly unusual reaction tothat: depending on how you define it, either not at all messy orvery messy.

You see, I don't use a desk; I never have. Right from the beginning ofmy sysadmin career, I've preferred to put my monitor, keyboard, andmouse on a plain table. As far as I'm


The latest annoyance with Google Groups

The Google Groups spam attempts continues to rollin. This recently led me to yet another unpleasant discovery aboutGoogle Groups: as far as I can tell, there is no way to unsubscribefrom a Google Groups mailing list (at least through the website). Atleast there's no way from the outside; it might be possible if you madea Google Groups account for yourself under the email address that isbeing spammed. For all of the obvious reasons I have no interest indoing that.

At this point


Why you might want multiple keys for disk encryption

For a moment let's go back to the commentator's suggestion forrecovering from key loss from my first entry on full disk encryption :

Many systems support multiple keys (e.g. dm-crypt). Just keep onesealed in a safe.

One question you might ask here is why you need (or want to use) asecond key for this backup purpose. After all, you can put a copyof your single key in the safe, and it works just as well to decryptthe


Nailing down RPM epoch numbers

As I mentioned here , RPM packageversion numbers have three components: an 'epoch' number, the package'supstream version, and an RPM package release version. The epoch numberis there because upstream developers sometimes change version numbers inways that break RPM's normal version comparison algorithm, or just plainuse odd version formats.

(For example, I believe there's at least one program that increments itsversion by adding another digit of π to the end of the versionnumber. This makes perfect sense