From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 561FA5A026D for ; Thu, 25 Apr 2024 06:46:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714020405; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+/DCLEyY2Tw1KKsky/SKtFv3h8mQCL3TYJTpavXlhU=; b=ihxaCeWT0AfMRwSmyJ8R21vtXvPkDbSJd9WTBGO1J6fVGZ4PZU3hneneN7iDIas23pBqUQ t3gtW7MBxt6PAdzDyUoShDteRHorfbB2SL/G4QP4nZkurD0cTDfCV7OZmnKkjR9WoUXS2C eDwiFjCN/naj4ApDAHLWBvggCUQAUYY= 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-417-2nDZOsbgPyqkubDIZVWYiQ-1; Thu, 25 Apr 2024 00:46:43 -0400 X-MC-Unique: 2nDZOsbgPyqkubDIZVWYiQ-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-51978c8a4f6so412757e87.1 for ; Wed, 24 Apr 2024 21:46:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714020402; x=1714625202; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=h+/DCLEyY2Tw1KKsky/SKtFv3h8mQCL3TYJTpavXlhU=; b=Ufa18RvcikZrBG3yYwxJYit+JWhMn1YmylZ6I7cyDCwaj7sqdEQHKEiIvEPZaOeZHl C6Xp8Wm28x6tGVN9J60bJpx+INjlgr6Y2NCsjGk3iAm2wSvES8VSdhEm4sTSB4BhdBQJ lDtlqHS+PQ03bYqIaOM0OfW5P75yhj0CqNflFuh8gAwElP//hilYF9/j6aOIU/qc8ULT oh1dlwPJ4euJ88QOXmhSmzlATgvW8XO0DEsDY2B1uI+G3ZJMo8ua7rhGOkuM0ElL0feP 3Q+vWYjIkX7COXtgrM7XaKq6v4rJgovcBGdSayi1MjPSiEBslWIvEdsV/ZiB6G6VRAmU jqdw== X-Forwarded-Encrypted: i=1; AJvYcCXqow7RTWKakg/5StveCZF/VAK+re9UjEZbNAF4sBUESC//Ig+JL0At/QdOU9mF99YaHJjvHwpPRWMOYjYxdht2Mt11 X-Gm-Message-State: AOJu0Yyp1bOI2gsTMb+Oqj9zPpQyo8GtCMqzC+3q4Wr/tuelozjtATlh QBoiTY571LtghXyoIEtaVcHSITfbpYnDNIrHNc9gGZaQHHWukH3J8iOOdKuhje6YsZFo34ATy+Z nDH0sATmuH567lvv7WRUOjKSbF+Wq9++1exuBJB0GEbpphLBErQ== X-Received: by 2002:ac2:5dcc:0:b0:51a:bebb:68ee with SMTP id x12-20020ac25dcc000000b0051abebb68eemr2792247lfq.7.1714020401737; Wed, 24 Apr 2024 21:46:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrh/49A+7jqgNWihFAqBlhTYAjIPQ6Zid+JkzqWRoH2KiqFvkri8j79LpUczORzBPfp6uzBA== X-Received: by 2002:ac2:5dcc:0:b0:51a:bebb:68ee with SMTP id x12-20020ac25dcc000000b0051abebb68eemr2792234lfq.7.1714020401180; Wed, 24 Apr 2024 21:46:41 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id qt14-20020a170906ecee00b00a55be94ff38sm4007193ejb.201.2024.04.24.21.46.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2024 21:46:40 -0700 (PDT) Date: Thu, 25 Apr 2024 06:46:05 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 3/4] Split "auto" compression mode into its own path Message-ID: <20240425064605.2e3ffa81@elisabeth> In-Reply-To: References: <20240322022739.2746102-1-david@gibson.dropbear.id.au> <20240322022739.2746102-4-david@gibson.dropbear.id.au> <20240405201002.48d48651@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: A7AOKTRLGKZ6PUHZ5DYBJURFB7RSMJJY X-Message-ID-Hash: A7AOKTRLGKZ6PUHZ5DYBJURFB7RSMJJY X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: lvivier@redhat.com, passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Sat, 6 Apr 2024 14:06:39 +1100 David Gibson wrote: > On Fri, Apr 05, 2024 at 08:10:02PM +0200, Stefano Brivio wrote: > > On Fri, 22 Mar 2024 13:27:38 +1100 > > David Gibson wrote: > > > > > mbuto supports "auto" compression mode where we detect the fastest > > > compressor and use it. This is structured a bit oddly - cpio_compress() > > > first handles the case of an explicitly selected compressor, then handles > > > the auto-detected case, redundantly actually implementing the compression > > > once it has picked one. > > > > Yes, we don't want to risk keeping around several formats if the > > archives are big... but you're not changing this, right? > > I don't believe so, no. > > > > Make this a bit clearer: first handle the "auto" case by calling out to > > > the testing code, and using that to set the parameter for the specific > > > compression path. > > > > > > Signed-off-by: David Gibson > > > --- > > > mbuto | 53 ++++++++++++++++++++++++----------------------------- > > > 1 file changed, 24 insertions(+), 29 deletions(-) > > > > > > diff --git a/mbuto b/mbuto > > > index 49d032c..550f76e 100755 > > > --- a/mbuto > > > +++ b/mbuto > > > @@ -566,31 +566,11 @@ cpio_init() { > > > fi > > > } > > > > > > -# cpio_compress() - Compress archive, test available methods if none is selected > > > +# compress_select() - Try compressors and pick the fastest > > > > Now we can say we pick the fastest, but it's not clear in what: we care > > about decompression, so perhaps: > > > > # compress_select() - Try compressors and pick the fastest to decompress image > > > > ? > > I don't think that's accurate. AFAICT the code is selecting the > fastest to compress, not decompress, No, why? Look: __start=$("${CAT}" /proc/uptime) __start="${__start% *}" for _ in $("${SEQ}" 1 5); do "${CP}" "${compress_test1}" "${compress_test2}" ${__cmd} --force -d -c "${compress_test2}" > /dev/null done __end=$("${CAT}" /proc/uptime) __end="${__end% *}" see the '-d' there ('-c' is usually '--stdout'). > and I didn't change that. I agree that optimizing decompression > speed would make more sense. > > Honestly, I'm not really convinced that the auto mode is useful > anyway: even if we changed to decompression speed, the speed on the > location running mbuto isn't necessarily the same as on the target > doing the decompression (though given mbuto's usage model, it's > lkely). Well, it's exactly the intended usage -- any other usage would be rather tricky (at least, anything with a different architecture for the guest). That's how the current passt test suite uses it, too. And it really makes a difference if you're working with kselftests. -- Stefano