From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.toke.dk (mail.toke.dk [45.145.95.4]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id A53943CB38 for ; Sun, 7 Apr 2024 12:10:06 -0400 (EDT) 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 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> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Cake] [PATCH net-next] net: sched: cake: Optimize number of calls to cake_heapify() X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Apr 2024 16:10:06 -0000 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