Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1612716pxb; Fri, 10 Sep 2021 09:40:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz38TRLfJ5zlaPyQpGq/5jDsCS3kYkz0f86+2AhfvFK0Afrv4IS8GaFQfHWxz1cXUVu3n5 X-Received: by 2002:aa7:d710:: with SMTP id t16mr9733355edq.42.1631292002514; Fri, 10 Sep 2021 09:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631292002; cv=none; d=google.com; s=arc-20160816; b=C6lCKjwHbotMwIxPNWHoqMBTHeIuJ7E3QmnTkvyA5JWUgPSAnGF4D919Z6oAPMqlSj Q1Kv+2hJw/ZXkXrn4hISAQVam5SdOKrYgBge3Kg4l1Jemh1n5GsUpnqXc6lVIR8XO73C Uuq0lf+9r7Dp1nLqyD9A690LRpQfCuNCwWEr7qJ6owywAufO0X6d2LWs77m6HZzcnAjt 97VEcWTXsTxB9gZP64IspoTbSN5jnqg4UkAXRD7Gq04eR90WtJZOZD5bJdoOQtoGfIQu PWZPeeTZEoUh/LIlVN4Ke6+TfffRR1PllHrmMeOaJ6xCUFR93BI4lKF+vH+nuwZkX9VJ EDtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=0CAdzkTXaTtsnhj1wGgFOSI+YlIYEhF5ZYiGUnrefr0=; b=iwzjoH0v/5No4f14tmHBa895Z+gysZnqTfZE7P9ys+/5u56yEUe6k12WTqGYCOVmo3 quzJJhDe2nu3/BjyvvrkkTh9eRcjQn+7444w8QkigjV3/4EFHNBMX4WvOGno/j0Mixj3 buiVxo2SYJRQc8JbaiDWxCV/uFXZLAz60moCajQT3Tcg7sr5erxm14Ba65ekD+mAF4Pb qhto1mFvBDBudQgeF1kORyGF3GCvo4j1wGZnBVnIEkc4UUKp5zsrz3FiSqwrKhYtb55P dUYZHHmuj3d262KFMkOh05GUG6ieAtnIZoYWNeRFT30+lUa81kTTetgKu6HptsILmgP4 EfoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WJ0fC2G8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u61si5838583edc.479.2021.09.10.09.39.38; Fri, 10 Sep 2021 09:40:02 -0700 (PDT) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WJ0fC2G8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbhIJQjL (ORCPT + 99 others); Fri, 10 Sep 2021 12:39:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40074 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229466AbhIJQjJ (ORCPT ); Fri, 10 Sep 2021 12:39:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631291878; 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: in-reply-to:in-reply-to:references:references; bh=0CAdzkTXaTtsnhj1wGgFOSI+YlIYEhF5ZYiGUnrefr0=; b=WJ0fC2G8edjNc9fSKXvZa8PoElDMgSi4MQkMiD1uVl92O3Aq7TLNdFcRsCWcaeVsEVWu6u HqBUfau4VyCDl0L/K04b+lqLHAu0ZFN2sXjDaiWXoxakTrCwDX0b7apHrvPFtvjr0GjeAk pigMg6Xr8SswTq1ftQ+cYARa2gtwasY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-wpfwJVvDPaaA7XFsknzfvg-1; Fri, 10 Sep 2021 12:37:55 -0400 X-MC-Unique: wpfwJVvDPaaA7XFsknzfvg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 867781B18BC0; Fri, 10 Sep 2021 16:37:53 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.195.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC61919C79; Fri, 10 Sep 2021 16:37:50 +0000 (UTC) From: Florian Weimer To: Peter Oskolkov Cc: Prakash Sangappa , Linux Kernel Mailing List , linux-api , Ingo Molnar , Paul Turner , Jann Horn , Peter Oskolkov , Vincenzo Frascino , Mathieu Desnoyers Subject: Re: Fwd: [RESEND RFC PATCH 0/3] Provide fast access to thread specific data References: <1631147036-13597-1-git-send-email-prakash.sangappa@oracle.com> Date: Fri, 10 Sep 2021 18:37:49 +0200 In-Reply-To: (Peter Oskolkov's message of "Fri, 10 Sep 2021 08:18:10 -0700") Message-ID: <8735qcgzdu.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Oskolkov: > In short, due to the need to read/write to the userspace from > non-sleepable contexts in the kernel it seems that we need to have some > form of per task/thread kernel/userspace shared memory that is pinned, > similar to what your sys_task_getshared does. In glibc, we'd also like to have this for PID and TID. Eventually, rt_sigprocmask without kernel roundtrip in most cases would be very nice as well. For performance and simplicity in userspace, it would be best if the memory region could be at the same offset from the TCB for all threads. For KTLS, the idea was that the auxiliary vector would contain size and alignment of the KTLS. Userspace would reserve that memory, register it with the kernel like rseq (or the robust list pointers), and pass its address to the vDSO functions that need them. The last part ensures that the vDSO functions do not need non-global data to determine the offset from the TCB. Registration is still needed for the caches. I think previous discussions (in the KTLS and rseq context) did not have the pinning constraint. Thanks, Florian