From owner-svn-src-all@freebsd.org Wed Feb 10 09:40:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC29AA48BB; Wed, 10 Feb 2016 09:40:46 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 703691CA4; Wed, 10 Feb 2016 09:40:46 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A9ej5s086176; Wed, 10 Feb 2016 09:40:45 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A9ejb6086175; Wed, 10 Feb 2016 09:40:45 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602100940.u1A9ejb6086175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Wed, 10 Feb 2016 09:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295465 - head/usr.sbin/services_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 09:40:46 -0000 Author: se Date: Wed Feb 10 09:40:45 2016 New Revision: 295465 URL: https://svnweb.freebsd.org/changeset/base/295465 Log: Remove O_SYNC from the options passed to dbmopen(). The services db is created as a temporary file that is moved over the existing file after completion. Thus there is no need to immediately flush all created db records to the temporary file. This speeds up creation of the services db by a factor of 500 on my ZFS based /var/db filesytem (from 110 seconds to 0.235 seconds). MFC after: 1 week Modified: head/usr.sbin/services_mkdb/services_mkdb.c Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Wed Feb 10 09:19:29 2016 (r295464) +++ head/usr.sbin/services_mkdb/services_mkdb.c Wed Feb 10 09:40:45 2016 (r295465) @@ -141,7 +141,7 @@ main(int argc, char *argv[]) err(1, "Cannot install exit handler"); (void)snprintf(tname, sizeof(tname), "%s.tmp", dbname); - db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL | O_SYNC, + db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL, (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), DB_HASH, &hinfo); if (!db) err(1, "Error opening temporary database `%s'", tname);