From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 5 09:45:33 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2357716A419 for ; Wed, 5 Sep 2007 09:45:33 +0000 (UTC) (envelope-from zyf.zeroos@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by mx1.freebsd.org (Postfix) with ESMTP id DC81F13C442 for ; Wed, 5 Sep 2007 09:45:32 +0000 (UTC) (envelope-from zyf.zeroos@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so2588882waf for ; Wed, 05 Sep 2007 02:45:18 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=CaisN8J9tjEOwGN1Vost7GacvN+uhl1jzVdBeB0rzHwHZkfU0KQi6JVlygyOe1zHvvgJ6FzwEjhLesH7cXIJd6QXjDBE4amzfeIJYiH1kqZndSvPWwlZzl2p8gA4cAHBYJQ3obi7YhvMY5Kj8qvWxi78+R1706fgYrs4y2Y7FGo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=fWoTyJyUSOgxaH+HZTady/1DDlM3oXIb4nRxpKrkteSjCSAM8PCj3+YO20wLDxsZrRKPVFGFdq4+wnQfCtDE9s5vtlek9PdvoElootjvnK5n/GcI90yiQAYVcV0khjIS7ZB8TxtRYG6COUIh/mHj03lciAmMcHIhQA+ITWDpZuE= Received: by 10.114.80.4 with SMTP id d4mr184353wab.1188983863804; Wed, 05 Sep 2007 02:17:43 -0700 (PDT) Received: by 10.114.61.11 with HTTP; Wed, 5 Sep 2007 02:17:43 -0700 (PDT) Message-ID: <4df04b840709050217j5d90edcas4d74f5eacccde57a@mail.gmail.com> Date: Wed, 5 Sep 2007 17:17:43 +0800 From: "yunfeng zhang" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: VM swap subsystem improvement on FreeBSD core code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2007 09:45:33 -0000 Dear core developers: I'm glad to show the ideas I got to you all in http://www.ussg.iu.edu/hypermail/linux/kernel/0708.2/2563.html -- the patch I done for Linux core. I think the key ideas in it is also enhancing FreeBSD vm system. The article includes three main ideas. 1) dftlb. 2) PrivatePage should be privatelized totally. 3) Swap nail arithmetic. Here is a brief description about the 1st idea. dftlb is designed for enhancing the performance of unmapping physical pages from their page tables on SMP. It can flush TLBs batchly without EVEN pausing other CPUs. The job is done by collecting all unmapping tasks mainly done by pageout deamon for page-reclamation purpose into a static core object struct { int start_addr; int end_addr; } dftlb_tasks[32]; when the object is full, send IPI to other CPUs to flush it by flush_tlb_range then continue to fill it. Contrast to current FreeBSD unmapping process, the efficience is at least 100+ times. dftlb is based on the conditions listed below 1) atomic cmpxchg instruction. 2) atomically set the access bit after CPU touches a pte firstly. Fortunately, the method can be implemented without shaking the infrastructure of FreeBSD vm at all. The idea can be done by a new core daemon -- kppsd in my patch totally. By the way, read the document I done at the head of the patch firstly by vim7.0.