Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp958553rdb; Fri, 2 Feb 2024 09:02:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTBzL5quX5RQPBDSOqyCOBwXvErgX4vWHzSzntHEwUKY5jTmkB7OMjZXCzez9T+Lpegh9g X-Received: by 2002:a2e:9183:0:b0:2cd:ec28:ccc5 with SMTP id f3-20020a2e9183000000b002cdec28ccc5mr1585811ljg.14.1706893325531; Fri, 02 Feb 2024 09:02:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706893325; cv=pass; d=google.com; s=arc-20160816; b=Rrx0psh+tVc+XYkFUfhMkifLDFRkhHfqcZicGKUbqyawf4C1otSYB18PfGZlprzypM whYtfBorHUCkSO4Kt5dNN23VX6U+l6i2ip1EDv3s5bQEidyb+18SYQbeE6fSUye3lpAa vwonlSk/0YqYmZYr8tm9CbTiWZzHDwK2roie3SN5dZj+Y9UUHctqNzv0MSa+0O/NCQWd UNEUgo2YW1M/ziYUT7VanHmeKkenvPug8I8pcfxZYM2IktpzgB/b6GUZQl8VqNwKAaLB m+XhOaRdknztFH5ebV7DRp8XPNwBv/Tm1uaQM5JTZk5qWJhwHy6G1d2E4u3uyUfXNnfa +1VQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=3mB32jUig8gzGN3z4yX7Jr6nWQUHLf/QhJJHR2SPVUs=; fh=gyzjt614+ER/y+mkKw9PnuEMGtShoZ+FuioMpefHSWM=; b=LlfdBJGL8D+tqQiZHrUhQmN3XvjuYRzaI0uIqlREnRyOClUCb5sjr+LO/CDQnbQZ6L rVbTsqz8hU9Wpb8gPuv/XfE2wVIYnElqnOUy76wSrEzt/0068JJZMTn9Ar8pPzm0IBgV DbQJUA0RkvkLKezV6mNzZRGU5Z5q47HskZqxREexzxDekXvh+1WieWcqNc53bo2qHqmN VmBOOC08908BmPZr5eVCiIwx707jSAaHlWpXIE9UTCdzbupok9lqH7DrtwE86I6UovIU n9kusoVa3lz88VwCMMiyY9RfGgoJVxuM7B1HNta0RgjKLcYBuh8gYddSCxb5RskUJT/w Pk7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KXIXcMAW; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-50188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCUNsoiL7HmmUA3eFloiifOoVTCndMV+lck0mtDllAP/RW9clm+SuFJpcSzCtCOjd87dfwtBX8QylEcric664STJoyCU3NTm4rip2ALyXw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bf14-20020a0564021a4e00b0055d2dd8b85asi959606edb.230.2024.02.02.09.02.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:02:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KXIXcMAW; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-50188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 207F11F273D0 for ; Fri, 2 Feb 2024 17:01:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3310148FFE; Fri, 2 Feb 2024 17:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KXIXcMAW" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 599051487E6 for ; Fri, 2 Feb 2024 17:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893291; cv=none; b=mrmbYWaL3evtxJHSTfZBPSdA0HTWG4jqrRfvepAeWj1TxPMN6dC2piMFtDUXy9po7rZhry9mvYXDucyxI9hQp1Jmczl5NjYmB1p55rRfzK3yc+7OaxLruVGBeQQD3MWq/7snKfChZCKTxtW16yVRXO58dCCm5og1dmF/Exwmdwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893291; c=relaxed/simple; bh=3mB32jUig8gzGN3z4yX7Jr6nWQUHLf/QhJJHR2SPVUs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ofCgH3+XfzQPN21ouNpzi5b+OvmJeXABE+0oWAMRWb9j8tFC+5jI4RxABhCzyOtdI6wZlO/w751SW+kKlRo3FPMSigM8AaKgsJ2L8lRbEEVub29wx9VtUJUiM+jvaBl3dKdKI7Bp67ck2AgF7RIkykSbFjEaHtgCz9Xq2npQnPk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KXIXcMAW; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706893288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3mB32jUig8gzGN3z4yX7Jr6nWQUHLf/QhJJHR2SPVUs=; b=KXIXcMAWXRWd+Upw96oc2/+rLbxBTfwjnQn2ogqTsMa7eTB0gYnYn/p7jZSVdFP/J8RtvZ aA+SmyzBkaOD/zWByix0Z8l+GFWpxKmdDwsXWeu/A2DjpdIFKzeWlpSAMLeWOQkwq76vJB GDt54FaS3onDgZLZ6HxTvRiB6Z5SQWY= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-533-yGHWGAg7M2KjtXGtLDsMWQ-1; Fri, 02 Feb 2024 12:01:26 -0500 X-MC-Unique: yGHWGAg7M2KjtXGtLDsMWQ-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-5113bb1c4fdso431991e87.1 for ; Fri, 02 Feb 2024 09:01:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706893284; x=1707498084; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3mB32jUig8gzGN3z4yX7Jr6nWQUHLf/QhJJHR2SPVUs=; b=SNBmG4zHeaH0JogguUOkqpEk6Pia8lPw2jTS0RFemMdZv8/Wwyn/krnEEJlNu3c7Ua r7OwMEWLccJNWroRZw421U4te+nAqUWo1p/ti4Ngo2U8OQ9C4DRThXuJ4veTo4hxMehr wIVMB3oYWlLCq+ar4fi91YV6geXjgVjhCL5Eloe8kS/lxpD3RFF2AUVJ4TcFrO0AP8qP ZxW6EMBjE2t7+lJj2VAFmuJujW+UeUAB8+daE+m3ea9Qdws4OUUgqlBsRzGUm3X7iivk ncVb50G1XcuA4luwCtILxRqUUUmoS6+y8DfJQRG8ODP+xgir+epHdL4TwYkRTzk/5lGO 2c5A== X-Gm-Message-State: AOJu0YwOb+SfWXwMh5U421ZuSxUIXvZmza9tMm5oQAoX7Mze9LYQdfB0 TYBAarXe1UahQ+g6fVSjzmUzxDKiqQg+E3lRBZURH4O9Ipbtjr4MEjmtg3FF72Ot8MMnfSCzSFR vkl1nuAlc52VJWo/wLb1Qlb7o7ywDQK4YAUrAzIZ3uDu54znBXGVGoXgylluKnw== X-Received: by 2002:a05:6512:3fb:b0:511:2f8e:3175 with SMTP id n27-20020a05651203fb00b005112f8e3175mr1735107lfq.29.1706893284518; Fri, 02 Feb 2024 09:01:24 -0800 (PST) X-Received: by 2002:a05:6512:3fb:b0:511:2f8e:3175 with SMTP id n27-20020a05651203fb00b005112f8e3175mr1735087lfq.29.1706893284156; Fri, 02 Feb 2024 09:01:24 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCX6U++30MnFsmrHL71ehEIfGbdxo1+X+t6XrlnKDOWfKXCaOwtWDpclJIeOfBtVzI/LCmVOaK+hNXB3Cxck6Es6pe7HKm5IC+iXE3vtmuH3j7QA2ZABe7FSGcvkQxwy8ZAnJI1pJ9ksSM1VlFysdabKLYb272GnGORcMgtg5dDJD1zJVhnowmLW6XnZ5DZLHxkgU7wpgzM5PojIj0PcVUdIxOyjYnD6fWgRhwLm4hpb7HUM23dMMAsOLtI3ymKcQoBYq8bMQoV1YnhprGJmszUGNTBkLCrOnVK0l/vNhVl1naOCHLews2Iyg/5+3dEBeCNkgDwuN4669rtm2Vo9hSz4qN4HLt25cogAtf9wopxw4QlTRg== Received: from vschneid-thinkpadt14sgen2i.remote.csb (213-44-141-166.abo.bbox.fr. [213.44.141.166]) by smtp.gmail.com with ESMTPSA id fc19-20020a05600c525300b0040fc26183e8sm443729wmb.8.2024.02.02.09.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:01:23 -0800 (PST) From: Valentin Schneider To: David Vernet , linux-kernel@vger.kernel.org Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, kernel-team@meta.com Subject: Re: [PATCH] sched/fair: Simplify some logic in update_sd_pick_busiest() In-Reply-To: <20240202070216.2238392-1-void@manifault.com> References: <20240202070216.2238392-1-void@manifault.com> Date: Fri, 02 Feb 2024 18:01:22 +0100 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On 02/02/24 01:02, David Vernet wrote: > When comparing the current struct sched_group with the yet-busiest > domain in update_sd_pick_busiest(), if the two groups have the same > group type, we're currently doing a bit of unnecessary work for any > group >= group_misfit_task. We're comparing the two groups, and then > returning only if false (the group in question is not the busiest). > Othewise, we break, do an extra unnecessary conditional check that's > vacuously false for any group type > group_fully_busy, and then always > return true. > > Let's just return directly in the switch statement instead. This doesn't > change the size of vmlinux with llvm 17 (not surprising given that all > of this is inlined in load_balance()), but it does shrink load_balance() > by 88 bytes on x86. Given that it also improves readability, this seems > worth doing. > > As a bonus, remove an unnecessary goto in update_sd_lb_stats(). > Given that's a different scope than what the rest of the patch touches, I'd rather see this as a separate patch. Other than that: Reviewed-by: Valentin Schneider