Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4892884rwd; Tue, 23 May 2023 14:24:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ55G42vSheCyQHaMtd1LpeFqbsHVJOaQfILlS4Cx3kgsnPLRu51vMwk5tW9SV9Ni1Od7tF+ X-Received: by 2002:a17:90a:628a:b0:24e:3c23:9654 with SMTP id d10-20020a17090a628a00b0024e3c239654mr14668923pjj.44.1684877062815; Tue, 23 May 2023 14:24:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684877062; cv=pass; d=google.com; s=arc-20160816; b=JQTb3fV2vf30y01FePfu/Y6Sb1kJSCqz1OftlzvGb/KhP/4yPxgNK1SgC55FQXts6T 3PJ6+ueJzMNR0rgt0OPAawD18dhfEcutixoSzsUUORiLaVXmrN3aez7wjE+ZIuKAkHzC wanFV4A4Cei4wikSU0xJ5Db1+VTFp6RJ4/MSVvPQtLMfV5CNjRz1ukmG0pX+xPoNlWSW klxX4zIe5PLzj7Zfgn4yfSUVsoDnRgGh7ppvhafuyZROEbE1cpATus+Ny/WNO0M5sFzW LzyZFUbkTw3haazqswFCuW86uEzhbInsJ3uK4eTJr4ZNj55GCkOQMwP/SkOV1EejJWtB jUlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=OzSBRWv3MbVwdsymxRewKv1eegjP3T4XN7RlThuZP1c=; b=PRGFy+uT6zOrEPQxgX5cvZe1eSIKVgEE30AmHkxbPalVpcx/WAaY7FPzQkooy0FkSO 2EslS6fxS9wR9EnLN2Nm08HKxkS0q6t/EcHQlMlUI3AO4TI9h+SILgG7bs82LrwC/+9G D4rPv58jKSAVqSyG77Zv0vMLSb26v1HuAeE0FcdqIR2J0r7mHJ3kKGsDWRZv9zpI/bTe Da306XQGMhSjJOLQOS2at+lg10bsPqc/NN0FdG9jMS4Eepae32EDiXrGhR5SQl/toENX sldLGK2EwsToTdmbFbwGXARql4XTE9BqK2oXnkcJ+eIB/Ct7MsR2XDsF9DzN119lupfI 2sMQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@santannapisa.it header.s=selector1 header.b="h6p/iKq7"; arc=pass (i=1 spf=pass spfdomain=santannapisa.it dkim=pass dkdomain=santannapisa.it dmarc=pass fromdomain=santannapisa.it); 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=pass (p=NONE sp=NONE dis=NONE) header.from=santannapisa.it Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o22-20020a639216000000b005304a8af2a2si1626575pgd.404.2023.05.23.14.24.07; Tue, 23 May 2023 14:24: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=@santannapisa.it header.s=selector1 header.b="h6p/iKq7"; arc=pass (i=1 spf=pass spfdomain=santannapisa.it dkim=pass dkdomain=santannapisa.it dmarc=pass fromdomain=santannapisa.it); 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=pass (p=NONE sp=NONE dis=NONE) header.from=santannapisa.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbjEWU6o (ORCPT + 99 others); Tue, 23 May 2023 16:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbjEWU6n (ORCPT ); Tue, 23 May 2023 16:58:43 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2044.outbound.protection.outlook.com [40.107.7.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26EC88F; Tue, 23 May 2023 13:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OMUxdT24bjPSuQTDfbZUzUteto43Mm3d7wQAlyNjo3Mqvlrrs4uP6SKcSwGctaNjeZzfF3KjuhNR+hWG8h/S+mdO8NBBNLfs2moThH8QND38EtaB3zM1WxMnc+o4ZU7dIT4PDxCjSDD/NqW16ytsexxjN1wcMh6oC5cg6F6ds9NBynu9P7qLkGWkVT1gQUMz46SX/agOBFU2UqxafwWVioF/M4yTCsfaZS6vuq7wefh2tEU6u6wgX/SaZMve+YENyhIGrs2hXNSdMIhKHnzxHlFi645oXCT57jEWQloLSsykWOn56jP+zbXrSoDFyv4Hx/gJE4wq6hNY5YTxuvXLRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OzSBRWv3MbVwdsymxRewKv1eegjP3T4XN7RlThuZP1c=; b=bByMKbCVlnfz1X8YJNWMJW7Zd8VhjeVW2EKfR5JDIUCJVfhHLjpxwWxi/164TJIrfyBZh7SNxmUMQc/B0KIr4g0NCJUSOrSsqDA2ZV2uBbHzBPLIbize2NNOBoKcnS6XziIkRrMuad5KFVTMA78YOtLHxNMb1dG9I75Cl7R0FLjB8ZnlD8wo/Ac3YTnZmc2R3KnV8Yn+Bm0wyA6arbQw/FfQ6lEFi/XO+baMDP2wA445JzkhigH2o+Qyd1zs967mS/yahJbzxCWXXAZGJa8JAgzBFyYfSg3UmtT5ouVIOUg6eQiQw/h0+QR3nP/wtpMrXBnKxPAoSV7qjXhGzaBsDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=santannapisa.it; dmarc=pass action=none header.from=santannapisa.it; dkim=pass header.d=santannapisa.it; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=santannapisa.it; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OzSBRWv3MbVwdsymxRewKv1eegjP3T4XN7RlThuZP1c=; b=h6p/iKq7gSOEfccqbzBbfLYKM2tl9lc+3QoHtcLrjejYFZtZLyruMhOnZRHHOEd53YdLF0KPXO5d9SQA0kweterDefMW085elunGcogw0wgnuH9yiRbjNVun0WJJQt5lnT1/3cbsQDnCkDk9cgg0W7qUS/IMSPY1QRMl2UUDQ+A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=santannapisa.it; Received: from VI1PR03MB2880.eurprd03.prod.outlook.com (2603:10a6:802:2d::21) by AM7PR03MB6562.eurprd03.prod.outlook.com (2603:10a6:20b:1bf::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29; Tue, 23 May 2023 20:58:34 +0000 Received: from VI1PR03MB2880.eurprd03.prod.outlook.com ([fe80::8925:5293:e478:c934]) by VI1PR03MB2880.eurprd03.prod.outlook.com ([fe80::8925:5293:e478:c934%6]) with mapi id 15.20.6411.027; Tue, 23 May 2023 20:58:34 +0000 Date: Tue, 23 May 2023 22:58:31 +0200 From: luca abeni To: Vineeth Remanan Pillai Cc: Juri Lelli , Daniel Bristot de Oliveira , Peter Zijlstra , Ingo Molnar , Vincent Guittot , Steven Rostedt , Joel Fernandes , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v3 2/5] sched/deadline: Fix reclaim inaccuracy with SMP Message-ID: <20230523225831.60d75b38@nowhere> In-Reply-To: References: <20230515025716.316888-1-vineeth@bitbyteword.org> <20230515025716.316888-3-vineeth@bitbyteword.org> <20230515100616.33ba5dd9@luca64> <20230516093729.0771938c@luca64> <20230519115621.2b3f75e2@luca64> <20230519121804.6c85a3ed@luca64> <20230520115857.3838a7ea@nowhere> Organization: Scuola Superiore Sant'Anna X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: ZR2P278CA0034.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:47::15) To VI1PR03MB2880.eurprd03.prod.outlook.com (2603:10a6:802:2d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR03MB2880:EE_|AM7PR03MB6562:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ae20bbe-c52c-45ce-afd1-08db5bd07926 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I+tAhky0T9+jwVL7/A/f7r4Oy50lx5pqpeZZFIbq9kcqDidgtAI6xWWyfr7x6sTyyw876ihYi9IqyVbdkRDtx372A3JifVX30C5Jg0lpNOjH7imMM85VJzgePg/Ddv7BdMyI+bQdpw1xtWu06csLVcOqscTnkWm/XgVmE0yq0QbnEymrqDzPf1np63mVzYvXtvwbw3w1P4mkjGZw7TxC00QbfcKz3N+HYzHiW9Xlz30jmziOTCjJ3nBb7aUR+m6uJVRMh+aDsdyUCMDjXTvB9vS8r9/HF7myuyajgRuwPzdbhMzazJLeI4FTzX5grDa6bmtihd+0lh4TOYrpY+XS+I1XOyd/dtyUMrXnYhV6eKU/4cgJTDM9C6gNUx9kXuKAcRcKi7Mq6GTB+dNNcHU08QlZojlBOj1Jc7uAnlHg9IXuVfEk5Uov/a3zXtnCWNIfhiJrk1+Gzp1/vl5+9wEfxEwfUWslbJvEnSeRPy9jq42Hayd6ZS4REQ3L2Ar+szLIGYScsGAM2E9ratd5xVVhpxd7pNVTANg+pdB+Lv/lieAXANvDhUK2/BFNIqQ72PxC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB2880.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(7916004)(4636009)(39850400004)(346002)(366004)(376002)(136003)(396003)(451199021)(9686003)(6512007)(8676002)(7416002)(8936002)(83380400001)(38100700002)(33716001)(86362001)(41320700001)(6506007)(2906002)(41300700001)(66556008)(66946007)(66476007)(6916009)(36916002)(786003)(4326008)(6666004)(6486002)(316002)(26005)(54906003)(5660300002)(1076003)(186003)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zyy3bcy35sxZFg8aCkaLfjtCJMv3fS9CarmrcDgp477pH6smz9ABng872qMz?= =?us-ascii?Q?vKEENCmEUZtIUQmf1IdcpYGtX3jcarZBNEkupJD5uepBMUO5YevoOGR2njrR?= =?us-ascii?Q?dAbIwFUu4sQk/TBCWq6aih5CAiJjXfe9AjqqHUC23RZlzX2hhAOhR4Bft/tk?= =?us-ascii?Q?dT4UO3AkR7fTwfXJrWrE30ASM9/DpPdtWDmoLsFk8gQszAZsv96hBtU1TLwq?= =?us-ascii?Q?WRU8VCGyNBn9eTl/RFS1ztM9kCO0AG7TfGWGR4LfB1sjbGzuROEP6mb8XY4T?= =?us-ascii?Q?42mzF6IlIp3I/xLkynvsUUY2uwOjw1QgypxSfW0bp8A53zrJbWzb1H3Hn1HZ?= =?us-ascii?Q?pIEZXr6tSFUWXvlGnFCE4UtRPOdRBERTf1a/lhkcpDiYkRm6o8w9zHDAqw9n?= =?us-ascii?Q?FCfbHSJe5EvEnHuoi0TwBkpUjhjXJ/tby8UiTXPPggxHbnCRhrWVfzjKkci6?= =?us-ascii?Q?R1c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JWOygVkLetfCusu6jdgQR?= =?us-ascii?Q?MHH55a5MVrYk+byVuiOMkipL8zaLY4QZay4lNsafrk8MIJ0fF+ayEwCOR2vq?= =?us-ascii?Q?KM4uLL2cMGioJbDjQil8pOIOYuEx/kg3huiUB2DYVpsEh40egic6j5m2FrHe?= =?us-ascii?Q?KTSMAYfU8nS3o8PM3HO3ADfyfZd4jWqggqb6f8lYdAtE6n8qbAfl79bxYXO2?= =?us-ascii?Q?Kqxs3GoDcjfVelfAYRxTRkKwc3jsbUdoynY3nTEBupb8fsNBxOF9U+27uvuZ?= =?us-ascii?Q?JQ=3D=3D?= X-OriginatorOrg: santannapisa.it X-MS-Exchange-CrossTenant-Network-Message-Id: 6ae20bbe-c52c-45ce-afd1-08db5bd07926 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB2880.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 20:58:34.8093 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d97360e3-138d-4b5f-956f-a646c364a01e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: a+z/Oy2SI2DoLaW4/wa7xA6niXK/lAlZ84fYQCOnJS/pg1Q+bMw28oS27pSfkxRy+cmabIKQ2rf5JyRjLyS6b+NDsENYy2ytjLLUmZJAZxY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR03MB6562 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, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Hi, sorry for the late reply. On Mon, 22 May 2023 15:22:52 -0400 Vineeth Remanan Pillai wrote: [...] > > But when I use > > dq = -(max{u_i, (Umax - Uinact - Uextra)} / Umax) * dt > > everything works as expected, the 4 tasks reclaim 95% of the CPU > > time and my shell is still active... > > (so, I cannot reproduce the starvation issue with this equation) > > > Sorry about this confusion, yes you are right, there is no stall with > this equation. The only issue is the lesser reclaim when the load is > less and tasks have different bandwidth requirements. > > > So, I now think the second one is the correct equation to be used. > > > Thanks for confirming. > > I think it probably makes sense to get the fix for the equation to go > in as a first step and then we can investigate more about the second > issue (less reclaiming with less load and different bandwidth) and > fix it separately. What do you think? I fully agree. If you split this change in a first patch, IMHO it can be applied. BTW, I tried changing the equation without introducing div64, and it seems to me that it works well... So, if removing the bw_ratio approximation is needed, I think you can do it in a second patch (so, the first patch changes the reclaiming equation, and the second one introduces div64) Thanks, Luca > I shall send the next iteration > with the fix for the equation alone if its okay with you. > > Thanks, > Vineeth