From owner-freebsd-hackers@freebsd.org Thu Jan 24 17:34:34 2019 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 9469C14B6E19 for ; Thu, 24 Jan 2019 17:34:34 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from mail.rlwinm.de (mail.rlwinm.de [IPv6:2a01:4f8:171:f902::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6D9274ACE for ; Thu, 24 Jan 2019 17:34:33 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from crest.bultmann.eu (unknown [IPv6:2a00:c380:c0d5:1:1db3:cc65:1157:29d8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rlwinm.de (Postfix) with ESMTPSA id 1CEA449E2 for ; Thu, 24 Jan 2019 17:34:21 +0000 (UTC) Subject: Re: Scheduled ideas: Two threads with one "stone" To: freebsd-hackers@freebsd.org References: From: Jan Bramkamp Message-ID: <1ce4898f-942b-d5ec-7563-fdceb56f4e88@rlwinm.de> Date: Thu, 24 Jan 2019 18:34:21 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A6D9274ACE X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of crest@rlwinm.de designates 2a01:4f8:171:f902::5 as permitted sender) smtp.mailfrom=crest@rlwinm.de X-Spamd-Result: default: False [-3.79 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DMARC_NA(0.00)[rlwinm.de]; MX_GOOD(-0.01)[mail.rlwinm.de]; NEURAL_HAM_SHORT(-0.52)[-0.515,0]; IP_SCORE(-0.97)[ipnet: 2a01:4f8::/29(-2.49), asn: 24940(-2.33), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 17:34:34 -0000 On 24.01.19 17:32, Zaphod Beeblebrox wrote: > W.R.T. hyperthreading, it's come to my attention that FreeBSD has had some > recommendations for awhile --- namely hyperthreading is bad for secure > systems. That-is-to-say this is not about recent vulnerabilities of recent > Intel flavoured CPUs, but rather some thoughts on a different solution to a > different problem. > > I was building world on my laptop when I noticed how sucky it had become. > Now... I well know this is due to the fact that even a "nice -19 make -j32 > buildworld" will slow the normal priority userland down by about 1/2 > because the thread that is "me" on the CPU is competing with one of the > threads that is saturating the CPU. My normal priority thread will get > scheduled, but it competes equally for resources with threads at much lower > priority. You can use `idprio 10 ...` to minimize the impact of CPU bound tasks. If you want to go even further you could apply hierarchical resource limits on the make process. The idprio chainloader puts make and all its descendants into the idle scheduling class which allows normal time sharing threads to preempt them.