From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: lvivier@redhat.com, passt-dev@passt.top
Subject: Re: [PATCH 3/4] Split "auto" compression mode into its own path
Date: Thu, 25 Apr 2024 06:46:05 +0200 [thread overview]
Message-ID: <20240425064605.2e3ffa81@elisabeth> (raw)
In-Reply-To: <ZhC8P6tyQcGiqNvN@zatzit>
On Sat, 6 Apr 2024 14:06:39 +1100
David Gibson <david@gibson.dropbear.id.au> 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 <david@gibson.dropbear.id.au> 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 <david@gibson.dropbear.id.au>
> > > ---
> > > 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
next prev parent reply other threads:[~2024-04-25 4:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 2:27 [PATCH 0/4] mbuto: Assorted fixes and simplifications David Gibson
2024-03-22 2:27 ` [PATCH 1/4] ${wd} is always set, no need to test for it David Gibson
2024-03-22 2:27 ` [PATCH 2/4] Remove stale archivemount support David Gibson
2024-04-05 18:09 ` Stefano Brivio
2024-04-06 3:02 ` David Gibson
2024-04-25 4:47 ` Stefano Brivio
2024-04-26 1:44 ` David Gibson
2024-03-22 2:27 ` [PATCH 3/4] Split "auto" compression mode into its own path David Gibson
2024-04-05 18:10 ` Stefano Brivio
2024-04-06 3:06 ` David Gibson
2024-04-25 4:46 ` Stefano Brivio [this message]
2024-04-26 1:46 ` David Gibson
2024-03-22 2:27 ` [PATCH 4/4] Remove unnecessary cpio_init function David Gibson
2024-04-05 18:08 ` Stefano Brivio
2024-04-06 3:11 ` David Gibson
2024-04-25 4:46 ` Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240425064605.2e3ffa81@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).