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 1298C264A76 for ; Wed, 15 Oct 2025 14:28:39 +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=1760538521; cv=none; b=i1cZoEugaOjs3bvTWEZzY7MC2O1oMmKYNWHRWSJTcEhYiY/IpwZfElmAplQrti4BmtfsOHWUX6KG2HYzCZ6Vqt6EkXolMcPLbHPUOBuZP1SPUihDgoTBkDR4pYGupbNDBAJMyo1opZYcCB2rmJOyFJyRUBCluux+B43F+gYSu1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760538521; c=relaxed/simple; bh=nBrrzUIIz7EqduMmfNBSq6j0Y+9SBVBrG4CM+HpME4g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: In-Reply-To:Content-Type:Content-Disposition; b=PVjz8dVK4w2vp//NeRg0CTbOt20EPSPEhhBxXqgJdezVpQQDgE5BKva/7frsvY9qPEh9X1YJpOG/afKyM4ozdKdh5wAAo+j0yTr2IhaxHW8pMDMAU5XTAm+2HHfOVEbjcR1HwY2eBFLTdXkWtJzSlaZ2nApDkP6KEhovWacQrPQ= 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=EfbcsJpJ; 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="EfbcsJpJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760538519; 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=jgeXfG5LCk279qOJi22HRVqctybfIOuy71nuUr9PHL0=; b=EfbcsJpJ6cnKwhLjlng/eoHGa/Nc5llZURJPOX6HITedcF7h/YL3kzq2UnWCeha0B6BFE8 C+UqqHFD0CpGyOUgwG428ZeTyZLFol8Ay7DNW7A0qr/fASx8TnCLAs1qHPeLcpRYdowN8L YR+D43t+ocZYZ/StljT59xcA64NPlmk= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-YF2DbkW_O5SdW8kjGVDDkg-1; Wed, 15 Oct 2025 10:28:37 -0400 X-MC-Unique: YF2DbkW_O5SdW8kjGVDDkg-1 X-Mimecast-MFC-AGG-ID: YF2DbkW_O5SdW8kjGVDDkg_1760538517 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-46e25f5ed85so51613125e9.3 for ; Wed, 15 Oct 2025 07:28:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760538516; x=1761143316; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jgeXfG5LCk279qOJi22HRVqctybfIOuy71nuUr9PHL0=; b=ca2gkjYM7U7Nu/G5amoSJxEm6tSoTWGnWc0FrfmBvbhVD+z1lVCwp4kHm0WFddQwbt ocJW9sx+GSyFpSSqFDQmI4mByE2mgY2B/FujYRtHzKsbY7K/n1P0opBufkHszP9ap7cU WMtSBJN/qM3yQV0m2Is8Ro0IA4dpZc1oeTIneFSp67izs0h/m3JVhK7zXWIl/093LEv+ XLaxc3s1xABrVieGBCHZ12GHKLEuNKublKEYnEXfMq6+M4Jow3mk7QAXlDVPHD5iWmkC qOYjXCt7uFtdpT74lMtRhjvXgB6nY1Fuv3hm8pq4fJ0SBOocOglpTFqGd3Cf5UV6XpXn mR/g== X-Forwarded-Encrypted: i=1; AJvYcCWCVL8sJUTsXrbizUCfqVmOG3GHkGrALbjfkR6B+DgSUIWE9yCQpiak8DYzxwhb0F//zKX2yIAd7wY=@lists.linux.dev X-Gm-Message-State: AOJu0Yz2ZQ/uhN5+CNtJgZb1bCpX7/Skg8DVZxLRjRTRGePOcmQ3eruy lPDvA31Vi5anKUC+68kD6tDEIth/1JGFftvrn0nMS16BaMONSOGHadS8wObL+fvBgb1Tz50p9OJ 4KN6NWxb0fLbr2mlv+J4/wmJMuaVOHhiz4aXZ+YUPPliuijpgW/rnuxLSN8qlhQ== X-Gm-Gg: ASbGncthbIZPWP2p1iFxG+6llEAXawojW6oXCEi+9qboanIfQ72e/z2R++uAUz7Yjkv hvsik5J6iLdHh8iLuWBVRFWa27BQuKMYVMUucahkbqiiKhHpWxJ/UG9r0xu4MFlmVAn0eK/8BaY TaTWQ0mHrmiqgj+GlHeEG+w/Ak+Y9OFeYv/BlhcNZBbEDNelhK3DUzeGkVV+cdlVcUfMiLfV+OA RfeurZ7lnVQ7V4YXLY1VgBS9MLVsx92hMQsKNYnIO4vUDruL+zHyVwQJ+R4ICCCKksgDqd06Veq r2JyoIark+bjNgSUKXZRKc8ctG6MxMpdU0vN4bw+8/3aO1spRZNVYf+SfqGuYZCFEXUFhCnn X-Received: by 2002:a05:600d:4346:b0:471:9b5:6fd3 with SMTP id 5b1f17b1804b1-47109b57585mr1427495e9.0.1760538516630; Wed, 15 Oct 2025 07:28:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzbrALSQ0Dm6MxbRBonwa/fKtFwvctLkCr56cdjw1iTmex8obFsv5mNCQ28ZCIBWNfB2voXw== X-Received: by 2002:a05:600d:4346:b0:471:9b5:6fd3 with SMTP id 5b1f17b1804b1-47109b57585mr1426975e9.0.1760538516058; Wed, 15 Oct 2025 07:28:36 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([176.206.13.103]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47101be0c5bsm48687275e9.1.2025.10.15.07.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 07:28:35 -0700 (PDT) Date: Wed, 15 Oct 2025 16:28:32 +0200 From: Juri Lelli To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, rcu@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Arnaldo Carvalho de Melo , Josh Poimboeuf , Paolo Bonzini , Arnd Bergmann , Frederic Weisbecker , "Paul E. McKenney" , Jason Baron , Steven Rostedt , Ard Biesheuvel , Sami Tolvanen , "David S. Miller" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Mathieu Desnoyers , Mel Gorman , Andrew Morton , Masahiro Yamada , Han Shen , Rik van Riel , Jann Horn , Dan Carpenter , Oleg Nesterov , Clark Williams , Yair Podemsky , Marcelo Tosatti , Daniel Wagner , Petr Tesarik Subject: Re: [PATCH v6 00/29] context_tracking,x86: Defer some IPIs until a user->kernel transition Message-ID: References: <20251010153839.151763-1-vschneid@redhat.com> Precedence: bulk X-Mailing-List: loongarch@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6YxukdOiGOsbs2xr9cUYqpHInEE5GVuCQ4D8AA4yOeE_1760538517 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 15/10/25 15:16, Valentin Schneider wrote: > On 14/10/25 17:26, Valentin Schneider wrote: > > On 14/10/25 14:58, Juri Lelli wrote: > >>> Noise > >>> +++++ > >>> > >>> Xeon E5-2699 system with SMToff, NOHZ_FULL, isolated CPUs. > >>> RHEL10 userspace. > >>> > >>> Workload is using rteval (kernel compilation + hackbench) on housekeeping CPUs > >>> and a dummy stay-in-userspace loop on the isolated CPUs. The main invocation is: > >>> > >>> $ trace-cmd record -e "ipi_send_cpumask" -f "cpumask & CPUS{$ISOL_CPUS}" \ > >>> -e "ipi_send_cpu" -f "cpu & CPUS{$ISOL_CPUS}" \ > >>> rteval --onlyload --loads-cpulist=$HK_CPUS \ > >>> --hackbench-runlowmem=True --duration=$DURATION > >>> > >>> This only records IPIs sent to isolated CPUs, so any event there is interference > >>> (with a bit of fuzz at the start/end of the workload when spawning the > >>> processes). All tests were done with a duration of 6 hours. > >>> > >>> v6.17 > >>> o ~5400 IPIs received, so about ~200 interfering IPI per isolated CPU > >>> o About one interfering IPI just shy of every 2 minutes > >>> > >>> v6.17 + patches > >>> o Zilch! > >> > >> Nice. :) > >> > >> About performance, can we assume housekeeping CPUs are not affected by > >> the change (they don't seem to use the trick anyway) or do we want/need > >> to collect some numbers on them as well just in case (maybe more > >> throughput oriented)? > >> > > > > So for the text_poke IPI yes, because this is all done through > > context_tracking which doesn't imply housekeeping CPUs. > > > > For the TLB flush faff the HK CPUs get two extra writes per kernel entry > > cycle (one at entry and one at exit, for that stupid signal) which I expect > > to be noticeable but small-ish. I can definitely go and measure that. > > > > On that same Xeon E5-2699 system with the same tuning, the average time > taken for 300M gettid syscalls on housekeeping CPUs is > v6.17: 698.64ns ± 2.35ns > v6.17 + series: 702.60ns ± 3.43ns > > So noticeable (~.6% worse) but not horrible? Yeah, seems reasonable. Thanks for collecting numbers!