Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp24448rbe; Wed, 28 Feb 2024 10:52:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXT1kE7xoxJEFXHbnQ3hY6csf5KwxocTDN+w/ZcIMFSGrZcBSZizIX4XgiC9S5V322lZNAd40bnl68UOPqC8tuw3MXo9bLj4+KYU6zFEQ== X-Google-Smtp-Source: AGHT+IHDNvRcVj7rMFM8FdisZXNlQ/ryE/6FoNh4PeX9QHXf0cmpQJRml2cgCKmgMgcht0L8NweH X-Received: by 2002:aa7:de11:0:b0:566:16e4:b6b3 with SMTP id h17-20020aa7de11000000b0056616e4b6b3mr179511edv.36.1709146345905; Wed, 28 Feb 2024 10:52:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709146345; cv=pass; d=google.com; s=arc-20160816; b=po6uvy85paVpZN7GK8YsiOd8yMA6ly4yZCIodfpuOIBgp2KU0OkV9pLQfgWUMqz/Za nCTGxlkRqHYwEdKiAwoDRUXgBOBSbxfAd1m3ZnOY+qmH3p6noJiGJ3pbITL0Bfi1ul9m fvcNZVhhDBDd/9t35KBJrr3DSH9uLBzpT0uEnPEaKQajcRWnaQqSFzATPw9YcA7ct0au TJiEQ72D55hkvA8Dp9Pvvrv5YUanQ3rbh7cOyBJJmsAfeb/sVpF0mArbsdLStY9Fr9BZ Mi9MEnMWJiBVg4jqTHLarulkcCSGt+0mZ0ULklvTQxBOY8wI6nV+RPxS1E5rqPJB53/o 54+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=Zzx4HJfLML4JQaG7fROeK+a0qZNaeaLXumU4hcnOH5U=; fh=LAAb95JEWZbsPeASLj+GCIcaYNRLX0VjhN1YOmSa0Vs=; b=HWzu5dQ77wm7fkQxKFOoXuDaCeKXnwiZ7XXYfxJqGzcvAAKynuZPDJBrZmS7CbGOiS zxA9b0lT8dvUqqmpThj1P0+ktosDlECcpyVboKILoYW0L9hWTqPFuVJNeX4XLiR91RRr 52qT0zsWCNdlPJ8oqoGttULT1OLEj2M0oJhqiFfTSBt7iCvNSmzZR/qRq3KObJLd1XU/ MriHQXyqNhBNJiRXQNA843+e5b2YMCDNqYUakKfTbNJd5V1dGxS7nj8N6DGAEKgdCGHk m02EsFS2Bo53URpyXUytluwG7rAJCQWVA7RcccT8Kp+RiNPTWZXsyaeQzSTSq9DgPJ8o hfvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Jz8yh18x; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o30-20020a509b1e000000b005664ee61abbsi1299971edi.610.2024.02.28.10.52.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 10:52:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Jz8yh18x; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 133051F207C2 for ; Wed, 28 Feb 2024 18:51:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CD5D71ED9; Wed, 28 Feb 2024 18:50:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Jz8yh18x" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 4F9D971EB3 for ; Wed, 28 Feb 2024 18:50:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709146245; cv=none; b=Gli1a/y4dd3rTh0epKKWVbrU7sQ62gDJGbQb9zPJay08NFCxtP6XPI5QHsr69s0E5VJj/JS+R9Sl+MMe9qxEEBvvuNM40YGsESK+dSN8qztM1xeX7SzxKbcbLYet1svrprfwVmnJIRI7pfxCaUyiEkItCrOzEwZwPzSYCpW1H6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709146245; c=relaxed/simple; bh=uCNk9xZssjz88SO3HgKmg/6pNPAs4j9cZ22qRa/0FUk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d2pvOsw2ysYKOG7M9GrlmBlXXMCSqFojO7RESjOFcNtMv0bf700Z1ciC69AK63SPqTfp8etwyuktJshSUy5zj3TNi7tEdvqcg6cDiruw2j26ZgL/SnK5AuxfsytAG0Q4XpPXtY5hHC2C2iWDr7jftOD7FtUvODZ6TqJgIry8C8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Jz8yh18x; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-412a3ebad2aso523695e9.1 for ; Wed, 28 Feb 2024 10:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709146243; x=1709751043; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Zzx4HJfLML4JQaG7fROeK+a0qZNaeaLXumU4hcnOH5U=; b=Jz8yh18xpafJEnQQlffADR/JWLGW90uMfpbJK/V8qPEbJflGfIZ8msGjAds/C4hFOZ hu6ikyWwAojPdrBeIjOhh4i2zzH3AQz8QXm36XuNgKBQ+P432WmD2Rf2DV9NyoxSidun vaNUfc9ElXoq92QN5dQzELXifRLmvt6zoDSFLNbSAmOVJKHHZ4S6sRGAFutDRiDDHoXV DW2Zq24Q+IfvGra77G9IDtsqHL84elno7uuxeoVc80LeynNO/Fzzo9SKCQUrETulwEN7 vwpxgWGTrq5yoNBIq5sxL/RXKAIRVbZb9YUEFBJOBCYPuoIz43jnL7FxY5zmjcC44LdF 5wNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709146243; x=1709751043; h=user-agent:in-reply-to: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=Zzx4HJfLML4JQaG7fROeK+a0qZNaeaLXumU4hcnOH5U=; b=TWooc5+kadGfG2YgOxfb99W0fJWyIB+4wiZZOpf+Zlkqa/BFtHTRMwwn5hjRilYKa6 GazFphy5HTfuwGqUL6755DTtnacIVze7vSjU9kb4LUfX9z0RMi2roqmBSBGazsJ7okWv Egdd7XkyXFx8qMvMMfxHgiON3A3rRJHOlqRZy7hGOHZhTPWq+8GiUWtn79kjBRt9PcEh bcK4Oxa+RjP0kcN5Rrq4yX9N3lGLb1U/+qpPCNdZqXpmOIKYkt+LixeA2rXWA07qXyOw 0JZ86Hjim+CfRWKslG4RQHvA3oBNbTtHw/7cRqQ88SGMHiJXVj4rM9P+cpXzTXsIdyU6 RyRQ== X-Forwarded-Encrypted: i=1; AJvYcCWz7Zi5k49TVhSWdYiSmk3ykl1gZVtplQ0dyy1LkElEHTASu9VZ6CvagtrlA/TOj5nyGDDFYay0Q9gOmdp0lNV5fXoQU9CCYMnaqR98 X-Gm-Message-State: AOJu0YxMSwK4A2DmnXEidLsDagqQWja7LGkQNavossG22OnTSLYlplBu a1Pbt/oBfr3V5tpead7haxTu1+ulg8rnp2vQttezBUrf36gtCb08oG6HRK0wNw== X-Received: by 2002:a05:600c:468c:b0:410:85ab:67f3 with SMTP id p12-20020a05600c468c00b0041085ab67f3mr81884wmo.21.1709146242594; Wed, 28 Feb 2024 10:50:42 -0800 (PST) Received: from elver.google.com ([2a00:79e0:9c:201:e9d0:d027:ced7:cf52]) by smtp.gmail.com with ESMTPSA id l36-20020a05600c1d2400b00412aff7874esm2890521wms.48.2024.02.28.10.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 10:50:41 -0800 (PST) Date: Wed, 28 Feb 2024 19:50:36 +0100 From: Marco Elver To: Mathieu Desnoyers Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Thomas Gleixner , "Paul E . McKenney" , Boqun Feng , "H . Peter Anvin" , Paul Turner , linux-api@vger.kernel.org, Christian Brauner , Florian Weimer , David.Laight@aculab.com, carlos@redhat.com, Peter Oskolkov , Alexander Mikhalitsyn , Chris Kennelly , dvyukov@google.com Subject: Re: [PATCH 00/30] RSEQ node id and mm concurrency id extensions Message-ID: References: <20221122203932.231377-1-mathieu.desnoyers@efficios.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=us-ascii Content-Disposition: inline In-Reply-To: <20221122203932.231377-1-mathieu.desnoyers@efficios.com> User-Agent: Mutt/2.2.12 (2023-09-09) Hi Mathieu, all, On Tue, Nov 22, 2022 at 03:39PM -0500, Mathieu Desnoyers wrote: > Extend the rseq ABI to expose NUMA node ID, mm_cid, and mm_numa_cid > fields. > > The NUMA node ID field allows implementing a faster getcpu(2) in libc. > > The per-memory-map concurrency id (mm_cid) [1] allows ideal scaling > (down or up) of user-space per-cpu data structures. The concurrency ids > allocated within a memory map are tracked by the scheduler, which takes > into account the number of concurrently running threads, thus implicitly > considering the number of threads, the cpu affinity, the cpusets > applying to those threads, and the number of logical cores on the > system. > > The NUMA-aware concurrency id (mm_numa_cid) is similar to the mm_cid, > except that it keeps track of the NUMA node ids with which each cid has > been associated. On NUMA systems, when a NUMA-aware concurrency ID is > observed by user-space to be associated with a NUMA node, it is > guaranteed to never change NUMA node unless a kernel-level NUMA > configuration change happens. This is useful for NUMA-aware per-cpu data > structures running in environments where a process or a set of processes > belonging to cpuset are pinned to a set of cores which belong to a > subset of the system's NUMA nodes. [...] Just out of curiosity: is anyone aware of any libraries that have started using CIDs? It looks like the cost of CID assignment is always paid (even though it should be small), I'm trying to understand if after 1.5 years there are common libraries that have started using it and what their exact usecase is. I'm aware that TCMalloc was the inspiration for vCPUs [1], then renamed to CIDs, but am wondering if other users are out there. Thanks, -- Marco [1] https://lore.kernel.org/lkml/20220218210633.23345-10-mathieu.desnoyers@efficios.com/