From: Stefan Lendl <s.lendl@proxmox.com>
To: Roland <devzero@web.de>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: fix large number processing
Date: Thu, 29 Feb 2024 16:23:45 +0100 [thread overview]
Message-ID: <87jzmn8fb2.fsf@gmail.com> (raw)
In-Reply-To: <813667cc-81b6-46db-b144-54ee4cc578f6@web.de>
Roland <devzero@web.de> writes:
> Hi Stefan,
>
> looks good for me so far and indeed, on very large system when VMs eat
> up >2TB this could hit the limit very soon.
>
> but shouldn't we add some newline , as the original "print sum" prints one ?
>
> root@s740:/usr/sbin# seq 1 100000 | awk '{ sum += $1 }; END { print sum }'
> 5.00005e+09
> root@s740:/usr/sbin# seq 1 100000 | awk '{ sum += $1 }; END { printf
> ("%.0f", sum) }'
> 5000050000root@s740:/usr/sbin#
>
> # seq 1 100000 | awk '{ sum += $1 }; END { print sum }'|xxd
> 00000000: 352e 3030 3030 3565 2b30 390a 5.00005e+09.
>
> # seq 1 100000 | awk '{ sum += $1 }; END { printf ("%.0f", sum) }' |xxd
> 00000000: 3530 3030 3035 3030 3030 5000050000
>
> # seq 1 100000 | awk '{ sum += $1 }; END { printf ("%.0f\n", sum) }' |xxd
> 00000000: 3530 3030 3035 3030 3030 0a 5000050000.
>
I see that this appears different in that way.
In the script the result is always assigned to a variable which should
not care about a newline, or should even better be without the newline
in my opinion.
prev parent reply other threads:[~2024-02-29 15:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 10:56 Stefan Lendl
[not found] ` <c3d7bba9-73b0-46b0-ad72-94139afc0559@web.de>
2024-02-29 7:52 ` Thomas Lamprecht
2024-04-08 12:04 ` Stefan Lendl
2024-04-08 12:22 ` Thomas Lamprecht
2024-04-08 13:02 ` Stefan Lendl
[not found] ` <6104c230-7e2e-43ae-8598-6c458b979ae1@web.de>
2024-02-29 15:12 ` Stefan Lendl
2024-02-29 15:16 ` Stefan Lendl
[not found] ` <813667cc-81b6-46db-b144-54ee4cc578f6@web.de>
2024-02-29 15:23 ` Stefan Lendl [this message]
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=87jzmn8fb2.fsf@gmail.com \
--to=s.lendl@proxmox.com \
--cc=devzero@web.de \
--cc=pve-devel@lists.proxmox.com \
--cc=t.lamprecht@proxmox.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal