From owner-freebsd-arch@FreeBSD.ORG Tue Feb 24 23:33:04 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D70C849C; Tue, 24 Feb 2015 23:33:04 +0000 (UTC) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) (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 52D39C63; Tue, 24 Feb 2015 23:33:04 +0000 (UTC) Received: by labgq15 with SMTP id gq15so285905lab.6; Tue, 24 Feb 2015 15:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=cdSCoiAAjGkc6eE4t4Cy5yDSqKv759juqdEIDmPJTF4=; b=E4yQI/W7+aZ0ImoFApg3YxMiQbZkQvcsrhDG6fb3cTg+BFDN5chjgkvD8HFrHRqKUc w5vPTi0mFCRcWJ4It5dXLiWvIDgXcgAgX+M3EU1UCWLhCdFIBwC5TJ9EM/BY7OqLvB4z BQ4BuVx05KaE3Z08mu9fwWE/uAbeJkMso8FZ8gDSLFj/Yu3XJGrsvnSgzP0eygUY0WDe eqdJDOojZCzmIi/RL1bx0ehXUGikaosj9XE0pq69rljdk9ANCpntVFH9GrS9Ha8C326e pChNlr4J3wKQ/y7uBFINrAsCxWsczBOr0t6dyKxFtTUTbauMWpyUD01SqWKDQjQUvrCs GDOw== MIME-Version: 1.0 X-Received: by 10.112.138.233 with SMTP id qt9mr349470lbb.44.1424820782457; Tue, 24 Feb 2015 15:33:02 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.25.77.74 with HTTP; Tue, 24 Feb 2015 15:33:02 -0800 (PST) In-Reply-To: <20150224231921.GQ46794@funkthat.com> References: <20150224012026.GY46794@funkthat.com> <20150224015721.GT74514@kib.kiev.ua> <54EBDC1C.3060007@astrodoggroup.com> <20150224024250.GV74514@kib.kiev.ua> <20150224174053.GG46794@funkthat.com> <54ECBD4B.6000007@freebsd.org> <20150224182507.GI46794@funkthat.com> <54ECEA43.2080008@freebsd.org> <20150224231921.GQ46794@funkthat.com> Date: Tue, 24 Feb 2015 15:33:02 -0800 X-Google-Sender-Auth: bQFMyivKMFMMULgjpQ2QZubnE4Q Message-ID: Subject: Re: locks and kernel randomness... From: "K. Macy" To: John-Mark Gurney Content-Type: text/plain; charset=UTF-8 Cc: Konstantin Belousov , Harrison Grundy , Alfred Perlstein , "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 23:33:04 -0000 > If someone does find a performance issue w/ my patch, I WILL work with > them on a solution, but I will not work w/ people who make unfounded > claims about the impact of this work... > ... The concerns may be exaggerated, but they aren't unfounded. Not quite the same thing, but no one wants to spend the cycles doing a SHA256 because it's "The Right Thing"(tm) when their use case only requires a fletcher2. If it doesn't already exist, it might also be worth looking in to a more scalable CSPRNG implementation not requiring locking in the common case. For example, each core is seeded separately periodically so that has a private pool that is protected by a critical section. The private pool would be regularly refreshed by cpu-local callout. Thus, a lock would only be acquired if the local entropy were depleted.