Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp908123lqe; Sun, 7 Apr 2024 09:10:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLzZUSjonKbeNHzUM5u8Ga/bHZbRBe1LQ1BCoshB3t9EY2OGUVgGTS/bNsblNrTKx66yxZgKRvtvfB2qXJPunuE2SFcSOEXJTSu9dW+w== X-Google-Smtp-Source: AGHT+IFjJVzwr6XgZOAyc95K+7Yctr9qfvCsDVIvCVjDDmpdOtUH642Z8FaXsomeGwVm+ncacj5g X-Received: by 2002:a17:903:1d2:b0:1e3:cf18:7335 with SMTP id e18-20020a17090301d200b001e3cf187335mr6480569plh.6.1712506227928; Sun, 07 Apr 2024 09:10:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712506227; cv=pass; d=google.com; s=arc-20160816; b=Tx/eLKCF0NZM7ou5dUe1JOPzsCNkRyoB0I7v05TGRh+dRGaRv/SwnyroRes3WwfCUg mLex2yvXsfRr3zGs6GgheEvjVcyA9JHYdOWhJUUygO1Sf0kCvRRtfp7RjBogzAyAL2w3 WXB3+l4L8IS7+WvNes18J5/trs8XLEuax81ZFo446gtV8AslRv+wBwqQr0AiGmDUjL5U uk21iL525hGS3A+OfRe9dj3wpg9B59a59muXQKdwIu6yOFLIoDGG4pMpBk72GaifldbD yHEQ1w7dqza/Q1b26wmAmaZgomprOswXLh+IYC6L2B3qOChHQ4S0eorKvo3yrtXuz5xe 7oWg== 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:dkim-signature :from; bh=jRHmiYZioEwTqHzvjz9ABYHfiTrjg7+dvZ5R454o5LU=; fh=TzIoB/6DY0VcRO1znsOhO2wRnIy8wlPouvV6e/ttnww=; b=z7ylBrWqTnVS5KyVlX/587uEC/xSQTJLjCYEeOcyUZEXHovBKKX4GNQ+/xESD5M+De 6wPYwBBRlYYncVrQfHdTbZ8UqttBFTV4bRjRQwtLAacRJN8JW6HjMC0mdd0MzzgEPqI/ i86PznXMZm9uBekmlUhLWXN15uhxc7c3V3QK/i5klYpUNsmFYPbCQtijJWJraRneb4U4 W/F0YEKCLBs87rzJR/4534uYGIIIszlfTE1ncXsf41Bnf4l/PBqHhuH4oUdjE485NKso qVv4LuNmvgpBSk0gKu2nU+Rja+Yx8MO4s6dqvvGWFCQzNH1kezhm42owTsSXGuEJ8obC GPLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=CeTS4FKg; arc=pass (i=1 spf=pass spfdomain=toke.dk dkim=pass dkdomain=toke.dk dmarc=pass fromdomain=toke.dk); spf=pass (google.com: domain of linux-kernel+bounces-134541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jc1-20020a17090325c100b001dd8be49c72si4681884plb.292.2024.04.07.09.10.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 09:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134541-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=@toke.dk header.s=20161023 header.b=CeTS4FKg; arc=pass (i=1 spf=pass spfdomain=toke.dk dkim=pass dkdomain=toke.dk dmarc=pass fromdomain=toke.dk); spf=pass (google.com: domain of linux-kernel+bounces-134541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk 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 98DC028218F for ; Sun, 7 Apr 2024 16:10:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 491183A1BF; Sun, 7 Apr 2024 16:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toke.dk header.i=@toke.dk header.b="CeTS4FKg" Received: from mail.toke.dk (mail.toke.dk [45.145.95.4]) (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 5043B37149; Sun, 7 Apr 2024 16:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.145.95.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712506219; cv=none; b=kvDedg7a6zKedRPzCsbuaFMaBOvVyQZUR8oILkKlSOvN9JGklHkRhi52X0uOAh07EN7WUI9p4q8/KXxbZm/0GRMtFEaHC85CZllS5xtFSkG4Qot+PHUkNvEszx1mjPARsCMgMiqR2hT3OUvhjb8zymQnrEqbKgwpTHi5sO+zIa0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712506219; c=relaxed/simple; bh=jRHmiYZioEwTqHzvjz9ABYHfiTrjg7+dvZ5R454o5LU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=PHKQjb5rZlNc7O0UZRQu41pyHpBXO3oXq5ON2QbsVTszfZ8I9kKapq7ow9NTwRuL/TnKLCcIWru2YmBL1mxifZMo/s9WL/XnCOG+pIvbSNzyTnrl4zp0DICpK37ZRlgf058rlFdDzSqDbD+WZcQBpWgsCozNOWsGQFrO4Z3LZZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=toke.dk; spf=pass smtp.mailfrom=toke.dk; dkim=pass (2048-bit key) header.d=toke.dk header.i=@toke.dk header.b=CeTS4FKg; arc=none smtp.client-ip=45.145.95.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=toke.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=toke.dk From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1712506205; bh=jRHmiYZioEwTqHzvjz9ABYHfiTrjg7+dvZ5R454o5LU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CeTS4FKglAx+piMHVKigJkdCDiiM1bokhQAM9Q5pZWIb4AZP+M8uh0y3zUBI2swey 1Y5rmf+F3PYKcb9ngrPTadUwe4m0mcsAZwO5BFsGhxXgr1473SlczVyX3X5UnHfDJJ FXDPz2t98/zRjgjTMPNDtQZAdA1PX7RidonG7j1GvTXUETxWSBWweovpu7gzxd6I63 1nGtkjqQoyWImhDp3OTfoVGhybpPro2b0nSgpM+GzeWtMzEOau/1QrpHHIyj5ftP6b rQk3oes8bDqLriOLkddTTpQ8gr+NIVy38njV5/ZB06gQKu/hg44FZR6kQtVDAHwUA0 hqdD0pk/c5FWA== To: Kuan-Wei Chiu Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jserv@ccns.ncku.edu.tw, cake@lists.bufferbloat.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kuan-Wei Chiu Subject: Re: [PATCH net-next] net: sched: cake: Optimize number of calls to cake_heapify() In-Reply-To: <20240406235532.613696-1-visitorckw@gmail.com> References: <20240406235532.613696-1-visitorckw@gmail.com> Date: Sun, 07 Apr 2024 18:10:04 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87frvxgnmr.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Kuan-Wei Chiu writes: > Improve the max-heap construction process by reducing unnecessary > heapify operations. Specifically, adjust the starting condition from > n / 2 to n / 2 - 1 in the loop that iterates over all non-leaf > elements. Please add an explanation for why this change is correct, and why it is beneficial. "Improve" and "unnecessary" is way too implicit. pw-bot: cr