Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1024023lqj; Mon, 3 Jun 2024 08:05:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUG9Lw6XpZH5RLvisVyxICkIiWn/30o+XEtv8QjQtTaJfltGtr1fFJK/0QihEZHTx0nRnP3thZ6OFNWrukwYI0RlX2gp/6YBY2ZheGJQ== X-Google-Smtp-Source: AGHT+IHXkh5tfxhIOCM9oXX7GNa4z5Wvatmk7Ia0kKw89WyGM4ZSAz5wouiAI5wdSpeMLfPuTHFT X-Received: by 2002:a17:903:32c2:b0:1f5:e796:f26d with SMTP id d9443c01a7336-1f636fd9c77mr97165555ad.3.1717427100412; Mon, 03 Jun 2024 08:05:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717427100; cv=pass; d=google.com; s=arc-20160816; b=VHyUSc5OOyMChxGJsptSRbOHMSTfTwgZKsbyGHNb4sQxbQRP8AvRQVrMWOWdUSyGg9 NEAMxSOw/7mm6Hky26P6bfVlJobLX2+871WV3C05sNUew0+paxdkkyUp+CbjTF2kz7Aa HSSXl/2Azw5beYqJusGQQnhD4O1ZBEq6XHuQW+qtJ2yNqg1CEvKJXTHa+lJ5RUCLPyGl kpCz1Hxmnz68zONXsJNxOgK7PO6umshcBYJeBWlvf0xU2LEQS8z4tbZg2NW5DJ8FlYjV 43Ql2C9NYQXEnGCEkGC3c0N1KGaE/8WKDO9BX4+i2QHSAqDuxwQhzM6nnY4kN6TSEkEl gj/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=hSP7uT+GwnJuqCrKWe61V7eti5NONprO/a97gKxkynU=; fh=ZY6XUMjfT1Qzf0IznVU6MTPL2sNKjz4jmbjorW+MssE=; b=XxNYdeFPUW1Zrt2UyZ8xjGhbDsH7QPpcAS6VXTsCd3V5er/wbZ9C/ZjjoZJzmuFTQS 0ONxlvlVg2Tgi56smWugnBAuTcNjzQoHd2t0fYaSWSrdNBDmx17/UbIflLr7fnC7NlQ9 Y+p/1wKcatbOxfknzDyVRn68T+E+KuO2HaYSB8tJKCgwDGDDgFFfp5f2qsBSmSSG2LKf /SYD1lOcqDJQtuWQMzW+UgJHsSFhb//NFuR/e6vIrOYoljNIOu5VZfkW99iydJQOqXKm ikSLqcPi5YeLfqJomOmYZvf11X0I8S1gaZlKPjXaWc2x1mZJnuaVJ+CofvZd+ywBqS8z EJ1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YOYJ4t8k; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-199335-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f632367189si66050715ad.185.2024.06.03.08.05.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 08:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199335-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YOYJ4t8k; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-199335-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 06CB3282442 for ; Mon, 3 Jun 2024 15:05:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62F361EF12; Mon, 3 Jun 2024 15:04:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YOYJ4t8k" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D5794688 for ; Mon, 3 Jun 2024 15:04:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717427093; cv=none; b=Od7VcnMZVcqos2KcW1lVYodZpVGitAOKZIHm+978WL6eJUPdDBV2i51tmZG3P6LCDRZT52mVX65wJDCEWlZRykt1pZX4swLvgNOqiOO13ru3mjM5pm+3QZMDYNRxx5dzj/8jy4jStZyo2ynidWvDqtKcNCD+PMGysZwC8TwgDfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717427093; c=relaxed/simple; bh=88kI+riU9Oh93UNPrHzY+gClgmBM46CaGhKGQnVncf4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=umUh1IspkhKe5dgzBR38GJhEwO9C4P+ng8tfHYaKoU59c01rc323RQ1i5X5mtQFJ0ec10JhoOubdOZyvq1NB3+5w37jv8IQSepyQ54acc++4OpEWL8Ru/j8bB7lEJdy0Qy2MptMoCGWCKBMtrQ74ZBj3wjDYDAJZLAvbXyscMKc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YOYJ4t8k; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717427091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hSP7uT+GwnJuqCrKWe61V7eti5NONprO/a97gKxkynU=; b=YOYJ4t8k5eKhuJgkcUtjXZbLW8XXaO6/xibb9z4sZXeqZgCRc0GdTURw2qjdBZsGOTjpYH NbImmpnACIyn29jUsaVVG+dTV4/sILG9ShTPArCv+TudjK2gmw6OGFPHFwgkUn6ecvm2So 4SHBVaiqyy9oojNgoUJaw5WJPeQt+5w= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-Pd_58nfsNgK1vb0SKLtDeA-1; Mon, 03 Jun 2024 11:04:48 -0400 X-MC-Unique: Pd_58nfsNgK1vb0SKLtDeA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6FB973806707; Mon, 3 Jun 2024 15:04:48 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.103]) by smtp.corp.redhat.com (Postfix) with SMTP id E8A9F103A3B1; Mon, 3 Jun 2024 15:04:46 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 3 Jun 2024 17:03:19 +0200 (CEST) Date: Mon, 3 Jun 2024 17:03:17 +0200 From: Oleg Nesterov To: Thomas Gleixner Cc: Anna-Maria Behnsen , Frederic Weisbecker , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] tick: shift tick_nohz_switch_to_nohz() from tick_check_oneshot_change() to hrtimer_run_queues() Message-ID: <20240603150317.GB388@redhat.com> References: <20240530124203.GA26990@redhat.com> <20240602102007.GA27454@redhat.com> <87jzj6789b.ffs@tglx> <20240603134100.GA388@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240603134100.GA388@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 On 06/03, Oleg Nesterov wrote: > > On 06/03, Thomas Gleixner wrote: > > > > On Sun, Jun 02 2024 at 12:20, Oleg Nesterov wrote: > > > @@ -1891,8 +1891,11 @@ void hrtimer_run_queues(void) > > > * there only sets the check bit in the tick_oneshot code, > > > * otherwise we might deadlock vs. xtime_lock. > > > */ > > > - if (tick_check_oneshot_change(!hrtimer_is_hres_enabled())) { > > > - hrtimer_switch_to_hres(); > > > + if (tick_check_oneshot_change()) { > > > + if (hrtimer_is_hres_enabled()) > > > + hrtimer_switch_to_hres(); > > > + else > > > + tick_nohz_switch_to_nohz(); > > > > hrtimers have no business with tick_nohz_switch_to_nohz(), > > really. That's a strict tick/nohz specific thing. hrtimers do not care > > about NOHZ much. They care about whether they can switch to high > > resolution mode. > > OK, lets forget this patch then. > > But note that the comment above the tick_check_oneshot_change() says > "switch to highres and / or nohz mode". But yes, please forget this patch ;) Currently hrtimer_run_queues() doesn't return if tick_check_oneshot_change() itself calls tick_nohz_switch_to_nohz() and returns 0. Oleg.