From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 216D934DB7C for ; Mon, 12 Jan 2026 12:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768222651; cv=none; b=j5JtQja+0UC6hthOLJ8mgJdeD+r7jpgEE+6WH2SCVTULQOzPRW6ef2grJH7C9LmzfzKyr/JpvP559/VYoZJ2Mn7F+zdRTyNvrt4YinRP79HMeYGBXlCH/Qd1I4lx41+5V0lyvGwiVWk03WRcLPgRuWkz1Wcckyo6mj5/hKtJ0/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768222651; c=relaxed/simple; bh=zFgm2vYxRqINt6erFcw86ykrENaWfXFz5MHspS0kE74=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UmpFmbTArN51JKBXA8Lu2p76KFgxTwADKMSq719aJjbhRQg4W93td4blAplqyh548LQg/iJSmyS0FFQk/TnawE7pAfVWaUBvCOJ0u9x0fEnLfr9ZcELVFmss4j0kpJ97uDuLhHdW0k6s1LZFsoMV/hDB+PLsMYDxwwPAF1WzseU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SBS6k30F; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SBS6k30F" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-598f8136a24so6868709e87.3 for ; Mon, 12 Jan 2026 04:57:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768222648; x=1768827448; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=k6W1vW7YyTZJ9RKKihBrvv7xY//2b0fVqhtiT/deWqY=; b=SBS6k30F++bLJ17BOh+Vj3D771m49I8FiZYzFVcH8gLI6byZ5JkaoA9aEr44QAUxY9 /1WarPsMVCMKFOF1e821Aw/CcZJ8PlhkFjC7rqrRl6l+WLLP3qs25LSkOEIZdVAshRur KTe12lm+oCCEK0bvxrqIHS0eKFYqzfzXwVt94gD7AuH9CUk0SKntzvQX0TUC9jpkRMTd J40BdVOpEj4n0LsetO6wPdK4er+mRAZLGXxH1dnIpnt3zpU1/FBM1EZWbjUHsz5Gv1++ s/jymKrnEJk9OqPVGw1QCHqqdqPu9cVcn/oKARGkuKyN7B16bkztWSEyWQdDvnF9FPNQ ff9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768222648; x=1768827448; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k6W1vW7YyTZJ9RKKihBrvv7xY//2b0fVqhtiT/deWqY=; b=ppG8JzWGPuRDfgV2sr8nv/pdiFdg9ux+CvJ8pFksK5MQmaaUAVnm+R6+WnjqwT0B/M 1hrl7POc9D2QZeoyuPQ0mi1dS6qeYHg8R5bDWSWXzKgbwqE5w+bgP3kR8W4NaZCEKRWb yrqmqxUN58U+TJjPClmtn0WBXsM3kTEgyGOogXqZTU/IxhoDhSNdqS6iu1wDdQJRZbth 9vZegBQ1BDym09aw7+1NOe7jx+DUM3NEoiMIaopLzCS5VeUxadE90B1Z1XeyTi1S/Qcc TMCIMsFaGqO8xgOFM7hxzpTufHAUl6DSvCjdLk1IJV70OHz9VYkFb/dGkqKekaOGUKnT VORA== X-Forwarded-Encrypted: i=1; AJvYcCX0KNR3tIDiG076AHOsxEGDKcFr9dVtt4CrdCYEeMvEpwKBbtAsWkXAroEW60i6fEOvQncLl6ccJV5GewQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2ASEDRGKsHnDb9m3kyT5QX0t2J0eKSr6kGfR+s/oUIaIHtnwc kHZ5UBO+gRtuqM88g1B7CVhaa3t+eykEFyD1UQ8CHK1gSjyMzF1dQDzl X-Gm-Gg: AY/fxX7pk5DpG0C9b/KA2kd2MH0f04NXI2M8QDydTzhLmsmPVA64kXmz419flW17s01 SZ9MelYV4cKFZGHqpgfW6synNl7+9Rr2TOn5EkJ/C5b7OmDd65NpUuSq09vOCHlqZtgSnD0Gnq2 JMei5x8+gb2Ndd74MI3Lo83iJLe0Up2Gnjr2Cauo4lj9Un1lVBCRFvY/1msVk8jX1EZR30uo8Pb yVA5+UVjMvMHjryfyVwX3qmeTyno/1PwaJwxteJoIBshZNB60Q1Zi5+gDmSmXMuvK6hc3L1Gqnq z9kRYOLT/4+Sf15ls3pd57i14ADYL3t5+Wbz2bPnvjdVI/Xrb+DmyIDlmVDhlKSdMSB+T4Btkzt mX7ENaGSBjQ1pnwSjPbtoBJSgy5nCYGQ39eWptDm5CClWGL3PuoK7 X-Google-Smtp-Source: AGHT+IE+OLIvkn24bosYYZh2o2pPxnXluGjI++O0ltbiPWNcj5MAbgA0rPYMFoHQjdAkDBAmvA4eIQ== X-Received: by 2002:a05:6512:3a8d:b0:59b:83fb:c6ba with SMTP id 2adb3069b0e04-59b83fbcfe6mr3325742e87.51.1768222647958; Mon, 12 Jan 2026 04:57:27 -0800 (PST) Received: from milan ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59b7100527asm4018348e87.37.2026.01.12.04.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jan 2026 04:57:27 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Mon, 12 Jan 2026 13:57:25 +0100 To: Shrikanth Hegde Cc: Uladzislau Rezki , Vishal Chourasia , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, frederic@kernel.org, neeraj.upadhyay@kernel.org, joelagnelf@nvidia.com, josh@joshtriplett.org, boqun.feng@gmail.com, rostedt@goodmis.org, tglx@linutronix.de, peterz@infradead.org, srikar@linux.ibm.com Subject: Re: [PATCH] cpuhp: Expedite synchronize_rcu during CPU hotplug operations Message-ID: References: <20260112094332.66006-2-vishalc@linux.ibm.com> <5a2b00f2-5e73-4c89-89b5-1a69cb8a7fa2@linux.ibm.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5a2b00f2-5e73-4c89-89b5-1a69cb8a7fa2@linux.ibm.com> Hello, Shrikanth! > > On 1/12/26 3:38 PM, Uladzislau Rezki wrote: > > On Mon, Jan 12, 2026 at 03:13:33PM +0530, Vishal Chourasia wrote: > > > Bulk CPU hotplug operations—such as switching SMT modes across all > > > cores—require hotplugging multiple CPUs in rapid succession. On large > > > systems, this process takes significant time, increasing as the number > > > of CPUs grows, leading to substantial delays on high-core-count > > > machines. Analysis [1] reveals that the majority of this time is spent > > > waiting for synchronize_rcu(). > > > > > > Expedite synchronize_rcu() during the hotplug path to accelerate the > > > operation. Since CPU hotplug is a user-initiated administrative task, > > > it should complete as quickly as possible. > > > > > > Performance data on a PPC64 system with 400 CPUs: > > > > > > + ppc64_cpu --smt=1 (SMT8 to SMT1) > > > Before: real 1m14.792s > > > After: real 0m03.205s # ~23x improvement > > > > > > + ppc64_cpu --smt=8 (SMT1 to SMT8) > > > Before: real 2m27.695s > > > After: real 0m02.510s # ~58x improvement > > > > > > Above numbers were collected on Linux 6.19.0-rc4-00310-g755bc1335e3b > > > > > > [1] https://lore.kernel.org/all/5f2ab8a44d685701fe36cdaa8042a1aef215d10d.camel@linux.vnet.ibm.com > > > > > Also you can try: echo 1 > /sys/module/rcutree/parameters/rcu_normal_wake_from_gp > > to speedup regular synchronize_rcu() call. But i am not saying that it would beat > > your "expedited switch" improvement. > > > > Hi Uladzislau. > > Had a discussion on this at LPC, having in kernel solution is likely > better than having it in userspace. > > - Having it in kernel would make it work across all archs. Why should > any user wait when one initiates the hotplug. > > - userspace tools are spread across such as chcpu, ppc64_cpu etc. > though internally most do "0/1 > /sys/devices/system/cpu/cpuN/online". > We will have to repeat the same in each tool. > > - There is already /sys/kernel/rcu_expedited which is better if at all > we need to fallback to userspace. > Sounds good to me. I agree it is better to bypass parameters. -- Uladzislau Rezki