Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp200817ybv; Sat, 22 Feb 2020 02:08:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzbuEyHZ6oTBlBXQ6+w+kBv8Y7wUPQGWcM1aS6pfB5tGgOhRY+jKvMuzVEU/mLZeLeu0y7O X-Received: by 2002:a9d:7386:: with SMTP id j6mr31459150otk.336.1582366095162; Sat, 22 Feb 2020 02:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582366095; cv=none; d=google.com; s=arc-20160816; b=OIyV9v2MxCV5uU5NC5ONXEvgzIitNS+ywY65SPkzyHG5tky8czrFAkZdgS2zsWI5pc 3cRVzjkCuHx1dfdxcCPIXKf1rQ0qCoZFRCY92SISr+HRDy3xe1L/Z7CO0n/AMmZUVrHH cmSwr40qnxUzw9zYNID1262mYDiA1aWlOVw1KGajO2Lgopa3jhAGbu+ncEFnQCg44hqJ SS2QoUZbsBarqkMZPkc/IHSKtM1dWcxqbupYoP1dBJpRRNf2d+1UcSyVtJsKSDzzZxZa oSWTXc5DyzzV+Y7dMabBIK4UXDxCZXoNadYUDlrhO2WnVNe4GFrjM7p8J11MIxsTK4jJ abQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=pBh+GInvKe0LoG38qjQKQN6ywYpL/zBlCDCEMHv42HU=; b=LORlHEdhDbvHAfIa8grYqHuQFv/fQdeaLlcGeY9gLeSceKQNIq2FEjmrHsGTfHWByA b4AwsXJxKUWsAJ0Si/RK/+n3lqIceeKsHb+pjWKb/efrdz0R7OhenFKi/xLhxc7OA2vO 3PtCed3RB/Ye7GpZS4TgC/jp2noYGk75LpAnSv0gR2TvukMKsHEyvMVO/Z20TbmI4iGv WOwRQUkA6D41EpAMEKTMMkOMZzHIxMhOsVHHivvs6EDyEIFvQfQAoXtq0hO5LyQ+kzGj 01la33HfWZmhemk7cJcbKZmkZiqrFrfaaiHcGD1IDQJyoBTHY1g7v6UggmEkS6wpa8nP pw7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=H2ffTmBO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18si2839268otk.80.2020.02.22.02.07.46; Sat, 22 Feb 2020 02:08:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=H2ffTmBO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbgBVKAB (ORCPT + 99 others); Sat, 22 Feb 2020 05:00:01 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:54367 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726726AbgBVKAA (ORCPT ); Sat, 22 Feb 2020 05:00:00 -0500 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id fd300658 for ; Sat, 22 Feb 2020 09:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :in-reply-to:references:from:date:message-id:subject:to:cc :content-type; s=mail; bh=ZHg3DU0tDACYDvwC5oieXse+7Sg=; b=H2ffTm BO5FuwBEUNcrEICHxiuJUVnG5fuD8vhGCBP9rkHPDZSoL9K5Pj7Oq2g2d4uZ2gyw VpoRg0xSGQZzqCUrzgWkQiocatlw1GydbT5dM4QsXaJ8pJLeNZJRWLXLHptsYnQk cvvm/x9DrNuCKUWST1jyYTmZZ5ZW7M7Ir9B3Rm8Ln15fSaWn8fUN75sbotuHpKV9 cdo1bkDI7FTYWq6B/5Z/vD8XhlmoAPEDHW/FYzQUVPrVzfon8yFucq8nbprLC2Hk 7foKBkOBm14nziPQp04zrSnmrrGx432fA2ikaqG2p/lDMBFje/pzPFwcAumjFq16 LV0odL2FnuERxisg== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id f1f4c9d4 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Sat, 22 Feb 2020 09:56:52 +0000 (UTC) Received: by mail-oi1-f170.google.com with SMTP id q81so4280541oig.0 for ; Sat, 22 Feb 2020 01:59:59 -0800 (PST) X-Gm-Message-State: APjAAAVfJ+HPZw0xdo+9ES79jBo4bzJtQFG0y0lfkTkNlUcvLoTWHkVi xDc7Lhfvg/3/HJE8HyxD7Dsb3BOzxZ13kBGUrUc= X-Received: by 2002:aca:815:: with SMTP id 21mr5714644oii.52.1582365598426; Sat, 22 Feb 2020 01:59:58 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a4a:dd10:0:0:0:0:0 with HTTP; Sat, 22 Feb 2020 01:59:57 -0800 (PST) In-Reply-To: <20200222004133.GC873427@mit.edu> References: <20200216161836.1976-1-Jason@zx2c4.com> <20200216182319.GA54139@kroah.com> <20200222004133.GC873427@mit.edu> From: "Jason A. Donenfeld" Date: Sat, 22 Feb 2020 10:59:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] random: always use batched entropy for get_random_u{32,64} To: "Theodore Y. Ts'o" Cc: Tony Luck , Greg Kroah-Hartman , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ted, On 2/22/20, Theodore Y. Ts'o wrote: > No, we can't; take a look at invalidate_batched_entropy(), where we > need invalidate all of per-cpu batched entropy from a single CPU after > we have initialized the the CRNG. > > Since most of the time after CRNG initialization, the spinlock for > each CPU will be on that CPU's cacheline, the time to take and release > the spinlock is not going to be material. Ah, you're right. I hadn't looked in detail before, hence mentioning "probably" and deferring to a new patch. Thanks for looking into it. Regarding this patch here, can you apply the v2 that I posted to your random.git tree? Thanks, Jason