Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4311745pxj; Tue, 8 Jun 2021 11:11:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFz9WW1BMvq5u9Bp4SeGpsZEmyIC0qqjX9LQY/lnrkgEoIsTrimm5L/qG6vgg85g//krcP X-Received: by 2002:aa7:c619:: with SMTP id h25mr26626488edq.388.1623175911875; Tue, 08 Jun 2021 11:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623175911; cv=none; d=google.com; s=arc-20160816; b=IJNaTbcr0VaB0tU6d5ctxzeSIjBvJlh7NFmdQOwaxd3VXtIhZs7JaUZ9STpIKt6exS bH2hqngQOueVHkKvl6Ej5hpfAZR6grw/31yzuN215ZzM/O47yIuDNZxkSoQ9MOv4gdv8 2o9gvqpXyWLmjs0IBow53YEME9ydZkGv3wMCxey5qgAZBYJa/9wwC5f8y6s5SG1Wljp5 WPq4hxl0DfzCKGlf0IdwPEd8FtXVBtRn1ITchRJxSAMWd8FF3Tlz6B9iWAqThAtNnQWM wbtyWiqmtDt3A0v1563BXu6RM8RhsMkA25Aq0lhqP2AqMYGBwCx2yNOn3Xlblo9GQz4s B7iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=SzY5mAzb8iAAncNXCHh5zNAEVzbO39nRlIsEjy7/kj4=; b=eFKOKxE+p05btVqt69CFY/CaQzpbKot9SusXi+OevZjoKOwXzrSxDhsl7qOkrQdRgK mZNOTuxPv7umPEy++98zmdJK/seTyap7csc4b+V4hZ6Oq5+o98eL2GHYfDiWVWF33vYZ wgs1J82MtkAm18EU4GKaASnNVR/a2f92qOqyPoFFmfMCSNw3uECK0qg5IbunSKxFfAUu OPEuanB8zH0jFwojRosP0lHwAZ//CDsF7zhwjAhTh+Bb3qbe/Zu4mJMGhxUU+svnCgQ8 xgO62rW/sK/gTmbnPHem2MDg4/CvPmxfkyMKbzfsgMLPUwp01ceTaJiXpf+jmgt1l3Ys FZgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yP1M9TwV; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si301548edq.422.2021.06.08.11.11.28; Tue, 08 Jun 2021 11:11:51 -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=@linaro.org header.s=google header.b=yP1M9TwV; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233651AbhFHSLD (ORCPT + 99 others); Tue, 8 Jun 2021 14:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234052AbhFHSLC (ORCPT ); Tue, 8 Jun 2021 14:11:02 -0400 Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 473B1C061787 for ; Tue, 8 Jun 2021 11:08:53 -0700 (PDT) Received: by mail-qv1-xf2b.google.com with SMTP id w9so11278331qvi.13 for ; Tue, 08 Jun 2021 11:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=SzY5mAzb8iAAncNXCHh5zNAEVzbO39nRlIsEjy7/kj4=; b=yP1M9TwVufAhZhzjKMz4aXj5vc2/bthnQJnbC+4WdSfV+iBjkqH4wKJpiecqQ/eP8g hBDLDWr0z6h+d218Lmsm1mjnb8XAh/r5jZhaHZYTv447YW5yFi8n0fl/p8XWGpr4U6tb ym/nrKyOaJQcyxf1gk8nwJBCsTm8hr4GauoWtyKAVkx/pJGSe1P1h966OMxnD+OJp1V0 7nG9F97aKotXZ+nrrp4yfZ6Trq/o0rJwmlZs+WtiRFHjDu3kxnLxw9A3XxG3/IKQc/xO 1ctEGT0Yjl99/hnPpVyeM3+yfa9oQMUgpW3Cb8elFblEIYuU7fw6dO9OQwr5dhYA+M3R Hz8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SzY5mAzb8iAAncNXCHh5zNAEVzbO39nRlIsEjy7/kj4=; b=mHVGigFhKU9U5TTcFLjtznBmF5bZ9BLo1EIpwQFcDK7UGXnH8I95aNXvNKyTdTxAmf PTkeho7ZA8aGAi6o7Q+6gFYkyArMjzTjVHGt3IOmJoB68bXk02zdHSna3GQ57ISUGG7l MC13yZAE+KZp8nmz0wZjK8EKPqOHFJAvNDDfKMj4jEEUKzYNTe7WLepMMHrvtDHYYRzb prPy2hqfZ7OzBqKHP0JoYE87JdNrjJB3Mh0DMc9qehuBjy3G5CWv0IpDF5cxM7MvWJGX X3eZwmnu8qbbnMsH39DICFeY+HENpCAQpkkf9P7TUBBA7GS4+2QoVSJXTCtNp3JWxA0Q iYeg== X-Gm-Message-State: AOAM531EP1UA+wCOfI27pjopEt1uJu56q3JTW0lEjmZAmnJoUhMv1MGM jN6ypWYb0YtZJdt7ISRMecvGlQ== X-Received: by 2002:a05:6214:d41:: with SMTP id 1mr1468950qvr.6.1623175732347; Tue, 08 Jun 2021 11:08:52 -0700 (PDT) Received: from [192.168.1.4] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id h12sm11987725qkj.52.2021.06.08.11.08.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Jun 2021 11:08:52 -0700 (PDT) Subject: Re: [PATCH v4 00/15] Add futex2 syscalls To: Peter Zijlstra , Sebastian Andrzej Siewior Cc: linux-kselftest@vger.kernel.org, joel@joelfernandes.org, Andrey Semashev , kernel@collabora.com, shuah@kernel.org, Davidlohr Bueso , Peter Oskolkov , corbet@lwn.net, krisman@collabora.com, malteskarupke@fastmail.fm, Ingo Molnar , Darren Hart , acme@kernel.org, Steven Rostedt , =?UTF-8?Q?Andr=c3=a9_Almeida?= , Thomas Gleixner , fweimer@redhat.com, libc-alpha@sourceware.org, linux-api@vger.kernel.org, z.figura12@gmail.com, Nicholas Piggin , linux-kernel@vger.kernel.org, pgriffais@valvesoftware.com References: <20210603195924.361327-1-andrealmeid@collabora.com> <1622799088.hsuspipe84.astroid@bobo.none> <1622853816.mokf23xgnt.astroid@bobo.none> <22137ccd-c5e6-9fcc-a176-789558e9ab1e@collabora.com> <20210608122622.oxf662ruaawrtyrd@linutronix.de> From: Adhemerval Zanella Message-ID: <74c7f1c1-ca15-1e86-a988-a4d349ad16ef@linaro.org> Date: Tue, 8 Jun 2021 15:08:44 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > All the attempts with API extensions didn't go well because glibc did > not want to change a bit. This starts with a mutex that has a static > initializer which has to work (I don't remember why the first > pthread_mutex_lock() could not fail with -ENOMEM but there was > something) and ends with glibc's struct mutex which is full and has no > room for additional data storage. Yes, we have binary compatibility constraints that prevents us to simply broken old binaries. This is quite true for static initialization, which imposes even harder constraints, different than the pthread_mutex_t size where we can workaround with symbols versioning. But even then we hear from users that out pthread_mutex_t is still way larger, specially for fine grained locking so I am not sure if we do want to extend it. > That said; if we're going to do the whole futex-vector thing, we really > do need a new interface, because the futex multiplex monster is about to > crumble (see the fun wrt timeouts for example). > > And if we're going to do a new interface, we ought to make one that can > solve all these problems. Now, ideally glibc will bring forth some > opinions, but if they don't want to play, we'll go back to the good old > days of non-standard locking libraries.. we're halfway there already due > to glibc not wanting to break with POSIX were we know POSIX was just > dead wrong broken. > > See: https://github.com/dvhart/librtpi You are right, we don't really want to break POSIX requirements in this regard because users constantly come with scenarios where they do expect our implementation to be conformant [1]. And even now, there are case we don't get it fully right [2] and it is really hard to fix such issues. If I recall correctly from a recent plumber couple of years ago about the librtpi, the presents stated their implement do not follow POSIX standard by design. It suits then for their required work, but it is not what we really aim for glibc. We *might* try to provide as an extension, but even then I am not if it would be fully possible due API constraints. So, regarding the futex2 we might try to support it eventually; but if this newer interface is not a really a superset of futex1 we won't put much effort. Supporting newer syscall requires an extra effort from glibc, we need to keep fallback for older ones in case the kernel is too old and it also imposes runtime costs. Also currently we don't have a specific usage. The proposed patch to add the 'pthread_mutex_lock_any' and 'pthreada_timedlock_any' [3] also did not gave much detail in realword usages or how it can be leveraged. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=13165 [2] https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [3] https://sourceware.org/pipermail/libc-alpha/2019-July/105422.html