Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1714857lqb; Sun, 26 May 2024 13:57:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7/qWqQ/DwLfUYPG8yTackDbXSW8mBLt66j5KuOBdW6sb3+VzI8Faw/y420glmPOGu/I9zACZpv2kxb0jG44Q6QSO3vzAhmb/ta7wf9g== X-Google-Smtp-Source: AGHT+IHBieH2wpwVlKW2vBTNtV7b7e6RaSSBWv4eFTCS3gTPq5zRT35WfV1EZE7DoZ/rUswxnQNY X-Received: by 2002:a05:6214:5681:b0:6ad:77ad:7a9d with SMTP id 6a1803df08f44-6ad77ad7bc2mr28093296d6.39.1716757032694; Sun, 26 May 2024 13:57:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716757032; cv=pass; d=google.com; s=arc-20160816; b=QUuaRfkgHJzBNv6SPjQKEAS6yt9za7hHnIfMYYDwHk5JcqY1ecOokC9bOz/cAmerqM ueDSkr6ugblkEG/t6qOjZksEZflkbVXna1KegG3SDTIOZhLC1unkLCCU0qfLVx4Zx9OU BE2jt1xvM6UNANN4IrlW/k6WbGJRJmAUelmmtLwPiqQXZ9dDDJSNgUe6/8DmDraMAknW UrC0U5PqpGrBMEzSEEj9DzWY3ovVW2NFP33FcGko2zw2omgQ7WFI2a0cx9FxTWRtSReU /7gbyiTG5NKmjkb7mHQCzvkOurJlkNqaW7/svOjNEfVeSCga3NtlAYtCDmkS5TMGZklA Y+Pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wn40RKBMpL0oRV3mwI5oUxidGtRGAsVHkpIV3CJZWHY=; fh=yQwWfvz/AmqMUctcoie8AVONwMocKAp8YqCVPuNRsKU=; b=oAg4alB72bMKGjq8v3gAjiuUI38Zrw5HOS/GL6aJ4PH8NUrO5EFI5IcMhQxdrgcj+L MJS/i56h9VZsIKFYg06Rx1z+FDJYJt0D9N0envwb06dRNmVnqJOrtO+LLdoixpH3EEcW dfAS7u5haFJYMmdNrVXStcvc39ETzzxqshvPX3hExGgRFNPSdhDzklRqiJKfxiSYY7v9 pb8CfIWYYKNx3t4l0j+K51r1GLOVUCOw/jo/bYTQIIzo4QW5TGQWDYBOJlW4v9wHNNFk QfDzjKGQhsPGFFomsQ1OmGlcownedh0CXs/pjxrfERAehdzbCCKpBnOfqr7ZqNVHC1/k CB3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GhenBsoa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189872-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac0707d2d6si65256136d6.136.2024.05.26.13.57.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 13:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189872-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GhenBsoa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189872-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 6A8ED1C20972 for ; Sun, 26 May 2024 20:57:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FD71139D1C; Sun, 26 May 2024 20:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GhenBsoa" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AAB8C29CF0 for ; Sun, 26 May 2024 20:57:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716757027; cv=none; b=OgAIX39LsOQV63mqb0TInZg2G/ExeQg9WQnGSZmeFrJUifRIS2cNPsJDMUgdCgwQrpYKvC+Mn7XNCQ827YW+qFt8odLigGPyHuRiNsK3r/8kG+gpIU1Hhy5fp8ZiBqNOZoEAUYAdpYoj/AKTPp+E6BdsMaF2vrEE1fU4FIEgcw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716757027; c=relaxed/simple; bh=BKXmSLBwhsuZSE0EbqW+pJjwzw8HRsPk9vLOKGQLJcw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kTZxlQpFRcSYvyvtCh19AvKpqm0NQ7rNVCAGD8yvg1tbHihHCIadSy+xJyC59QTiX+ca+L78qA6EryKodWOoGjKvhP6pF0ZKyDuNuw3v7uUFsuT9YYnl4uS1yT5N7i6H1WvZkF5mo5grAi7qxSDnTFYO8W5XcH1fOKHLAzOFPyA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GhenBsoa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECAA6C2BD10; Sun, 26 May 2024 20:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716757027; bh=BKXmSLBwhsuZSE0EbqW+pJjwzw8HRsPk9vLOKGQLJcw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GhenBsoaIDohaV8EZkK13uU0hxchwQaaDGBjzHLl3JTfUJkEC2aHWjx5zAsb8DJ7F h/+lTyVt1rg8xhbpJPspXdf7ve+TeDY5fOT8VNVKKznnTp5S7ifAbbN4YO/WavR/+A dHr4WlViha2lKUJuLYGGjpz6kIfPPnnA5ux7u8wHUP/I5wiXM2ljvIlBgI+Hqp4yUy NCn5HIzSLTYdwVo5xjbAckLmyRPRh/vxX5tqWq1x6DNoo++y3ODTVqNxKGk64xe/aP 39QzfGrJahHjTS66vGhs6L5sBMzzJvyZx6GvBX9y+10/16cESVNu/M95m7ne0Ju6Ew fS4xsQUflWYNg== Date: Sun, 26 May 2024 22:57:04 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: Oleg Nesterov , Ingo Molnar , Nicholas Piggin , Peter Zijlstra , Phil Auld , Chris von Recklinghausen , linux-kernel@vger.kernel.org Subject: Re: sched/isolation: tick_take_do_timer_from_boot() calls smp_call_function_single() with irqs disabled Message-ID: References: <20240522151742.GA10400@redhat.com> <20240523132358.GA1965@redhat.com> <87h6eneeu7.ffs@tglx> <20240524183700.GA17065@redhat.com> <87v832dfw1.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87v832dfw1.ffs@tglx> Le Sat, May 25, 2024 at 12:06:06AM +0200, Thomas Gleixner a ?crit : > On Fri, May 24 2024 at 20:37, Oleg Nesterov wrote: > > > I've already had a few beers today, I know I'll regret about this > > email tomorrow, but I can't resist ;) > > You won't regret it. :) > > > On 05/24, Frederic Weisbecker wrote: > > But again, again. tick_sched_do_timer() says > > > > * If nohz_full is enabled, this should not happen because the > > * 'tick_do_timer_cpu' CPU never relinquishes. > > > > so I guess it is not supposed to happen? > > Right. It does not happen because the kernel starts with jiffies as > clocksource except on S390. The jiffies clocksource is not qualified to > switch over to NOHZ mode for obvious reasons. But even on S390 which has > a truly usable and useful clocksource the tick stays periodic to begin > with. Why? > > The NOHZ ready notification happens late in the boot process via: > fs_initcall(clocksource_done_booting) > > So by the time that happens, the secondary CPUs are up and have taken > over the do timer duty. > > [ 0.600381] smp: Bringing up secondary CPUs ... > > .... > > [ 1.917842] clocksource: Switched to clocksource kvm-clock > [ 1.918548] clocksource_done_booting: Switched to NOHZ // debug printk > > This is the point where tick_nohz_activate() is called first time and > that does: > > tick_sched_flag_set(ts, TS_FLAG_NOHZ); > > So up to this point the tick is never stopped neither on housekeeping > nor on NOHZ FULL CPUs: > > tick_nohz_full_update_tick() > if (!tick_sched_flag_test(ts, TS_FLAG_NOHZ)) > return; Oh nice! I indeed completely skipped the clocksource part of the picture! Thanks.