From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754836AbcEQLGe (ORCPT ); Tue, 17 May 2016 07:06:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50636 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbcEQLGc (ORCPT ); Tue, 17 May 2016 07:06:32 -0400 Subject: Re: Please review arch/x86/kernel/pvclock.c to fix Docker/Mono crashes in new Kernels To: Linus Torvalds , Andy Lutomirski References: Cc: okhalzov@team.vestbery.com, Marcelo Tosatti , the arch/x86 maintainers , Linux Kernel Mailing List , Taloth Saldono From: Paolo Bonzini Message-ID: <573AFB2C.5040203@redhat.com> Date: Tue, 17 May 2016 13:06:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 17 May 2016 11:06:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/05/2016 20:56, Linus Torvalds wrote: > On Mon, May 16, 2016 at 11:37 AM, Andy Lutomirski wrote: >> >> All of those fixes were intended to fix incorrect times being >> reported, not segfaults. Weird. > > I'm assuming it's "time going backwards". I can easily see that > causing segfaults. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1450584 says the crashes occurs "more frequently on a vbox vm with multiple CPUs configured". If vbox tells the VM to use the vdso when it shouldn't (because the TSC is not stable on the host), bad things could happen. However, based on the Xamarin bug comments and http://lists.ximian.com/pipermail/mono-devel-list/2015-August/043181.html, it looks like vbox after all doesn't use pvclock and the trigger seems to be https://github.com/torvalds/linux/commit/c70e1b475f37: With __always_inline on vread_pvclock, mono crashed. With noinline on vread_pvclock, mono doesn't crash. Weirdest part is that the pvclock isn't even used during my tests. Oleg, what is your environment exactly? You mentioned Docker, but are you also virtualizing and if so what is your hypervisor? Taloth, do you know if it can it be reproduced under Xen or KVM or bare-metal? I'd trust them more than VirtualBox regarding timekeeping. I saw Amazon Linux mentioned in the mono mailing list archives which would point to Xen. Xen doesn't use the pvclock vdso code either, though. Thanks, Paolo