Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp903840pxb; Tue, 1 Feb 2022 12:50:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxWlFKtH6E1bpjGQ7G5F1DDHo7X4YNh3gLaLbkDgs0HyoCwpvzm32VZ4HUuA9Ko4sue6Oc X-Received: by 2002:a17:90b:2252:: with SMTP id hk18mr4417839pjb.183.1643748637157; Tue, 01 Feb 2022 12:50:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748637; cv=none; d=google.com; s=arc-20160816; b=zs1q0evMc6DOm61pC76nNT40PezpcQfoK31p8nfjhRiF/8sme0HPDiTKyB6Kd9M7HT Fyj60ZFx9H9KSIzpBcbAdkuP2PIbnfhp36IAD2ao+ElDh5LPpVkb6sR+Xj5Or3zp0s03 vjI+IQJ+lB7/deRgNOxdKUqcK4YNj6Xt59PPEv20IO8y3NYgn+RGWOEGBG5Bmh1xPZoY F99kj6RN7JlQtZzVdlpaCw8Z1cV7jcxZv58SS07VSi1331hOG5ffWFqar4NOL44FLBbk A1ft6u/vSibCB12Z/CwGn30T7weuRiURgNNum4/SQ5lylkw6v3BqiwjRQaKq3ivAIDBL mnTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from; bh=NSXvnZ0R6avf38CrVZG6V2T9ZVAHvZyhLViQLoWaH3c=; b=ew1v1reMm4nwf+hIGrCz3bLbUugsYseY11TpXdexy+9d0MlfRo1AdNw0WQmgBWljx2 pxJvkAFPXWjMA6qLpPVjA3EF24BUDZLekl6G+Ndd8dF5ZgjXLBTUtg8DPxWGf+18MqNR I9dSUZhkKL3SVFxz9/oN4eJl4ao3SL2A7d3fHDdL/RLQ40zi70UKIt2md7jenYgvdh8C yW/2cFg+yWTsY9QKX9h2A5bYPJ2wV1DZQImEQOGSyO/llhP1Pb7X2UaFcBtGQt/vnFkI g/QMmvtzok9CMYIivxZSIwCA2tYzK5VkvPstzcm/u+Sf6+ERQhU7qXdKxtYdJxXu7nvf PZ8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si19499727pgq.34.2022.02.01.12.50.25; Tue, 01 Feb 2022 12:50:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380107AbiAaVTR (ORCPT + 99 others); Mon, 31 Jan 2022 16:19:17 -0500 Received: from albireo.enyo.de ([37.24.231.21]:33272 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241083AbiAaVTQ (ORCPT ); Mon, 31 Jan 2022 16:19:16 -0500 Received: from [172.17.203.2] (port=40553 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1nEe4r-00CoZr-Hd; Mon, 31 Jan 2022 21:19:09 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1nEe4r-000tNN-6V; Mon, 31 Jan 2022 22:19:09 +0100 From: Florian Weimer 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 , David.Laight@ACULAB.COM, carlos@redhat.com, Peter Oskolkov Subject: Re: [RFC PATCH 1/2] rseq: extend struct rseq with numa node id References: <20220131205531.17873-1-mathieu.desnoyers@efficios.com> Date: Mon, 31 Jan 2022 22:19:09 +0100 In-Reply-To: <20220131205531.17873-1-mathieu.desnoyers@efficios.com> (Mathieu Desnoyers's message of "Mon, 31 Jan 2022 15:55:30 -0500") Message-ID: <8735l3k3hu.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathieu Desnoyers: > Adding the NUMA node id to struct rseq is a straightforward thing to do, > and a good way to figure out if anything in the user-space ecosystem > prevents extending struct rseq. > > This NUMA node id field allows memory allocators such as tcmalloc to > take advantage of fast access to the current NUMA node id to perform > NUMA-aware memory allocation. > > It is also useful for implementing NUMA-aware user-space mutexes. It can be used to implement getcpu purely in userspace, too. I had plan to hack this together with a node ID cache in TLS, which should offer pretty much the same functionality (except for weird CPU topology changes which alter the node ID of a previously used CPU). However, I do not understand the need for two fields here. Why isn't one enough? One field would also avoid the need to mess with rseq_cpu_id_state, maintaining API compatibility.