Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3487879pxb; Mon, 4 Apr 2022 18:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo7RMnmuwpwTVybvno0CwcdIf9fwkRitaFwvfdBO1RmqTh4U9+ANkft7q7lgvr206Pp7hr X-Received: by 2002:a17:90b:4ac1:b0:1c6:adfe:322a with SMTP id mh1-20020a17090b4ac100b001c6adfe322amr1193252pjb.189.1649122500329; Mon, 04 Apr 2022 18:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649122500; cv=none; d=google.com; s=arc-20160816; b=kIYJ1cI7D1Bco8BOypYlMgubb5A68DpU/ZEFL2pw+I4UMINgMIVPiZVt0kWud9Ki6P s8IvpVQ7bLUdzjyojluMdEDoWcsewCuuxXogw7Z8p0X7rKYzZlabMiJysJjncdcwU6+I zM0deVUlNseOK/o4ht6rvKFgiTzJF94AvHq80n47B5saC8QHno5LMhLCU8jzQX+3s2ML +u0mADXF1TiHD42Cllcb0L7vZKRYChEY81PsZkQDqntXy7tdguK70alS3gbcfYzrOB9Z yG4cTEom2xgVj6ihoP2/is5cxrYFucRdOJa2kebpM0Tsr1/lkMpEC7XigUQ7o+GnGSdP qLUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=zWvGZKI9SeXG33QH0VHAxJwyqLjTHGSTR8wnBkMrRiA=; b=xGquLDVt+Iwk9oIMYTykrIHklod8fjU1FqcclfTGiqNMVDIB16Ui+3tK2HqRxgK2DG 3itFXqujmMet1vZOJd2F/lqkMDq7W6XLGdXVJFVRqtQYOW99QhewuxIw5J5PdOO4NX0b dshBqzfcGwBvUhxb0SGSaDffDyC25EaDexQCyMJgukGxXRA9z4zzx2ch0Z3vA8HzsyYg ows5NYW0MhKkl4yPVKuqwbiQIHiHRWQJeoiUuXsmml4tNRxabTBQ8KjuB+xOaWG9K6ze U7jJqFYI9GgtJz2QE3NGyJmINjlNyP6hp+5EfO4CMr9xogPXTWRkZwmmEs746uolEkWN 1jSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=lvTXhxeY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bm21-20020a656e95000000b0039958468eccsi1224295pgb.100.2022.04.04.18.35.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:35:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=lvTXhxeY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91E1C1F2DDB; Mon, 4 Apr 2022 17:24:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240764AbiDBOLb (ORCPT + 99 others); Sat, 2 Apr 2022 10:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346612AbiDBOL2 (ORCPT ); Sat, 2 Apr 2022 10:11:28 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84ADB13D45 for ; Sat, 2 Apr 2022 07:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=zWvGZKI9SeXG33QH0VHAxJwyqLjTHGSTR8wnBkMrRiA=; t=1648908576; x=1650118176; b=lvTXhxeYBpyqUGZ33w4DsAOnnl+bzRrCjQoOolk9Aw5caSb Yuk7xhqEV9ZWh0Uuh168F5xENm/2wk+yQ7NCsQcEkcumieqFdI6Xz5FZFNrNjfgWDnRlGIeIEiivx tDn5A/ddOQ6edT6x/CmxuiOUBZPvDNYpUQ8hnfM4rU9PFIkouZxfKk5zWAra9LgrOfGm2PCjCHA1V AM/LL1+rDd3jE92GRJ7sBfkmSzKqH4J4VIXKtSZ2Nd6zJijXWXYOpY9C+iLjTampT7WKPG9YuNceH /XCcAVDv8oPXCiuQIRe+mt+AnG+d3G71w6v9YbsXRxQIn/7biw4Xw1H2XNs5FUGQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1naeRW-003sRf-PW; Sat, 02 Apr 2022 16:09:30 +0200 Message-ID: <84f9d627092660c38400b607198c3b83f795be7f.camel@sipsolutions.net> Subject: Re: UML time-travel warning from __run_timers From: Johannes Berg To: Vincent Whitchurch Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Anna-Maria Gleixner , Thomas Gleixner , Frederic Weisbecker Date: Sat, 02 Apr 2022 16:09:29 +0200 In-Reply-To: <20220330110156.GA9250@axis.com> References: <20220330110156.GA9250@axis.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vincent, > [10737482.720000][ C0] ------------[ cut here ]------------ > [10737482.720000][ C0] WARNING: CPU: 0 PID: 0 at kernel/time/timer.c:1729 __run_timers+0x36d/0x380 > [for those new on the thread, full message and config here: https://lore.kernel.org/r/20220330110156.GA9250@axis.com] I think maybe you found a bug in the timers code? Your config has CONFIG_NO_HZ_COMMON, so we have both BASE_STD and BASE_DEF. Evidently, in your config, we *never* have any timer with TIMER_DEFERRABLE, which would put it into BASE_DEF. (I put a WARN_ON into get_timer_cpu_base() and get_timer_this_cpu_base() in the if, and it never triggered; I guess my config has something that creates a deferrable timer, so it didn't trigger, but I didn't check that now.) Therefore, base->next_expiry never changes or something? At init, we get init_timer_cpu(0) base 0 clk=0xffff8ad0, next_expiry=0x13fff8acf init_timer_cpu(0) base 1 clk=0xffff8ad0, next_expiry=0x13fff8acf which makes sense, jiffies is set up to wrap very quickly after boot. The warning triggers when we have jiffies=0x13fff9600, so it's just after the "next_expiry", so in this code: static inline void __run_timers(struct timer_base *base) { struct hlist_head heads[LVL_DEPTH]; int levels; if (time_before(jiffies, base->next_expiry)) return; we no longer return. Previously, we've *never* executed past that if for BASE_DEF. But we never touched this timer base nor did we ever want to recalc it I guess, so WARN_ON_ONCE(!levels && !base->next_expiry_recalc); triggers. I thought about changing that condition to if (time_before(...) || !base->timers_pending) return; and that *does* make the splat go away, but I fear that might make it not recalculate when needed, so perhaps in the condition we should have if (time_before(...) || (!base->timers_pending && !base->next_expiry_recalc)) return; or something? (which also avoids hitting the warning) But I really don't know anything about this code, so adding a few CCs. Can you help? Thanks, johannes