Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp348841rdb; Thu, 21 Dec 2023 10:50:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHr0U/6Ueb68kYc0Fz2fbrgxoVLDiemgOO2NkE/bawO+Mr8P7nQvR3GHvqOtDG79crDQvgV X-Received: by 2002:a05:6a20:728b:b0:18c:30:f408 with SMTP id o11-20020a056a20728b00b0018c0030f408mr207090pzk.0.1703184607031; Thu, 21 Dec 2023 10:50:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703184607; cv=none; d=google.com; s=arc-20160816; b=m7rEfzlLvk0LjPcKcAXu2DdhWM/Ko9xxKKokBVpRDJDkgLa1szICQbimdFzVlOdIfg p6NXpjAA+3rPH596iz9nHvvNpJ+fYJeILvog7zd8rKhdAflU4QvwxkhUG4GtC4xm36ha XY5hxUB4ezfIerTY74iyfxfi1llGe7NKiqECb7SGQuLv3qkWvh60m9AVTXGUzKg4O08w MOcC4CkkqqBwxTTQKDqkQR4qbW8XY+HUOiP7m4L1acTKI5LM78GKvG6T/N/v8mTqn1w2 rk4wNUx5645At8/CJ80keq3Md/QIfuyv741WGrQ01qC598w4qKlyp4H3RFNRzLiVHtHn +mAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=yjixayZMz+gHhsUfeAVKiE5k7f8w0LYxdYgUulEFxUg=; fh=BNf93qThzKvcNrUblroeKiFR5/RdNi9rwKlfD7f6Nmg=; b=zRKwbu9MHvcC59DPmeXXzlamOeg4o/rI+jRmGijLrgIxHvrO/S5eV0fnuwHGb0Bl80 drmTL+lGH4s5dhcj3XS3kmhpnnXpcQqY4LO+I3Uuo+ReJOrMHThSLKuMIHX+SekL1iR0 C9szlF7l6yAClQGrEFS/oPwviScXfFwnDjrEhlpQZyu4dFOmw1RCxt2aLCJ2hGidQjq6 Yf821iO4Br2i7fH2hI6x8s8OKoiD2F1L2b57/qtKrXIVt+FRniaoNYDrINp6yJeZTf6+ oprNyB1GGKOgCe0YskAwNg5Z7mpeBPu9e6GrF4ZNzDhknb5RieNH/sCWjzGjXw5CuuGM ravg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iNsjcuiO; spf=pass (google.com: domain of linux-kernel+bounces-8951-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k73-20020a636f4c000000b005c6606d5b9esi1995748pgc.572.2023.12.21.10.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:50:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8951-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iNsjcuiO; spf=pass (google.com: domain of linux-kernel+bounces-8951-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 82ED0288848 for ; Thu, 21 Dec 2023 18:49:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 964F365189; Thu, 21 Dec 2023 18:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iNsjcuiO" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57084627F7 for ; Thu, 21 Dec 2023 18:49:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40c3963f9fcso7455e9.1 for ; Thu, 21 Dec 2023 10:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703184574; x=1703789374; darn=vger.kernel.org; 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=yjixayZMz+gHhsUfeAVKiE5k7f8w0LYxdYgUulEFxUg=; b=iNsjcuiOXWVM77vST/pZMvfMMhqXAAqiMRBeLwtPX2KJzJSDJ+5COKy1D1xN2eO6eQ j5r/KOFROCrUIVhs0zNjwYMrEsX5XTgE7cAqO0sSxwYYNNMAwGxDDaLSwuI8Yn32SThs OJmRmcfoFu4Pf3FgTsCh95W3J4TRPR+J5mLYTHWoVjCBYNK8luSh+KAlapXvVLUyldw7 Gaah5bY81r02wAI32gG0W+fM0VezFN9Rk+H9SjHn0N2VMr/ICwDgj0j/J6lnt03kxT7+ fg5hqL9PA+BjlaqNiOpg0CGqKczITJ6udS0mStg35rR0cc0WVx4KndvAU3vN8FVAbBDr yW3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703184574; x=1703789374; 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=yjixayZMz+gHhsUfeAVKiE5k7f8w0LYxdYgUulEFxUg=; b=K3u/q21Ag1V2nlKot6i2284I9TP5ahD/z/VM/zX4rK1zC+hRPR9o2trxo19sCqMfVt Bt/I/r5/A1uYndSBudoK63/Xkx/FDyHPi3RAl7lkTjqYpdE4Lm96sxFExShSrn0rKo7G 80XXnhKj6ZEWD4tuAC41QW6XZYX7IcSuA+ieQWaW2spB0LMh3jXd1XqLvM8zK6JEfMm3 fleuvpDmzCyLX6vqmC3CkvLLO5SyPbwtXglb+2QSH+kLMM2MqGL1xF3T/Vzn8huMBlIx U3j/zkrYE01+RsjIilneRhwBcPmhhG8Lxx71BkksMRqSUbeMcXFc+30Gp2uis1ZyFtgT nG/g== X-Gm-Message-State: AOJu0Yyzl8u/TlCQSMYFoWOcsVhrFVwjlNmL4QPutrlQkJwCuG6KFomf jZa6IQqjubVE61jKA79TKpdPBSwlqorFOObinbeNTAg/Tk8= X-Received: by 2002:a05:600c:3b1b:b0:40d:3f65:7e8b with SMTP id m27-20020a05600c3b1b00b0040d3f657e8bmr437wms.1.1703184574409; Thu, 21 Dec 2023 10:49:34 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231220001856.3710363-1-jstultz@google.com> <20231220001856.3710363-11-jstultz@google.com> In-Reply-To: From: John Stultz Date: Thu, 21 Dec 2023 10:49:21 -0800 Message-ID: Subject: Re: [PATCH v7 10/23] sched: Split out __sched() deactivate task logic into a helper To: Metin Kaya Cc: LKML , Joel Fernandes , Qais Yousef , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Youssef Esmat , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Xuewen Yan , K Prateek Nayak , Thomas Gleixner , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 21, 2023 at 4:30=E2=80=AFAM Metin Kaya wro= te: > > On 20/12/2023 12:18 am, John Stultz wrote: > > As we're going to re-use the deactivation logic, > > split it into a helper. > > > > * Better to have a comment (e.g., in which conditions > try_to_deactivate_task() returns true or false) here. Ah, good point. I've added a comment to address this. > * try_to_deactivate_task() is temporarily used by 2 commits in the patch > set (i.e., it's only called by __schedule() just like in this patch at > the end of the series). However, it's nice to make that big > __scheduler() function a bit modular as we discussed off-list. So, > should we move this function out of the Proxy Execution patch set to get > it merged independently? Yeah. I add and later remove the proxy_deactivate() function as it goes unused, but I am thinking about keeping it to handle the case where if the blocked on chains are too long, and we're spending too much time re-running find_proxy_task() - where we should probably just deactivate the selected task and move on. But for now, you're right. The suggestion of just the initial step of splitting the logic out (probably make it a void function because the remaining usage in __schedule() doesn't care about the result) is a good one, so I'll rework it this way and send it separately (along with other early patches Qais suggested). thanks -john