Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1036772imu; Fri, 11 Jan 2019 13:49:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN5JuJ3AWmF1Y9XaysTtZ/r9ELXlyLOJx1TA0YsFU7Y8R0rX3jMgGS7WsTd+tw5QIu8MkLSD X-Received: by 2002:a63:fc05:: with SMTP id j5mr15070231pgi.434.1547243369435; Fri, 11 Jan 2019 13:49:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547243369; cv=none; d=google.com; s=arc-20160816; b=nTSwTO0jI9t1LEbPU/3LKKADLhSyPZBTMQ4d1BrdBAUToE7yGFtQMTnr0FP67TKyIm trkIU13ivYcc6mTvbu5jjUtuH+j5pw3pu+d6hV2gpCUQYe2RVJ5TpOBjo1ExpNBg9iIl yaJg2K1vIMKlLVIlPQzwoVfUvzEGbWqQdM6g2SVpsyqOTx+X1jKDL22xX1uMPmbKaYge ptw2JAZxoCCNhwIUewMNsK/SLE9dYwm0rZCrb/FnSvDQGTkRrwTR34maxlVvZd+CkIHG nvxgOE49X2a3CrS7AbbEDeHD03F9sUMVLhhuYzkCxy+e7ejsUbdhVa1RmHNXAvLTl23+ wL2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:references:cc:to:from:subject; bh=sffWUqMqMbPtl2nN4ZYQEoIHsF6U0ddy2hvEIWMQVhk=; b=Up37IdfGEniwewHlCABxAu2mKpgTCdCN79ApaWrflAkPah4528u8NIh9aerTG2bzqa 9b2jGKTnQwpgVNUCY8/P+4a/0ibCRBBsWx1ZkIenpPh1KtfrJ0hfjFJqDNQAtMyoP/RL A/5T4Sd9FtjfIqp81DT2kYOrTQcEDCB61XUtfwMW4Z+12To1mRKaHcoFp7K23ngU5DDu gtU47571s0H/otQkZ4po0RLZwX9LAEwBciNfPkhTvyoLyvO88vhiQa8zS7r2BBAjtMm8 ffk9p2GwLEvPrQ1prD23QHvldndZa2uksKsFRSZ2QLdvn/B/THvTGaayqk/9BUAf7Rmm QuHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l22si75704364pgo.411.2019.01.11.13.49.13; Fri, 11 Jan 2019 13:49:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbfAKVq3 (ORCPT + 99 others); Fri, 11 Jan 2019 16:46:29 -0500 Received: from syrinx.knorrie.org ([82.94.188.77]:43498 "EHLO syrinx.knorrie.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbfAKVq1 (ORCPT ); Fri, 11 Jan 2019 16:46:27 -0500 Received: from [IPv6:2a01:4f8:1c0c:6c86:6d3:b0ff:febf:d646] (unknown [IPv6:2a01:4f8:1c0c:6c86:6d3:b0ff:febf:d646]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by syrinx.knorrie.org (Postfix) with ESMTPSA id 51C2B34AE1A96; Fri, 11 Jan 2019 22:46:23 +0100 (CET) Subject: Re: [Xen-devel] [PATCH v2] xen: Fix x86 sched_clock() interface for xen From: Hans van Kranenburg To: Juergen Gross , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org Cc: sstabellini@kernel.org, stable@vger.kernel.org, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, boris.ostrovsky@oracle.com, tglx@linutronix.de References: <20190111120805.24852-1-jgross@suse.com> <74aafdff-c7d5-b9aa-c3fb-3787d36c7bbe@knorrie.org> <8ec039c6-d0fc-c7f4-72a4-ae677c9bbb68@suse.com> Openpgp: preference=signencrypt Autocrypt: addr=hans@knorrie.org; prefer-encrypt=mutual; keydata= mQINBFo2pooBEADwTBe/lrCa78zuhVkmpvuN+pXPWHkYs0LuAgJrOsOKhxLkYXn6Pn7e3xm+ ySfxwtFmqLUMPWujQYF0r5C6DteypL7XvkPP+FPVlQnDIifyEoKq8JZRPsAFt1S87QThYPC3 mjfluLUKVBP21H3ZFUGjcf+hnJSN9d9MuSQmAvtJiLbRTo5DTZZvO/SuQlmafaEQteaOswme DKRcIYj7+FokaW9n90P8agvPZJn50MCKy1D2QZwvw0g2ZMR8yUdtsX6fHTe7Ym+tHIYM3Tsg 2KKgt17NTxIqyttcAIaVRs4+dnQ23J98iFmVHyT+X2Jou+KpHuULES8562QltmkchA7YxZpT mLMZ6TPit+sIocvxFE5dGiT1FMpjM5mOVCNOP+KOup/N7jobCG15haKWtu9k0kPz+trT3NOn gZXecYzBmasSJro60O4bwBayG9ILHNn+v/ZLg/jv33X2MV7oYXf+ustwjXnYUqVmjZkdI/pt 30lcNUxCANvTF861OgvZUR4WoMNK4krXtodBoEImjmT385LATGFt9HnXd1rQ4QzqyMPBk84j roX5NpOzNZrNJiUxj+aUQZcINtbpmvskGpJX0RsfhOh2fxfQ39ZP/0a2C59gBQuVCH6C5qsY rc1qTIpGdPYT+J1S2rY88AvPpr2JHZbiVqeB3jIlwVSmkYeB/QARAQABtCZIYW5zIHZhbiBL cmFuZW5idXJnIDxoYW5zQGtub3JyaWUub3JnPokCTgQTAQoAOBYhBOJv1o/B6NS2GUVGTueB VzIYDCpVBQJaNq7KAhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJEOeBVzIYDCpVgDMQ ANSQMebh0Rr6RNhf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HLfQoXW8RQ388Q69JG4m+JhNH/XvWe3aQFpYP+GZuzO hkMez0lHCaVOOLBSKHkAHh9i0/pH+/3hfEa4NsoHCpyy Message-ID: Date: Fri, 11 Jan 2019 22:46:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en_US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/11/19 4:57 PM, Hans van Kranenburg wrote: > On 1/11/19 3:01 PM, Juergen Gross wrote: >> On 11/01/2019 14:12, Hans van Kranenburg wrote: >>> Hi, >>> >>> On 1/11/19 1:08 PM, Juergen Gross wrote: >>>> Commit f94c8d11699759 ("sched/clock, x86/tsc: Rework the x86 'unstable' >>>> sched_clock() interface") broke Xen guest time handling across >>>> migration: >>>> >>>> [ 187.249951] Freezing user space processes ... (elapsed 0.001 seconds) done. >>>> [ 187.251137] OOM killer disabled. >>>> [ 187.251137] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. >>>> [ 187.252299] suspending xenstore... >>>> [ 187.266987] xen:grant_table: Grant tables using version 1 layout >>>> [18446743811.706476] OOM killer enabled. >>>> [18446743811.706478] Restarting tasks ... done. >>>> [18446743811.720505] Setting capacity to 16777216 >>>> >>>> Fix that by setting xen_sched_clock_offset at resume time to ensure a >>>> monotonic clock value. >>>> >>>> [...] >>> >>> I'm throwing around a PV domU over a bunch of test servers with live >>> migrate now, and in between the kernel logging, I'm seeing this: >>> >>> [Fri Jan 11 13:58:42 2019] Freezing user space processes ... (elapsed >>> 0.002 seconds) done. >>> [Fri Jan 11 13:58:42 2019] OOM killer disabled. >>> [Fri Jan 11 13:58:42 2019] Freezing remaining freezable tasks ... >>> (elapsed 0.000 seconds) done. >>> [Fri Jan 11 13:58:42 2019] suspending xenstore... >>> [Fri Jan 11 13:58:42 2019] ------------[ cut here ]------------ >>> [Fri Jan 11 13:58:42 2019] Current state: 1 >>> [Fri Jan 11 13:58:42 2019] WARNING: CPU: 3 PID: 0 at >>> kernel/time/clockevents.c:133 clockevents_switch_state+0x48/0xe0 >>> [...] >>> >>> This always happens on every *first* live migrate that I do after >>> starting the domU. >> >> Yeah, its a WARN_ONCE(). Ok, false alarm. It's there, but not caused by this patch. I changed the WARN_ONCE to WARN for funs, and now I get it a lot more already (v2): https://paste.debian.net/plainh/d535a379 >> And you didn't see it with v1 of the patch? > > No. I was wrong. I tried a bit more, and I can also reproduce without v1 or v2 patch at all, and I can reproduce it with v4.19.9. Just sometimes needs a dozen times more live migrating it before it shows up. I cannot make it happen to show up with the Debian 4.19.9 distro kernel, that's why it was new for me. So, let's ignore it in this thread now. >> On the first glance this might be another bug just being exposed by >> my patch. >> >> I'm investigating further, but this might take some time. Could you >> meanwhile verify the same happens with kernel 5.0-rc1? That was the >> one I tested with and I didn't spot that WARN. > > I have Linux 5.0-rc1 with v2 on top now, which gives me this on live > migrate: > > [...] > [ 51.871076] BUG: unable to handle kernel NULL pointer dereference at > 0000000000000098 > [ 51.871091] #PF error: [normal kernel read fault] > [ 51.871100] PGD 0 P4D 0 > [ 51.871109] Oops: 0000 [#1] SMP NOPTI > [ 51.871117] CPU: 0 PID: 36 Comm: xenwatch Not tainted 5.0.0-rc1 #1 > [ 51.871132] RIP: e030:blk_mq_map_swqueue+0x103/0x270 > [...] Dunno about all the 5.0-rc1 crashes yet. I can provide more feedback about that if you want, but not in here I presume. Hans