Why timestamp in vm_map commented as version number?

Hi,
I have been reading the kernel sources. The vm_map struct at the /usr/src/sys/vm/vm_map.h file, contained this line:
C:
struct vm_map {
    struct vm_map_entry header;    /* List of entries */
    struct sx lock;            /* Lock for map data */
    struct mtx system_mtx;
    int nentries;            /* Number of entries */
    vm_size_t size;            /* virtual size */
    u_int timestamp;        /* ==================> Version number <==================== */
    u_char needs_wakeup;
    u_char system_map;        /* (c) Am I a system map? */
    vm_flags_t flags;        /* flags for this vm_map */
    vm_map_entry_t root;        /* Root of a binary search tree */
    pmap_t pmap;            /* (c) Physical map */
    vm_offset_t anon_loc;
    int busy;
#ifdef DIAGNOSTIC
    int nupdates;
#endif
};
Why timestamp commented as version number?
 
That code is quite old too.
It would be interesting to look back at older BSD code to see what it had.
Did you run it down?

@(#)vm_map.h 8.9 (Berkeley) 5/17/95
*
*
* Copyright (c) 1987, 1990 Carnegie-Mellon University.
* All rights reserved.
*
* Authors: Avadis Tevanian, Jr., Michael Wayne Young
 
Could be easier way to check version numbers?

If you have major, minor and patch level version numbers it can get messy trying to work out if 1.19.44 is newer than something else.

And you avoid the development versus marketing argument if the changes need a patch level, minor version or major version level bump.

Whereas a time stamp will be a single incremental value - highest value is newer version and you can sort versions easily.
 
You need to understand/read the variable name in its context. It has nothing to do with the version of the file.
Check here: vm_map(9).
Code:
timestamp       Used to determine if the map has changed since its last ac-
                cess.
 
Back
Top