From owner-freebsd-current@FreeBSD.ORG Wed Sep 17 09:32:44 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31EEC1065671; Wed, 17 Sep 2008 09:32:44 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 8120A8FC12; Wed, 17 Sep 2008 09:32:43 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id m8H9WgOQ059693; Wed, 17 Sep 2008 13:32:42 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1221643962; bh=4qbgQhLJlu1S50p5NdA1I9La3Gy0lo1ZHqzGlKL V5Us=; l=1312; h=Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=kYMTuRNbj0p+MYsgfNtOa5l44 ib+9WR4YM4Wrh2v4eNoLwLRRtoPas43xenVwxzzomQuwBgwBq2CME+E7RA6qaiq7YFN Tf0ZqAbr9JGjEwFb+oHESmV4TwTy8ynPRCTvJGEE29Lz2n9MFLtXv+dWGZufGheVaPu DTtogZvR2Gdk= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id m8H9Wgkb059691; Wed, 17 Sep 2008 13:32:42 +0400 (MSD) (envelope-from ache) Date: Wed, 17 Sep 2008 13:32:40 +0400 From: Andrey Chernov To: Poul-Henning Kamp Message-ID: <20080917093238.GA59500@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Poul-Henning Kamp , Daniel Eischen , Max Laier , freebsd-current@freebsd.org References: <20080917090101.GC57480@nagual.pp.ru> <89740.1221643441@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89740.1221643441@critter.freebsd.dk> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Daniel Eischen , Max Laier , freebsd-current@freebsd.org Subject: Re: Is fork() hook ever possible? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 09:32:44 -0000 On Wed, Sep 17, 2008 at 09:24:01AM +0000, Poul-Henning Kamp wrote: > >The performance issue happens when application tries to call arc4random() > >in the loop. > > That is not what we are talking about, we are talking about the calls > in mktemp and similar. There are two things needed to be separated. mktemp etc. calls are the reason for the check. The check (in its current form) is the reason for slowing down in the loops because syscall overhead. > >We can control our own arc4random() internal calls inside our own libs in > >such way but can't control 3rd party libs or programs arc4random() calls > >(consider ports). > > We are not obliged to control these calls. If their authors do something > stupid, it's not our problem. The problem is that we are not authors of that API but currently OpenBSD are. We just integrate their API. Perhaps their API is stupid in this point (so they resolve it by non-efficient way), but people will try to follow their API because they are the authors, not ours. > Just have the FreeBSD library calls, call the wrapper function that > does a pid check and be done with it. I understand your idea and it was first idea that comes to me too, but since API is not ours, it does not work that way. -- http://ache.pp.ru/