Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1109789rwi; Wed, 19 Oct 2022 06:53:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7nuEz0xDUGHovVVPzLdnTvPGwD6gCV9DukDa+Y9K8/Jiptpsl73RRyGKkHWopV/HWSKZiS X-Received: by 2002:aa7:8893:0:b0:563:89e0:2d43 with SMTP id z19-20020aa78893000000b0056389e02d43mr8336840pfe.25.1666187602891; Wed, 19 Oct 2022 06:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187602; cv=none; d=google.com; s=arc-20160816; b=S3bi2IbGEdjVd4evDKR+hCiUoJRL/EpJTzdM/wBFWfZanyY5wvFF00aW8vuIPIFVCr fPNgt2F4QYevjiGQFPtZV0Yf136KEmwBCDZi92wOacNTTKCEYOosi4gFpXQjoD96Dr6e 0XR+CiBts2hDM2b2FA1sHoIo4Ae3kFnOdVOk3xSBcvLFE8LatRatxlBoWtxaxzU0uIrl gXdKSz2LI7GWJF0z2gi064REBcaVdZNRu3NktYw+V2jOiJTEZ60Ycme7+gV85KfI/bZk diEDIgxUKBaJEIG93sKPCzTShTFHrZ8G9VTP2l/yiIeSI/9z0Vjs3tTQcQhc014pdVBR 7BLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:cc:references:message-id:date :subject:mime-version:from:content-transfer-encoding:dkim-signature; bh=VX+rOkD8xiyRrx474te3+Nur53Zz1oCFtNgi2XZ4aug=; b=IdwgZw33OUVIjT/hyeOtX2cfXUfaJa15A/tWYMQNAE/F+y2QNkAbI0u5mHq00BORtz huFaFjw2WAeSsB4XtCy74YftsmnIM2cYPgModoce1DPfz/n6oVUENgLlc4GAhETLpyEx HmCOPDozI6Bj8eoJXBZ29RDZ6dTHwrDEBuZGvgwLIcB281A1KCrJy9v49j8TWL4Th8ZP hD5h4V095rol1i7aKdkl9S/XOOhhXZBU3W6To3wuQByA0DUD7PD50Fpk1P8LT6jM2x6l I3tgaicSCDfSywg8BVZ8+ZYrFZWBDqcSuD1Ms9MWZGOKYQ3Bvij6BTwHWIGlXNIR/9oA pawQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=w8SW2ygV; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i62-20020a638741000000b0045466821a09si18384737pge.371.2022.10.19.06.53.10; Wed, 19 Oct 2022 06:53:22 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=w8SW2ygV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbiJSMmv (ORCPT + 99 others); Wed, 19 Oct 2022 08:42:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233243AbiJSMmY (ORCPT ); Wed, 19 Oct 2022 08:42:24 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0B93F5CD0 for ; Wed, 19 Oct 2022 05:25:10 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id i12so11233527qvs.2 for ; Wed, 19 Oct 2022 05:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=VX+rOkD8xiyRrx474te3+Nur53Zz1oCFtNgi2XZ4aug=; b=w8SW2ygVI3hWLW5Pmjx6DvekATB7TTUUUVKrfq9vHYIsnChru1u6T9m27DmR2jWlfS QO/WEelth8HbM87OxEF7W6dtqVsck8OCfAbmDyGSQPM8iFdYti+xJphe+/0nGeCa8vLC OAT2HiOlw6hG+kRmXqZiRqXWKnPVmQncCn7zA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VX+rOkD8xiyRrx474te3+Nur53Zz1oCFtNgi2XZ4aug=; b=jllZmRCU1ictkuKENnJ25dCb/gucWY45hlK74cZk8tlFQ2Xk1Y8/Xe21hgu1bPm8Oz fjopxahT4rGhoNQGhuwut2M4fJ9NvpC7HLBny+pGMKxcc6zjYqVuNn0AdWKqTfwR285U w5pfGYxqhACGoyZSEAGbZDLpny6iBSSevHdjp1lkq1PfMu9/QZNyTZSkWp9rKe1Gss3b r2F7Dil1x3Io7tfaJCxAI4jiqpSBKnsCWsyr+SufLWjCDLAIhw0AOPq5bnwcY2CGzNtb WQRQQXnQ37+Xt1plAOGNEhIs+l2GLp7RX/YrmUxQRFW5zZfjEsIiPNmFoOTRrAxYneyy uflA== X-Gm-Message-State: ACrzQf08xDd0e/KU4RdJ00AWhh+TlIeZZjQA/wyNjyVpm9BbRUNcyOJM RGj0+Bt4chaAKn+0w1AlD9MNOQ== X-Received: by 2002:a05:6214:29e7:b0:4b1:c8f7:5ec6 with SMTP id jv7-20020a05621429e700b004b1c8f75ec6mr6217576qvb.79.1666182220111; Wed, 19 Oct 2022 05:23:40 -0700 (PDT) Received: from smtpclient.apple (c-73-148-104-166.hsd1.va.comcast.net. [73.148.104.166]) by smtp.gmail.com with ESMTPSA id k11-20020a05620a0b8b00b006ed99931456sm4695240qkh.88.2022.10.19.05.23.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 05:23:39 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Joel Fernandes Mime-Version: 1.0 (1.0) Subject: Re: [RFC PATCH 00/11] Reviving the Proxy Execution Series Date: Wed, 19 Oct 2022 08:23:39 -0400 Message-Id: References: <20221019114357.yipijpetxz7ns5aq@airbuntu> Cc: Connor O'Brien , linux-kernel@vger.kernel.org, kernel-team@android.com, John Stultz , Qais Yousef , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Will Deacon , Waiman Long , Boqun Feng , "Paul E . McKenney" In-Reply-To: <20221019114357.yipijpetxz7ns5aq@airbuntu> To: Qais Yousef X-Mailer: iPhone Mail (19G82) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Oct 19, 2022, at 7:43 AM, Qais Yousef wrote: >=20 > =EF=BB=BFOn 10/17/22 02:23, Joel Fernandes wrote: >=20 >> I ran a test to check CFS time sharing. The accounting on top is confusin= g, >> but ftrace confirms the proxying happening. >>=20 >> Task A - pid 122 >> Task B - pid 123 >> Task C - pid 121 >> Task D - pid 124 >>=20 >> Here D and B just spin all the time. C is lock owner (in-kernel mutex) an= d >> spins all the time, while A blocks on the same in-kernel mutex and remain= s >> blocked. >>=20 >> Then I did "top -H" while the test was running which gives below output. >> The first column is PID, and the third-last column is CPU percentage. >>=20 >> Without PE: >> 121 root 20 0 99496 4 0 R 33.6 0.0 0:02.76 t (task C)= >> 123 root 20 0 99496 4 0 R 33.2 0.0 0:02.75 t (task B)= >> 124 root 20 0 99496 4 0 R 33.2 0.0 0:02.75 t (task D)= >>=20 >> With PE: >> PID >> 122 root 20 0 99496 4 0 D 25.3 0.0 0:22.21 t (task A)= >> 121 root 20 0 99496 4 0 R 25.0 0.0 0:22.20 t (task C)= >> 123 root 20 0 99496 4 0 R 25.0 0.0 0:22.20 t (task B)= >> 124 root 20 0 99496 4 0 R 25.0 0.0 0:22.20 t (task D)= >>=20 >> With PE, I was expecting 2 threads with 25% and 1 thread with 50%. Instea= d I >> get 4 threads with 25% in the top. Ftrace confirms that the D-state task i= s >> in fact not running and proxying to the owner task so everything seems >> working correctly, but the accounting seems confusing, as in, it is confu= sing >> to see the D-state task task taking 25% CPU when it is obviously "sleepin= g". >>=20 >> Yeah, yeah, I know D is proxying for C (while being in the uninterruptibl= e >> sleep state), so may be it is OK then, but I did want to bring this up :-= ) >=20 > I seem to remember Valentin raised similar issue about how userspace view c= an > get confusing/misleading: >=20 > https://www.youtube.com/watch?v=3DUQNOT20aCEg&t=3D3h21m41s Thanks for the pointer! Glad to see the consensus was that this is not accep= table. I think we ought to write a patch to fix the accounting, for this series. I p= ropose adding 2 new entries to proc/pid/stat which I think Juri was also sor= t of was alluding to: 1. Donated time. 2. Proxied time. User space can then add or subtract this, to calculate things correctly. Or j= ust display them in new columns. I think it will also actually show how much= the proxying is happening for a use case. Thoughts? Thanks. > Cheers >=20 > -- > Qais Yousef