Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp972349lqj; Mon, 3 Jun 2024 06:42:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcsnQzCIzQVy+85yhjH9GNNiUQAyACgtqPid+S3d3+BvQyYb9aF1i3mrlGbjGQC59OCF3tpc7Dr1zswGpRMdsd5t0iKFWh/DfIcR7v2w== X-Google-Smtp-Source: AGHT+IHZaFEzPcFEvxi04oYO2TaNmLpIHtppjbzn5Fk6yQjT0/mkuZOr6BTF97K0tgJsvbpA5lkI X-Received: by 2002:ac8:59c8:0:b0:43d:e71e:9772 with SMTP id d75a77b69052e-43ff52596f0mr122865741cf.40.1717422166580; Mon, 03 Jun 2024 06:42:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717422166; cv=pass; d=google.com; s=arc-20160816; b=NwP8CXANUPddIMBpr+NAO+FiSAX7FUorBUifsbeIwktmd9xj0xXQXqOucBb0DVuWC7 +D3TyyaehX21w5SJkRX8YT1d0bhW07WiEybBoFKgyQGydIVb5JyK1OZWZw5KIFohWW4n D5Wb/cLmijJqLaVFZqNAlC1Djzt6yFNXKIlps33+U1zq+TNqTPyimk8O5S+nSW0f7fLY eYs2uCSfk/rNnrZ+Ri9El2fFk5iuz+8oSZGF2iRZRWLyYxAhAtXMKgBfcHDhciM6EfCu y3D9p+HG9sDeK5QMqcbKEsbsz/pXmZudw3wyIEawru5STLaMdKxKJjjsj+8sUjhl1yKK /P6Q== 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=0XiDMYcq96Z7HWc66TmciFozG2sGDtvjwN27J1yBx8E=; fh=ZY6XUMjfT1Qzf0IznVU6MTPL2sNKjz4jmbjorW+MssE=; b=hssMckxYZsVt+YA02G7VaX5LM5InQzkzgsnXjEBBpDOvY8+u4bAX3mP5OY+4PzLfnU SzV4y0gh8rs5KX9AWSdFINC4Ta5Rw5tGA76nShNlfSybftPTgxIvKnCfH+wLsuOMReHM u/z/wz4oratDed7k/68w5+BAmrOkRQ517q3qpi0tbDHLFbNnTWlvu61TkuIeD7ZJU44c GFdXSjhgDBVFOc7W0Cn96i+C26k0L7ZuxrERXWJf6ItPcxu49FPnCPyoT9Inj7SeY+rS DM0PYhWaQAKCMSt3l2DZbye3wOqZxOknGkBhV8wPRQ3oNoS7dXzMR5G6grHZnRsfsxRL SurQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=acmdbPFN; 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-199239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199239-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff257df79si88748481cf.395.2024.06.03.06.42.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 06:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=acmdbPFN; 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-199239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199239-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4E9801C213A4 for ; Mon, 3 Jun 2024 13:42:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 936D012DD90; Mon, 3 Jun 2024 13:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="acmdbPFN" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 56CD912D766 for ; Mon, 3 Jun 2024 13:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717422160; cv=none; b=PWJSb2THq4GeDA1PDyWgCjVHvyjI/51Bq1awYEWcK44fAXR30olSU83PGe2eElug00BcRuv5Ttg45W0icPwthJ2xNweWbHThm4SQr1eSy5SENCK5dJYh0e9/eCts47UppsR+llsLEG2PoVUJiD5BtLWUBj20ucPLfKxS29MLa74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717422160; c=relaxed/simple; bh=fucPh4NT8afq/yJKF9Csi293Nc1OxsYl4BBLX3mkZgA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Tgu8BhcxIHurrmQ802sZuXkJSSje8cRDrlNyG4U+INUbiB2wPpkfKkcnvTtA0Js76HPQDBESatX7kTGDbnPTXgc0YcbEHZoC9BV5JyHXtmPGA3Ee755DGxCDcsFCDY90/D/Wj7LPUv8mLCzeskQT3r8wDNbTdDkH9XniKoIWJ4g= 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=acmdbPFN; arc=none smtp.client-ip=170.10.133.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=1717422158; 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=0XiDMYcq96Z7HWc66TmciFozG2sGDtvjwN27J1yBx8E=; b=acmdbPFNBEppepSlZCniWH1t8w8HBMilHLFaUbdyOsWn9zY/onkyGzstJkBBLgZrZnnsnQ BgG3HFr+wlOsesInihjgl+lRXuEoadjxq0Y8UwYE+g9uBVY59a8MW/igo601PROwjy3G21 grQw1+sHb08au+F2rH1FM166AUKI4cE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-414-HxOPD2R1O7ylb4JT3OAfXw-1; Mon, 03 Jun 2024 09:42:32 -0400 X-MC-Unique: HxOPD2R1O7ylb4JT3OAfXw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 1F697800CA5; Mon, 3 Jun 2024 13:42:32 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.103]) by smtp.corp.redhat.com (Postfix) with SMTP id B788E2011C42; Mon, 3 Jun 2024 13:42:30 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 3 Jun 2024 15:41:03 +0200 (CEST) Date: Mon, 3 Jun 2024 15:41:01 +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: <20240603134100.GA388@redhat.com> References: <20240530124203.GA26990@redhat.com> <20240602102007.GA27454@redhat.com> <87jzj6789b.ffs@tglx> 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: <87jzj6789b.ffs@tglx> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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". Thanks, Oleg.