From owner-freebsd-hackers@freebsd.org Mon Aug 20 17:43:42 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D25F107699E for ; Mon, 20 Aug 2018 17:43:42 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E65B7903C for ; Mon, 20 Aug 2018 17:43:41 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm0-x244.google.com with SMTP id s9-v6so333263wmh.3 for ; Mon, 20 Aug 2018 10:43:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mbuh5ng3DBhsFcupkjJ5g67gcEoQHuoIW9Tfy6ug6zM=; b=XX5PgfOihZwerq2N4lTqwGUP6wLGka4o37xn7gWNunsjOrF9YchrsWN1gKQxLFw8wJ qkKXYEtKhH1VCx6OmQLHOfVjPZlzMz97PWKsBn74GS+IhdsR5jemyHmhr4yIpcRkvK1N SGqKcnU8XgQxdL64KlQlj1aQnLzn/01UWmllzED3wWza3nLDeyNZoQayxe62xKHnv2iU l3f51pqEtV9aHU+VJFvMw2wP1xodd89YafdD2rT5fguHvpo7aVmve5ePWSQcTkR/DQK7 SUmD+9yKEEDmXaGpu21dr+MfyShY6HkwUrs+6sjW16IXZtKcrP4l6cDJfxFPc/yx3SMd lExQ== X-Gm-Message-State: AOUpUlG4zq1xtJ7EYJkFe1jbMTRZeNz2gk5RTJO92QC3f78u3JmQxLBY jU4TG4Cojk11Zmcs8S+vOTYZ3wgG0Xk= X-Google-Smtp-Source: AA+uWPwH2rGtdKxpwnb/5/w2VH2hTT5END7gD1+Z3Rzp1leNllFy/4V9E6A/llxJobbBkKx/TNxzPg== X-Received: by 2002:a1c:1609:: with SMTP id 9-v6mr9036204wmw.12.1534787020798; Mon, 20 Aug 2018 10:43:40 -0700 (PDT) Received: from gumby.homeunix.com ([90.210.182.138]) by smtp.gmail.com with ESMTPSA id q135-v6sm359655wmd.4.2018.08.20.10.43.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Aug 2018 10:43:40 -0700 (PDT) Date: Mon, 20 Aug 2018 18:43:37 +0100 From: RW To: freebsd-hackers@freebsd.org Subject: Re: rand_harvestq high cpu usage when /dev/urandom is used Message-ID: <20180820184337.6e07e951@gumby.homeunix.com> In-Reply-To: References: X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; amd64-portbld-freebsd11.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 17:43:42 -0000 On Mon, 20 Aug 2018 13:27:33 +0200 Ali Abdallah wrote: > Hello, > > I was just sorting randomly some jpg image files using: > > ls *.jpg | sort -R --random-source=/dev/urandom urandom is a sim-link to random, so --random-source=/dev/urandom does nothing useful > The above command never exited. Later I noticed that > one of my CPU is always running 100%. top -S reveals that it is > rand_harvestq kernel service. > > Is this is a bug? This occurs on 12-ALPHA1 and 11.2 It's a bit excessive > Also, I read on > https://lists.freebsd.org/pipermail/freebsd-current/2013-November/046683.html > someone saying that sysctls to turn off harvesting is documented in > random(6) > . > I had a look at that document, but wasn't clear to me how to turn it > off. I tried to play with the mask, > but nothing. what happens if you set the mask to zero?