From owner-cvs-src-old@FreeBSD.ORG Thu Oct 30 14:06:02 2008 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 244791065674 for ; Thu, 30 Oct 2008 14:06:02 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 116F38FC18 for ; Thu, 30 Oct 2008 14:06:02 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9UE61IX043605 for ; Thu, 30 Oct 2008 14:06:01 GMT (envelope-from ivoras@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9UE61VQ043604 for cvs-src-old@freebsd.org; Thu, 30 Oct 2008 14:06:01 GMT (envelope-from ivoras@repoman.freebsd.org) Message-Id: <200810301406.m9UE61VQ043604@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ivoras@repoman.freebsd.org using -f From: Ivan Voras Date: Thu, 30 Oct 2008 14:05:57 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/cat cat.c src/bin/cp utils.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2008 14:06:02 -0000 ivoras 2008-10-30 14:05:57 UTC FreeBSD src repository Modified files: bin/cat cat.c bin/cp utils.c Log: SVN rev 184471 on 2008-10-30 14:05:57Z by ivoras Teach cat(1) and cp(1) to use a larger buffer if enough memory is present in the system. A simple heuristics is used to detect what is "enough" memory: if number of physmem pages is greater than 32k (equalling 128 MB on machines with 4 kB pages). Typical immediate result of these changes is reduction in context switches and the goal is to increase efficiency by using large buffers: before: /usr/bin/time -hlp cat file1 > file2 ... 163 voluntary context switches 11194 involuntary context switches after: /usr/bin/time -hlp ./cat file1 > file2 ... 417 voluntary context switches 272 involuntary context switches Reviewed by: hackers@ (no objections to earlier version of cat patch) Approved by: gnn (mentor) MFC after: 4 months Revision Changes Path 1.33 +21 -2 src/bin/cat/cat.c 1.57 +29 -2 src/bin/cp/utils.c