From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ns3gz-0006iO-UA for mharc-grub-devel@gnu.org; Fri, 20 May 2022 10:33:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ns3gx-0006gX-DQ for grub-devel@gnu.org; Fri, 20 May 2022 10:33:23 -0400 Received: from mail.efficios.com ([167.114.26.124]:46614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ns3gv-0005Vi-6g for grub-devel@gnu.org; Fri, 20 May 2022 10:33:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 0BF463EF238; Fri, 20 May 2022 10:33:20 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Z77BLsfDV8hT; Fri, 20 May 2022 10:33:19 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 64BDD3EEFF2; Fri, 20 May 2022 10:33:19 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 64BDD3EEFF2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1653057199; bh=8xPnOLmKVJ5XOSwe+zheV6XjxnRJv6Qs65iMB+obKvY=; h=Date:From:To:Message-ID:MIME-Version; b=uh2QS7PaXdJt8o/+VNl1lurXKDi3jrY0I5UZD4tEA7NDmKEgBpb5UFut0LcjMQLE8 YjfG8gvfNSGMntdXfcn7zRR0jEBVlHJW/8qOkCwOFDju92qSz0o0ve+KD+ACLzp9ka qgdyRt1Jxce9g4UIKfc+waCk1zXZiGKq8Kk/N9ucr9/y6k+4q20IlAJ4thFBifFU3/ BoHRcv3BUdlR9YKefPF+tdDwFuc/lsH01bcT0d0Y6Nhplmts1QfY0js8VmNGNrVTR6 +K9IuckSolRskJ8NWhsdLrCsGnet1pFUEQxsG/ztxrQm0Fs7cDUmqn8uLI6oZIGJQf C3XjGapBZNQVQ== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LCgQDJKN9BIC; Fri, 20 May 2022 10:33:19 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 555653EEEF5; Fri, 20 May 2022 10:33:19 -0400 (EDT) Date: Fri, 20 May 2022 10:33:19 -0400 (EDT) From: Mathieu Desnoyers To: Daniel Kiper Cc: Daniel Kiper , Vladimir phcoder Serbinenko , grub-devel , Paul Menzel , Robbie Harwood , samuel thibault Message-ID: <698479817.63912.1653057199221.JavaMail.zimbra@efficios.com> In-Reply-To: <20220520110106.dwnarpdvvgwmgv5u@tomti.i.net-space.pl> References: <20220505142456.58107-1-mathieu.desnoyers@efficios.com> <20220519183603.i2i4qz67ume3eagd@tomti.i.net-space.pl> <1711366171.63066.1652993574862.JavaMail.zimbra@efficios.com> <20220520110106.dwnarpdvvgwmgv5u@tomti.i.net-space.pl> Subject: Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4257 (ZimbraWebClient - FF100 (Linux)/8.8.15_GA_4257) Thread-Topic: grub-mkconfig linux: Fix quadratic algorithm for sorting menu items Thread-Index: ayBPy6SM3t3qTbCfkTTeGEZS2JJp4A== Received-SPF: pass client-ip=167.114.26.124; envelope-from=compudj@efficios.com; helo=mail.efficios.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2022 14:33:24 -0000 ----- On May 20, 2022, at 7:01 AM, Daniel Kiper dkiper@net-space.pl wrote: > On Thu, May 19, 2022 at 04:52:54PM -0400, Mathieu Desnoyers wrote: >> ----- On May 19, 2022, at 2:36 PM, Daniel Kiper dkiper@net-space.pl wrote: >> [...] >> > >> > Could you do the same in util/grub.d/20_linux_xen.in? Both should be >> > kept in sync. And you are not first one who updates 10_linux.in only. >> > If you could make a patch which adds something like "Keep logic in sync >> > with..." to the util/grub.d/10_linux.in and util/grub.d/20_linux_xen.in >> > that would be perfect. >> >> AFAIU, 20_linux_xen.in does: >> >> while [ "x${xen_list}" != "x" ] ; do >> list="${linux_list}" >> current_xen=`version_find_latest $xen_list` >> [....] >> while [ "x$list" != "x" ] ; do >> linux=`version_find_latest $list` >> [...] >> list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '` >> done >> if [ x"$is_top_level" != xtrue ]; then >> echo ' }' >> fi >> xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '` >> done >> >> Which adds yet another loop iterating on each item of "xen_list". For each of >> those, >> there is an iteration on "linux_list". >> >> I can do the change, like I can do the change for other OSes, but I don't have >> the environment to test those changes. Would you be OK if I submit an untested >> patch for someone else to try out ? > > In case of Xen I think you can CC xen-devel@lists.xenproject.org and ask > for help there. I'll do that. > >> I notice that 10_hurd.in and 10_kfreebsd.in also have the exact same inefficient >> pattern. > > I think Samuel, CC-ed, could help with Hurd. Samuel? Just CC him when > you send next patch. Will do. > > I am not sure who could help with FreeBSD. I'll try debian-bsd@lists.debian.org > >> Would you be OK if I also change them and let the change be tested by those who >> have >> those environments ? > > Yeah, it is OK. > > FYI, I am going to push at the beginning of next week Oskari's patch > which updates both util/grub.d/10_linux.in and util/grub.d/20_linux_xen.in. > So, please hold on with posting your patches until then to avoid > conflicts later. Considering that I'll take some vacation starting end of next week, and hoping we can get Tested-by tags on the other environment, I would prefer to send another round of RFC patches today. I don't mind rebasing next week to submit a final version. By the way, after taking care of linux, linux_xen, hurd, and kfreebsd, I notice that I can remove the helper functions version_find_latest(), version_test_gt(), and version_test_numeric() from grub-mkconfig_lib.in as a cleanup patch. I'll queue that as well unless anyone objects. Thanks! Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com