From owner-svn-src-head@FreeBSD.ORG Thu Aug 11 21:01:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F406106564A; Thu, 11 Aug 2011 21:01:25 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D0D128FC08; Thu, 11 Aug 2011 21:01:24 +0000 (UTC) Received: by ewy1 with SMTP id 1so1408719ewy.13 for ; Thu, 11 Aug 2011 14:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=6xZoOTu4EEKWHmwmk0mr3hdXN3SAFiNYov7SELzsKy0=; b=dXo1HU+IBkpaKBLDcuWJsDUZ7ka0YMUull3jpnrhlg1S4VozKiNzmagh1TsLeJEs3y B5/+Hga8dOb1qsjIR3FQyVtNuwgHUv4ZuAPNvKsqvOAb1KLyJnE8iOYbMvQacly+L7yS up1a+Q2YpAiWjkC5PFGrGbCdIv0Qsmij5VPS8= MIME-Version: 1.0 Received: by 10.213.16.77 with SMTP id n13mr310167eba.135.1313096483583; Thu, 11 Aug 2011 14:01:23 -0700 (PDT) Received: by 10.213.2.148 with HTTP; Thu, 11 Aug 2011 14:01:23 -0700 (PDT) In-Reply-To: <201106080812.p588CFjb021267@svn.freebsd.org> References: <201106080812.p588CFjb021267@svn.freebsd.org> Date: Thu, 11 Aug 2011 17:01:23 -0400 Message-ID: From: Ryan Stone To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222853 - in head: . sys/amd64/amd64 sys/amd64/include sys/i386/i386 sys/i386/include sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 21:01:26 -0000 On Wed, Jun 8, 2011 at 4:12 AM, Andriy Gapon wrote: > Author: avg > Date: Wed Jun =A08 08:12:15 2011 > New Revision: 222853 > URL: http://svn.freebsd.org/changeset/base/222853 > > Log: > =A0remove code for dynamic offlining/onlining of CPUs on x86 > > =A0The code has definitely been broken for SCHED_ULE, which is a default > =A0scheduler. =A0It may have been broken for SCHED_4BSD in more subtle wa= ys, > =A0e.g. with manually configured CPU affinities and for interrupt deviler= y > =A0purposes. I can confirm that this was very broken for SCHED_4BSD. The softclock threads are kicked off from hardclock_cpu(). When you offline a CPU, hardclock_cpu() never runs for that CPU so its softclock thread is never run. If you happen to have any callouts scheduled on that softclock thread they will never run unless the corresponding CPU is brought online again. In a particular case that I've been looking at, the hyperthreading_allowed tunable was set to 0 on a system running a derivative of 8.2-RELEASE. Unfortunately it seems that there is a window in SCHED_4BSD during which the hyperthreads run even if you disable them via tunable. It seems that bufdaemon ran on one of the hyperthreads and then went to sleep. It's thread's td_slpcallout was scheduled on the hyperthread's softclock thread, and then 4BSD finally got around to disabling the hyperthreads. Hilarity ensues as bufdaemon never wakes up. In short, there's currently no safe way to disable hyperthreading on stable/8. I know that you and Attilio originally decided not to MFC this as these sysctls were considered a part of the ABI, but seeing as the functionality that this ABI is intended to present is completely broken, I'm wondering if an MFC is the lesser evil.