From owner-freebsd-current@freebsd.org Fri Feb 24 13:32:41 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F124BCEB23E for ; Fri, 24 Feb 2017 13:32:41 +0000 (UTC) (envelope-from jiashiun@gmail.com) Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::231]) (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 AC6131A00; Fri, 24 Feb 2017 13:32:41 +0000 (UTC) (envelope-from jiashiun@gmail.com) Received: by mail-qt0-x231.google.com with SMTP id b16so16583623qte.0; Fri, 24 Feb 2017 05:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zbbph7XkwADgqIXCTjpIrLufofi1WU8jMkVJkHZepEU=; b=OH0m1tSqRjPc+B90GMQu1MOP9xm+2ex9+lYF8pGDU0lS3zfzG2K7Yz4Zabvkewn7tf SufXHD1nNcdKcGd3lXKPIQ+7dZA6X7bythjBYHWMHsYlonkSIcOyDTGe6NdXB5x4aiSm iLRJipnee6VEcUJdCzBB5Ybuj0J0BiFFgZavX/sT84oITOsFgpLVew5R+XnC9awPijMz tZ9GBk7PipixPT6j7X4siolAElz6r6bTIs3izZTyiYGsWqGbiSoqfvdRK0a5ZsWVm+u2 lN6u1uufZRB3L/aCIoh08WTNpl3MU2nAD333ee3tZ7xD8FDe/r++FFmmnqkrcyRUMahx wn9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zbbph7XkwADgqIXCTjpIrLufofi1WU8jMkVJkHZepEU=; b=BsRXeUH/uv0SJLUT2W9MYzzOFieo7RLmnz/5bbbE0v21hFEmOhImoAG1hxJBnvQCMb KSsabphBbMNnwaNl1xbLU7jlMks0Vj7bO35hZmGlsFbUQcdmRUPTlRCr+6r353Rd/gH7 TPtE7WH4kDQu1yEE3byE7AjA2sdIz1XWdD8fkvbB9jMDnP+MUUUbMT1PBK7RcBluYRTx m5ZOtqudNbwHsaJLsvHW0OInj7UBl6j46HPlLc3yinZPDr1TWDdwjFpTHsA9OikWxeHt E7Vag4qH6QzUczakDSNp/uJyd5FoKMSOskyCBPg3JRVIOI5OuS5bpXx9d2rGvJJJKvyw Gxsg== X-Gm-Message-State: AMke39koR8oaLk5eJ/B0mBBIuEDy73JDOCjB5OxiegPKvkXO63zy9TGarPLzPjxpui+mPFnlOArH1ZBhWwUxsw== X-Received: by 10.200.38.3 with SMTP id u3mr2676376qtu.235.1487943160716; Fri, 24 Feb 2017 05:32:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.104.8 with HTTP; Fri, 24 Feb 2017 05:32:10 -0800 (PST) In-Reply-To: <20170224114541.GU2092@kib.kiev.ua> References: <20170113120534.GC2349@kib.kiev.ua> <20170223100829.GR2092@kib.kiev.ua> <2204246.QKzIRnxiUQ@ralph.baldwin.cx> <20170224114541.GU2092@kib.kiev.ua> From: Jia-Shiun Li Date: Fri, 24 Feb 2017 21:32:10 +0800 Message-ID: Subject: Re: TSC as timecounter makes system lag To: Konstantin Belousov Cc: John Baldwin , freebsd-current , Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 13:32:42 -0000 On Fri, Feb 24, 2017 at 7:45 PM, Konstantin Belousov wrote: > On Fri, Feb 24, 2017 at 12:15:26PM +0800, Jia-Shiun Li wrote: > > Tested working on E7400 against r313909. And changing timecounter from/to > > TSC > > correctly enables/disables C2. > > > > The latter part cpu_disable_c2_sleep++ is not needed. When > > init_TSC_tc() got called timecounter is not yet tsc_timecounter. > > inittimecounter() later will do the work calling tc_windup(). > > > > You mean, just this > - if (cpu_deepest_sleep >= 2 && cpu_vendor_id == CPU_VENDOR_INTEL && > + if (cpu_vendor_id == CPU_VENDOR_INTEL && > is enough to fix the issue ? If yes, we can remove the cpu_deepest_sleep > variable. This is John' observation, I think he would prefer to prepare > the patch. > Correct. That's enough. -Jia-Shiun.