Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp729913rwb; Tue, 4 Oct 2022 09:50:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6cXvdBePVVKYMr31AxwXXI2Lsnz1zrqEDdfWteQd/ZRGmyyUQdLSikroWyvRZUa4CGh05N X-Received: by 2002:aa7:c792:0:b0:453:98b7:213c with SMTP id n18-20020aa7c792000000b0045398b7213cmr24221015eds.159.1664902253898; Tue, 04 Oct 2022 09:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664902253; cv=none; d=google.com; s=arc-20160816; b=tpxr1rhxuV7pTuQ2NYHXvgYQRCnuwqjAf+B9mwTAsWXN7xba4FWcDUK97Nm6Vph8uM LIoo+yG/UhGikVUmem2vqvQ36wsjmK0qVL5/PFIn8flxKOHcydkxmMUrGsr7G1NmeygF FD/7njYmI5FbvyAb8EX2qZczlGBeC9MuQot9slnYhfZ2q/CE6ouhkeuRt0SX/oL4BXcq khcY5MB+tzBIA5NxKKIkWBTUVokTsVl1PFWXnv/XMuhqGy32Z/n0znuxuiXCfSevjhVw ilVPaeivIXd+md1+CvPr0zoww1yqr9mqOroCKuua50IX9tCo/UpSNnceEuA480Lw0qXU m5jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=gqk+jnvpgYR7ZLMzHsMuG2anQUgF0qH7+gB51tkBb7Q=; b=njF2T3XDBAu76OvckQqEWq0Xab+OD+sCD8Nt81fyjxqUvXjxTGK2PsCPdVLSvQ+pLr 39virxtwb4zncKZkKhivuU1tY1i5b2NdhjU9i9d6kDsSuGRKPr7eRSc0GWaC8ITy4iEK 6EVyhYkUHi/OcvDZwtC7FLy3jcT+AmRGhlKiouiu6WX3t5KKwBgKC+SDa/XYYRnmk25M i4YkLT6+ahN+6DV0stVRaMEtyac1GYr1AIPBYm1mYuXynQyRaf3Vj78W1nH/GZdc++lv BAtFx1JvMVmZrHBskgDebvbzgcinwEBy/m6WLK8fsftemFx9rR1Q8K8rqyTJezLbl+l3 q5tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd22-20020a170907629600b00769d94690fesi11554962ejc.326.2022.10.04.09.50.27; Tue, 04 Oct 2022 09:50:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbiJDQbC (ORCPT + 99 others); Tue, 4 Oct 2022 12:31:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbiJDQax (ORCPT ); Tue, 4 Oct 2022 12:30:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A24C5E570 for ; Tue, 4 Oct 2022 09:30:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E0B83113E; Tue, 4 Oct 2022 09:30:49 -0700 (PDT) Received: from wubuntu (unknown [10.57.33.18]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6571B3F792; Tue, 4 Oct 2022 09:30:41 -0700 (PDT) Date: Tue, 4 Oct 2022 17:30:39 +0100 From: Qais Yousef To: Joel Fernandes Cc: Peter Zijlstra , LKML , Steven Rostedt , juri.lelli@redhat.com, vincent.guittot@linaro.org, Youssef Esmat , Dietmar Eggemann , Thomas Gleixner , bristot@redhat.com, clark.williams@gmail.com, bigeasy@linutronix.de, "Paul E. McKenney" Subject: Re: Sum of weights idea for CFS PI Message-ID: <20221004163039.vv3byszpg5dqjhy5@wubuntu> References: <20220930134931.mpopdvri4xuponw2@wubuntu> <00140e95-0fe2-1ce4-1433-a3211f9da20c@joelfernandes.org> <20221003161404.kdow5uyj7kvbqyxs@wubuntu> <160a2ded-b8e0-acf0-a8b6-df1b0f2c0fa8@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <160a2ded-b8e0-acf0-a8b6-df1b0f2c0fa8@joelfernandes.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/03/22 12:27, Joel Fernandes wrote: > There's a lot to unwind so I will reply in pieces after spending some time > thinking about it, but just for this part: > > On 10/3/2022 12:14 PM, Qais Yousef wrote: > >> In this case, there is no lock involved yet you have a dependency. But I don't > >> mean to sound depressing, and just because there are cases like this does not > >> mean we should not solve the lock-based ones. When I looked at Android, I saw > >> that it uses futex directly from Android Runtime code instead of using pthread. > >> So perhaps this can be trivially converted to FUTEX_LOCK_PI and then what we do > >> in the kernel will JustWork(Tm) ? > > I guess it will depend on individual libc implementation, but I thought all of > > them use FUTEX under the hood for pthreads mutexes. > > > > Maybe we can add a bootparam to force all futexes to be FUTEX_LOCK_PI? > > > > In the case of FUTEX_LOCK_PI, you have to store the TID of the 'lock owner' in > the futex word to signify that lock is held. Right. So userspace has to opt-in. > That wont work for the case above, Producer/Consumer signalling each other on a > bounded-buffer, right? That's not locking even though it is acquiring and > release of a limited resource. Yes but as I tried to point out I don't think proxy-execution handles this case where you don't hold a lock explicitly. But I could be wrong. IIUC Sebastian's understanding is similar to mine. Only 'locks' (FUTEX_LOCK_PI which ends up using rt-mutex) do PI inheritance. So this signaling scenario is a new class of problems that wasn't handled before; to my understanding. Thanks -- Qais Yousef