Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp602145rdb; Thu, 22 Feb 2024 13:24:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVhh3LvzpNGUE8w5uHRV4cpxIEmRbH+JrrXjQp/kIF3AbFa+RZCy9/8wY2uHQDAvGtVXm3uKebtuFLryajOGPYUXFDfFwyCOWJn2LwSgw== X-Google-Smtp-Source: AGHT+IEcmBtTHmQ8SNHU8chlhVL+08sgqJEcQGCD1XrDEf4RHQxag4ElC+JWXMPDM1mpEfBjPQw5 X-Received: by 2002:a37:ef13:0:b0:787:a83a:cfed with SMTP id j19-20020a37ef13000000b00787a83acfedmr240553qkk.70.1708637085979; Thu, 22 Feb 2024 13:24:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708637085; cv=pass; d=google.com; s=arc-20160816; b=GYL1CeBLDDKwFnduqjDO6NFwBBZ0HxZdisHEpj/Xp/fRYWomrsLMiTtdGPN17YAt70 nLm2os7/hcPU+pQv3qqRa30bVYdRvU2A6D/5SqdbvoBoOQakOgDvaGu14gn4SXmkTVt0 fIZVTOGlENKPUDAk9MVBcRDmZkfvl5h/vAc238XGeqVqZ2o8N5Fd6SPlMy26brvoVE2Y C+VLSDo5Yu5N0K8ICqEmmSfKpJjuvdDgNChuxs6O7TDsyfqiRGZDJJlt7prUM3yvOO/x eai7fbZ02h3T08D5hLZufGUoGsXrj/xWv+6dSQ1mzucSE4+42UW5fe3yscHW66DoUZ9+ M0mA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=bB5ASdAOKRlBSjf6eEIPEh+eRCucZRp3Y42SIxEk/kQ=; fh=L8EPrqVQsK844v9donanObl173uYjwrI5cuLOJIrdBw=; b=cv3pY8RKbCKhL0/bG0Cxc2GzYE3VMaclKsUm2tYzIdXq+jXAYOzmPeetexcTS8u5Iv FeoO99+3RuGICt1KFBW67suDXKKb3rrnsRF3ZzUCkIA4e0ZNXfB/wZoD9l0xmFLAT0G0 e4HjYCRCsA8S8C/sJCz30SQXh2ITlWtL6hLVBKBDAi298y8dntTa+9IILZPXFY/j2OH0 lPvtgao7viHrO6mBsISbWex555izssDi9j5CKlpvNuKRtmzUmEINQYeyzdOaMPENX5vO +R9l/nS5LlG/2tG4DxcpaWdHB9Snx5uqGSIGSeJtKv9d5NBG3fWF0Z3FRDrw+KpUb9s6 h62A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CbPA8iko; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-77396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u2-20020a05620a120200b00787329ed629si1216948qkj.423.2024.02.22.13.24.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:24:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77396-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=@linutronix.de header.s=2020 header.b=CbPA8iko; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-77396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 BA8601C246A1 for ; Thu, 22 Feb 2024 21:24:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACF8112D201; Thu, 22 Feb 2024 21:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CbPA8iko"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9V1oGtxM" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 EFAAB73F33; Thu, 22 Feb 2024 21:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637050; cv=none; b=OZgYG/nf1L8HcRktmfv4IW44K/efOj3wuat8lasri8ET3jaj0uyQKf402wg5qr+xsS12Bon+clKhyQfAKM7IYa8ySQjl3ZdSuPYOCmxe/KtzMVbyURLoYuixNw5nENKC9SBhfev+gTxTCxLeQJB4GQpbps5ZCoylDEgiXmS5K70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637050; c=relaxed/simple; bh=P/vAShnlnt4tTjBE+MfxxvVqDIWHSWlCHwALHLpLotU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=iWIurdqrD8L8RJzn+v0YutPkb2IWft/jsXzteAAb5pw1oVTjDnNyuCMoIFAwlMzihn5RyQhiJ508SFFM1InFemXomAxnb166pqTRKLtqZczrFkcpI768c9cKMMyS4FvsFLUR1fwrQWat42AEBTfEnZNG2ht601ZwevWOgR0OwMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CbPA8iko; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9V1oGtxM; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 22 Feb 2024 21:24:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708637047; h=from:from:sender:sender:reply-to: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=bB5ASdAOKRlBSjf6eEIPEh+eRCucZRp3Y42SIxEk/kQ=; b=CbPA8ikoths2la+5P6ubxZeLP9GYnkEwpobiJIJj8E6FEf/jAUgHEYyxx/A6yJ5aWm677G pwG7Vs7mLDCOztMq87uj1uUmlJpqN2nh5dd13a7RMopfaqtKqQilnqXrrSDZs23ffnRSYj XZ9TBmtdweATxKmZpehyPXMNGvgOqRC4hPHHX13UYulfVNOScgVGz+n3axVaV4a/cFNCBw Y1iU9mK30MIbMkvzx4TMIf89tXMHrMmSQmTLP29PB2aix6vq9Qp9Yi4pj1AP8s7SmuCT5V FoiJZryJLhC8GoQ7apLlhNFC5kx8txvn8gzGwknxeYzyhdOVOd5rp6dPBfasRg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708637047; h=from:from:sender:sender:reply-to: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=bB5ASdAOKRlBSjf6eEIPEh+eRCucZRp3Y42SIxEk/kQ=; b=9V1oGtxMvGaDmOwh+O4SkL2zkT0WBZi0eiYuwBcYCSDLlpwOBipMKIV7CTR06GpO7iakyd RwnzxRzMm9o4faDA== From: "tip-bot2 for Costa Shulyupin" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] hrtimer: Select housekeeping CPU during migration Cc: Waiman Long , Costa Shulyupin , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240222200856.569036-1-costa.shul@redhat.com> References: <20240222200856.569036-1-costa.shul@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170863704606.398.1106798877548525205.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the timers/core branch of tip: Commit-ID: 56c2cb10120894be40c40a9bf0ce798da14c50f6 Gitweb: https://git.kernel.org/tip/56c2cb10120894be40c40a9bf0ce798da14c50f6 Author: Costa Shulyupin AuthorDate: Thu, 22 Feb 2024 22:08:56 +02:00 Committer: Thomas Gleixner CommitterDate: Thu, 22 Feb 2024 22:18:21 +01:00 hrtimer: Select housekeeping CPU during migration During CPU-down hotplug, hrtimers may migrate to isolated CPUs, compromising CPU isolation. Address this issue by masking valid CPUs for hrtimers using housekeeping_cpumask(HK_TYPE_TIMER). Suggested-by: Waiman Long Signed-off-by: Costa Shulyupin Signed-off-by: Thomas Gleixner Reviewed-by: Waiman Long Link: https://lore.kernel.org/r/20240222200856.569036-1-costa.shul@redhat.com --- kernel/time/hrtimer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 5a98b35..1fd106a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -2225,8 +2226,8 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, int hrtimers_cpu_dying(unsigned int dying_cpu) { + int i, ncpu = cpumask_any_and(cpu_active_mask, housekeeping_cpumask(HK_TYPE_TIMER)); struct hrtimer_cpu_base *old_base, *new_base; - int i, ncpu = cpumask_first(cpu_active_mask); tick_cancel_sched_timer(dying_cpu);