Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17739rwd; Mon, 15 May 2023 19:11:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5w3I+lRhsk0mZI64oatP+mySKMXEANAdIYIKk1F0LaaQEfXYothm3wM1Er+QL9FncE34DC X-Received: by 2002:a05:6a20:7da1:b0:101:65a2:e06b with SMTP id v33-20020a056a207da100b0010165a2e06bmr30601320pzj.20.1684203066033; Mon, 15 May 2023 19:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684203066; cv=none; d=google.com; s=arc-20160816; b=G7bz6XDECQ3Zn8pwA8xeISbtTgYasi+Vdbr6QDgFS96nLyVhW4D2RwrHyQj7cK4ogm R9whSflqTBlspdCGbi5bmwzyFpHInEecIp7jib7Qlg6OkorepSImAAVU29bP7YuNNyy4 jvEqCD0fnCiZ2l/x4ZAQsDMtsDZH2xJrhht76IDhYtGFkdC93oeRd4dE38cfI6EQOVO2 YZYSOvO6837hKyOwpJP7au0HiRqCKrcn5gwvfYofSqfVgPVu/6OrWo/zQjmiKF5bhmEO 8DdTSR//EtKcclkyhij6A6qwhK1UnMMzvkFs1UH2ShfLx5M9p9zYqVVqxMHUqNnSnuuW 1M6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7vQMONc5SJDyCvN7VZRBXzuqqiXsyACiKWFthRnNjkI=; b=SD3UdVs9j3rZ1J+U1eTjAWEYGyMOWsjtI7p476TZumRoCLhtliYT4n8H/igyXo7YRH si2qfBXydu0Ioa4z6TH61l7IqugPybJoafuyjQGXRJz8GKzfmMEt5gGMwScFk0cDjBgi pT1tSsDtFziB27MmEs8gSDxOHsRbYhZfa2JIoD3aLCyo86J9FX99CLFXi5vdyHOPNq8n Bit/eBpTzU6F9Vb4gCzvr7AenbnZPctisrGWibBCr1YgzYxihbpGfy6BOpuU2AVH7sdv qau+m7V2DZDpdzENK0HhL/Berkx4LmufG2Vfj1feTz7tc1+vsSPYFk+NcwwONOA5Up2z tA1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bitbyteword.org header.s=google header.b=MJ1jp2jK; 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 c18-20020a637252000000b0050beec91e30si16546282pgn.768.2023.05.15.19.10.51; Mon, 15 May 2023 19:11:06 -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=@bitbyteword.org header.s=google header.b=MJ1jp2jK; 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 S229754AbjEPBrS (ORCPT + 99 others); Mon, 15 May 2023 21:47:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbjEPBrQ (ORCPT ); Mon, 15 May 2023 21:47:16 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E9B2681 for ; Mon, 15 May 2023 18:47:14 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-38e3228d120so7154650b6e.3 for ; Mon, 15 May 2023 18:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bitbyteword.org; s=google; t=1684201634; x=1686793634; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7vQMONc5SJDyCvN7VZRBXzuqqiXsyACiKWFthRnNjkI=; b=MJ1jp2jKeZlhrFpiyXssgMah5dc3o5krDLHVOiR0AZia+Lqn9dfT8qtVIhmqCho2vT T9iDlq+DyxbBb1aq+P3T6wmlnrWFRFWOpOjwZp1Y7YeUYij0dg75hbzXn3CO1JkcVB5q 7fdN24YuXgRYmhULBdSi259hdYNiLt1vMbNOoP6AEl9aALNw4Enu7jKfFON70Ho/NBrP sJkWBFC9JsM4h6jA9Q000f74LWzz6PuMElq1uuaitTsoyM6xkweI+nsgeU4OnzW0nOk0 v3p9WGCmpuBNSTbwuk6Z0PceQtzR0fFkr7RvqdGEGclm2H+BKrBAWcKhpeA16UUVSoiJ Yp5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684201634; x=1686793634; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7vQMONc5SJDyCvN7VZRBXzuqqiXsyACiKWFthRnNjkI=; b=XQLmypvm+1Tl5ZO5V+n1XFhuetPCkZs3NR7IauIiaB5lY3bRuxXi6KBbshUCxCGE05 kcYEVqf5osplfHXLUt9VrCK42Xb38gGNMaiMyJRM1ywjqlhEuzgO+USRdOL7HDJUhOEw Dx1lF+uaQycvQe1Mv/DuIqFJth8bHoXjO8/lVg+sT1zOhpWVR2aclaSEwRNGs4phFKE5 wmfvFY/awJS4NGYD4hE1abWCDOaIfmoq+6Yhu9vq99oHJjIeYkPNy7RleqOZeZ3oEXjV CYUMj+hMad1vMmztAcd8rSCEkzIlFwCMON6hWyVcf0JluhyPo6oBakbAuBpdDknI8FGP ImRA== X-Gm-Message-State: AC+VfDymSSDR/qxNiNebz875jT5f6SMVT7f5I/4Yg6OcTyeIGiTZQxzX Cw6hoyxBNdXitBcpsHifoVeHEVZrXXNa8fGw33r1Gg== X-Received: by 2002:a05:6808:1a04:b0:395:df63:63af with SMTP id bk4-20020a0568081a0400b00395df6363afmr5860001oib.54.1684201634118; Mon, 15 May 2023 18:47:14 -0700 (PDT) MIME-Version: 1.0 References: <20230515025716.316888-1-vineeth@bitbyteword.org> <20230515025716.316888-3-vineeth@bitbyteword.org> <20230515100616.33ba5dd9@luca64> In-Reply-To: <20230515100616.33ba5dd9@luca64> From: Vineeth Remanan Pillai Date: Mon, 15 May 2023 21:47:03 -0400 Message-ID: Subject: Re: [PATCH v3 2/5] sched/deadline: Fix reclaim inaccuracy with SMP To: luca abeni 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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,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 Luca, On Mon, May 15, 2023 at 4:06=E2=80=AFAM luca abeni wrote: > > this patch is giving me some headaches: > Sorry about that.. I was also stressing out on how to get the reclaiming done right for the past couple of days ;-) > Vineeth Pillai wrote: > [...] > > * Uextra: Extra bandwidth not reserved: > > - * =3D Umax - \Sum(u_i / #cpus in the root domain) > > + * =3D Umax - this_bw > > While I agree that this setting should be OK, it ends up with > dq =3D -Uact / Umax * dt > which I remember I originally tried, and gave some issues > (I do not remember the details, but I think if you try N > identical reclaiming tasks, with N > M, the reclaimed time > is not distributed equally among them?) > I have noticed this behaviour where the reclaimed time is not equally distributed when we have more tasks than available processors. But it depended on where the task was scheduled. Within the same cpu, the distribution seemed to be proportional. But the tasks migrated often and then depending on whether the task got a whole cpu for its runtime or not, the reclaimed bandwidth differed. I thought that should be okay as it depended upon where the task landed. One other problem I saw was cpu usage spiking above max_bw leading to system hang sometimes. I thought stopping reclaiming when running_bw gets larger than max_bw(in 4th patch) fixed this, but when I ran the tests long enough, I did see this hang. > I need to think a little bit more about this... > Thanks for looking into this.. I have a basic idea why tasks with less bandwidth reclaim less in SMP when number of tasks is less than number of cpus, but do not yet have a verifiable fix for it. If patches 1 and 4 looks good to you, we shall drop 2 and 3 and fix the SMP issue with varying bandwidth separately.. Patch 4 would differ a bit when I remove 2 and 3 so as to use the formula: "dq =3D -(max{u, (Umax_reclaim - Uinact - Uextra)} / Umax_reclaim) dt" Thanks for your patience with all these brainstorming:-) Thanks, Vineeth