From owner-freebsd-arch@FreeBSD.ORG Tue Feb 24 18:03:52 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB799754 for ; Tue, 24 Feb 2015 18:03:52 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A537EBB for ; Tue, 24 Feb 2015 18:03:52 +0000 (UTC) Received: by pablf10 with SMTP id lf10so37703327pab.12 for ; Tue, 24 Feb 2015 10:03:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=ZxHyHyJdYRPvWo4m/bEcshGVwA7uobtfE+IsOzyoWbk=; b=bPN2+QpA2QBmft7N+gO32bML70pdN9Z6RSbMfkpSxJUREpg2g6BZrh12tqpVZsK5RJ b4DKZa8ToXO4o6Zk7/7dvmLgBryUruLMC5mqa/4hED4yUk5kpUPXr76PCCS2S+LXAFeb nQiuGLvwxEkftdVcYfyht+ZFgT/2CDH5LO+zK9TnupGhJ2PifW4h8AKpsxxpcFg56SIM JDsjNeBKus3jUkOUxxZYLez90NvXj6BlnC9dWeBopQtF4NF4EwwWfEVrqaKPNFPlnajE SINHmYse2N05rVW5NCCRRQhK81n4duNeoTacPnaKD+HjFiiBVXRkNC3N/uvWI3lBAfWu VGeQ== X-Gm-Message-State: ALoCoQmtJ2iTFrzRf/2Smk+8FIVRc8ap37aYHFjDgRX1Y0aUCQSdbHrNA2EN4Dhg5hQqi0JmnDpA X-Received: by 10.66.165.105 with SMTP id yx9mr30423678pab.145.1424801025921; Tue, 24 Feb 2015 10:03:45 -0800 (PST) Received: from macintosh-3c0754232d17.corp.netflix.com ([69.53.236.236]) by mx.google.com with ESMTPSA id rr9sm38801902pbc.39.2015.02.24.10.03.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Feb 2015 10:03:45 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: locks and kernel randomness... From: Warner Losh In-Reply-To: <20150224174053.GG46794@funkthat.com> Date: Tue, 24 Feb 2015 11:03:42 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1E4A5E62-6E06-48BA-B5C5-9BD05811CDEF@bsdimp.com> References: <20150224012026.GY46794@funkthat.com> <20150224015721.GT74514@kib.kiev.ua> <54EBDC1C.3060007@astrodoggroup.com> <20150224024250.GV74514@kib.kiev.ua> <20150224174053.GG46794@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2070.6) Cc: Konstantin Belousov , Harrison Grundy , freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2015 18:03:52 -0000 > On Feb 24, 2015, at 10:40 AM, John-Mark Gurney = wrote: >=20 > Warner Losh wrote this message on Tue, Feb 24, 2015 at 07:56 -0700: >> Then again, if you want to change random(), provide a weak_random() = that???s >> the traditional non-crypto thing that???s fast and lockless. That = would make it easy >> to audit in our tree. The scheduler doesn???t need cryptographic = randomness, it >> just needs to make different choices sometimes to ensure its notion = of fairness. >=20 > I do not support having a weak_random... If the consumer is sure > enough that you don't need a secure random, then they can pick an LCG > and implement it themselves and deal (or not) w/ the locking issues... >=20 > It appears that the scheduler had an LCG but for some reason the = authors > didn't feel like using it here.. Why don=E2=80=99t you support having a common random routine that=E2=80=99= s to mix the pot, but not cryptographically secure? Lots of algorithms use them, and = having a common one would keep us from reinventing the wheel. Warner