From mboxrd@z Thu Jan 1 00:00:00 1970 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 C80F172631 for ; Sun, 22 Mar 2026 21:18:38 +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=1774214320; cv=none; b=EJWJC1psP4lRQSaNFLW+Tb0k+6gYhACCC8ab/t+SmDaw5aMPG4XFpNgqYMSH3A7eBJZUtkLHzwmFFGM8dYIEU5iZKvytQ6TxaaRYA0J51bOMDuQsUftqpEP/q+Xwq/67gD3ygICXmSaUQ5NSPLcx0bg36cZlo23XxuTv3WxVW4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774214320; c=relaxed/simple; bh=CfQuMZW+DX4ZxEvmegTujF7KZ34jeqRBtnMsX8LD3VA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PbFHVYNUxlZVG1/SNhELfjkdkDS9KJ0jIENvoeXrBJXqNHl4BvXC1FJr8vWzC96Rob5pnBNM7VUkYSym3Lp9sawfi9nkzw5YDS4QsfnbICj7BemTy0JbUhGYQSSMshHmXPuyOP1loN9yVV0EymPhHN3DCUTjJSGEID4+ofz+Uac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=T50TgKed; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="T50TgKed" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774214317; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TAz1iDGQDF8ZAcHS0jNzUMg1vYbN6RfHT3bdw7/T508=; b=T50TgKedRkdW24raxDj4GYMciqVLRwMIFUVCADH0CDuiQ87NY6B8LeBBHTr1jqTg6n4UoR OVtOx4cvAu4NH57SoG+u/09KaOcccLDYdXsUaqGH1rrA7raHvUTVi+/+EJgrcBt+/F4Fdx M9TPWD3nqeMmt8mYrLK9698ryk6jEUw= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-451-hMibqDSYOGiNz9bN5PS7kQ-1; Sun, 22 Mar 2026 17:18:33 -0400 X-MC-Unique: hMibqDSYOGiNz9bN5PS7kQ-1 X-Mimecast-MFC-AGG-ID: hMibqDSYOGiNz9bN5PS7kQ_1774214312 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E5328180044D; Sun, 22 Mar 2026 21:18:31 +0000 (UTC) Received: from [10.22.88.38] (unknown [10.22.88.38]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4FDD31955D71; Sun, 22 Mar 2026 21:18:31 +0000 (UTC) Message-ID: Date: Sun, 22 Mar 2026 17:18:30 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [QUESTION/REGRESSION] Unbound kthreads scheduled on nohz_full CPUs after commit 041ee6f3727a To: sheviks , frederic@kernel.org Cc: linux-kernel@vger.kernel.org References: <98b598f7-cbc6-42bd-bd01-d077549628fd@redhat.com> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 3/22/26 1:48 PM, sheviks wrote: > Hi Frederic, Waiman and maintainers, > > A quick follow-up on my previous report. After leaving the system idle > for a longer period, I made an observation that pinpoints the issue > more precisely. > > The cgroup v2 dynamic isolation does eventually work. I noticed that > the unbound kthreads are eventually migrated to the housekeeping CPU > (CPU 0), but only after they wake up from sleep and enter the running > state. This lazy migration highlights why commit 041ee6f3727a is > causing issues for setups using nohz_full= without isolcpus=: > > 1. At boot time, because isolcpus= is absent, the HK_TYPE_DOMAIN mask > includes the nohz_full CPUs. > > 2. When unbound kthreads are initially spawned or have their affinity > set, the new logic relies solely on HK_TYPE_DOMAIN. Consequently, they > are placed on the nohz_full CPUs and immediately go to sleep there. > > 3. They remain "trapped" on the isolated CPUs until a wake-up event > finally forces the scheduler to migrate them according to the updated > cgroup affinity. That makes much more sense now. Yes, this is what new behavior should be. > This brings the focus back to HK_TYPE_KTHREAD vs HK_TYPE_DOMAIN. While > HK_TYPE_DOMAIN might default to all CPUs without isolcpus=, > HK_TYPE_KTHREAD correctly excludes the nohz_full CPUs from the very > beginning. > > Is this "spawn on nohz_full and wait for wake-up to migrate" behavior > intended? To prevent these sleeping kthreads from polluting isolated > CPUs before cgroups can intervene, should the initial affinity check > still consider HK_TYPE_KTHREAD alongside or instead of HK_TYPE_DOMAIN? The plan is to make nohz_full also dynamically changeable at run time in the future. We are not there yet. Now HK_TYPE_KTHREAD is equivalent to HK_TYPE_DOMAIN. A CPU cannot be considered fully isolated if it is in either HK_TYPE_DOMAIN or HK_TYPE_KERNEL_NOISE. Currently, the nohz_full kernel parameter can be used to put a set of partially isolated CPUs in the nohz_full reservoir. To fully isolate them, some or all of them will be need to be put in an isolated cpuset partition. BTW, HK_TYPE_MANAGED_IRQ will be made to be dynamic too. That is my current view. Cheers, Longman