Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1285097lqo; Fri, 17 May 2024 18:26:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVC0KO4QBgj74Sv1QPpiB2qQkeG82i3GJqFslF7utMFAZsjspAM8Fmd/Tme0Dl3m5c2rFX/2QNVDEO8DNixVD89prjWMrdHLuT5Y+OFNQ== X-Google-Smtp-Source: AGHT+IEMm0eHfW4ruYtqutGMz/K/MNV73p+RGzrIXhBSJn4mS0bfOkLAHsrXrVi39LY9/xvqLIOV X-Received: by 2002:a05:6830:1e2f:b0:6f1:2341:348b with SMTP id 46e09a7af769-6f12341363amr11194127a34.3.1715995619723; Fri, 17 May 2024 18:26:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715995619; cv=pass; d=google.com; s=arc-20160816; b=q3Gtu/82P+zn7JavUJ8Xk9aQ9ioOMG7hKPb9sSkAluKT+QHRX07e54Uz/qGz+kslYK 5I+IxONppVmWESlA0+yJrfSpfbmkWEUjvkw92p7RD70CysIrJwX19OTbzjI5BtOWFOEF 506CwfoO1aZUqDroWJVLpalbrr1hIB1yiC5wUXX+ihKNo8T/QB6gcKMgnWXlLQv2L1Y2 01LZFN+m28R3qCH0zoIxZ6yjby+DhOUsoxZB4MH2C4mm/y99PRwO3vWfbFf49+/3VdNy Xs/HQG+zMIfhziQUyXAjDZ95jByq24Q4qLjM+TNnOVeWM9ADLBcPpTvThBT56qGN5wlb bERA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:to:dkim-signature :dkim-signature:from; bh=FjMrzFAps1/5DI6E1pJhCseVkyrxWMsgaCpQLqNIzZo=; fh=qjDezo9vaQ5m1N/atvey9CNr7tz3j4GqssRLHeg3PrE=; b=kVHLvLbXYiQBzbbFCXqGGVrAKYXKWHBgZoWrUS0u6Fggrx0kSt1pi3YRf1qgvvTW8G 0E3BHMtE0CqDsz1H+NXZWZHiol4+zSK1iG45bm8yBqVIA+Ip9rzSqhCruKIhFxhdCasf R9Y0lO+At15eLxmjhOiPChBZ465PGMEtB0XclW96qt/wY7ZfW1pNacNj0aeIhPS+mvdN YBkpk5pWOlZbXT8QODTrm/qcDs4IOquAnSwdzk959jdD32gSZrz7r5bwS9TUk/PRaPHR 1322iqTIySfMqtqdx6LdVXAlk5pPzaKwkVTAH/VcOyY0pj9n0+gockGqEW+pUpLjavEk re3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="X/lJrsny"; 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-182735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182735-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412a4d15asi5424873a12.704.2024.05.17.18.26.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 18:26:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="X/lJrsny"; 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-182735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182735-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B631AB21734 for ; Sat, 18 May 2024 01:26:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E43528BE0; Sat, 18 May 2024 01:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="X/lJrsny"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wUEZICMm" 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 C1A5C4C8B; Sat, 18 May 2024 01:25:42 +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=1715995544; cv=none; b=Y5zHDW6uHr88YWtilIxgK9/l+VqwOSZ+C0yVsbdn2fTasxK7wUpVMZ56ZzRIe9vdCjQqDgvQnYXbb/loqxxt/A1fwLFoZ7OoVKFE7Ryb/NZawqkYsRfXqEOIaMJYSbaxdr9Crro7jdJhkw0ktdsC9NXWa45+yEj2+ttatnWahfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715995544; c=relaxed/simple; bh=bShbf5InU3Hku1+D50QV7iqSrD5aDAK0nYFxFHxjIT0=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ryqWC1hyllSSidz+4wP4XQ8auh0Plc4Q8AO6ajmu5nYs2MzfhmlSpCQnUog8csy1TIl9V3XrKudNCw9QjG0KOiIehb6tl/ppWRxi6B3VaGQUxAD22S8QcW81+IQ5RbMCRUJ2+IHlztqm7xPe+IQoazrmY1oXZ3SrFVUy9QAPb4k= 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=X/lJrsny; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wUEZICMm; 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 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1715995540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FjMrzFAps1/5DI6E1pJhCseVkyrxWMsgaCpQLqNIzZo=; b=X/lJrsnyGUlY+3ZKYTovXIRlEOXIlO0BbAxuTC2XCUZpJnzqXKrsS2GCGP0IhlXOAhKAiu oiwZfApTT/xFHuuzPnxJQgKY5Kh2Z1QxB3jS6HO6iRyjdkV/3NYEmzQ4wyD+Icj9kGDe8u gtvnYBEXAGeM7n3fA2UC5QVilkHxFKnkcSnZY6zOx2avdWaXdkcxx5L5Q09QGWUY8q/iWC k3LhnrcE5UnTtOVQCN1s2OSIWc4b9J8OiOz4mHdw5QNHBDeZ9pXO6TSPH0Ai/mTx50wbMI VqmcEIFzIhGSpJTiBs+D/Ctt02iYnf0P0yHVlrFvxxD3cOLcGRVw907SrPE85A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715995540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FjMrzFAps1/5DI6E1pJhCseVkyrxWMsgaCpQLqNIzZo=; b=wUEZICMmJ76CMNcDJx/e17MYOhK/Gvz4w8qhTeWQSUQ7Qc9RZjjor5fKQ1sxKJ55p9VQRy ojcQhCMjl0shB6CA== To: Costa Shulyupin , longman@redhat.com, pauld@redhat.com, juri.lelli@redhat.com, prarit@redhat.com, vschneid@redhat.com, Anna-Maria Behnsen , Frederic Weisbecker , Zefan Li , Tejun Heo , Johannes Weiner , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Petr Mladek , Andrew Morton , Masahiro Yamada , Randy Dunlap , Yoann Congal , "Gustavo A. R. Silva" , Nhat Pham , Costa Shulyupin , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v1 4/7] sched/isolation: Adjust affinity of managed irqs according to change of housekeeping cpumask In-Reply-To: <87wmnrj4uz.ffs@tglx> References: <20240516190437.3545310-1-costa.shul@redhat.com> <20240516190437.3545310-5-costa.shul@redhat.com> <87wmnrj4uz.ffs@tglx> Date: Sat, 18 May 2024 03:25:40 +0200 Message-ID: <87seyfj4h7.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 Costa! On Sat, May 18 2024 at 03:17, Thomas Gleixner wrote: > Impressive... Now let's take a step back because none of this makes any sense at all conceptually. Reconfiguring the housekeeping CPUs on a life system is expensive and a slow path operation no matter what. So why inflicting all of this nonsense to the kernel instead of cleverly (ab)using CPU hotplug for it in user space: for_each_cpu(cpu, new_house_keeping_mask) { if (cpu_ishk(cpu)) continue; cpu_offline(cpu); set_cpu_in_hkmask(cpu); cpu_online(cpu); } for_each_cpu(cpu, new_isolated_mask) { if (!cpu_ishk(cpu)) continue; cpu_offline(cpu); clear_cpu_in_hkmask(cpu); cpu_online(cpu); } Or something like that. You get the idea, right? IOW, the only kernel change which is required to achieve your goal is to ensure that changing the housekeeping/isolated property of a CPU at runtime is only possible when the CPU is "offline". Then all of the magic things you try to solve just work out of the box because the existing and well exercised hotplug code takes care of it already, no? I might be missing something obvious as always, so feel free to educate me on it. Thanks, tglx