From owner-svn-src-head@freebsd.org Sat Apr 15 03:12:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B9AED3ED85; Sat, 15 Apr 2017 03:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45738ABC; Sat, 15 Apr 2017 03:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id i5so17183045pfc.3; Fri, 14 Apr 2017 20:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=cFwOynXpsrq9KFOMYOXHT4+jWPP4juCGRefHRuAIkAM=; b=rcLlGrU8UxD1Pr82NK+qcxUqedfZ5TRllnZfxGeOnEj0txN0cZm3NzERl4sKFvp1BE i9PKHK+S/nbCs4XYF6Rdf090X2LJaDr8ekPIddcgUjogBhCCknfESVoPKzKptw72yQw0 oPMH+Xw8pmppHTLeSfpmdyt2ARRReetidmbZjC5suAe3a1Nhrg8FFd/ET300TTiiY2E9 ynhMzKQBw4YNMRKJrCEj7XjanGPfGgV1wcQfDzIJtMeIj0JwdR0zSmIMMpgmMFzGRk5y SoyfSDNY/HA+vuZqExP+vr3mIa1Vp9GvD8ppYtW6QsJhYLq5+hmUolRUTaGqhRMo3pp4 6//g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=cFwOynXpsrq9KFOMYOXHT4+jWPP4juCGRefHRuAIkAM=; b=Iq0i1uRycEw0RzDd+KjHH6lmn8FF4Xj+OGnyowHJ/FAVc+WGFa2D4J8U7XtiWvdZsk /lZNqk7k4L4PtLKzBRIfFY/Jt2hbojBKSt0amTFlB/1eROx8qGWxI6Mb0kuaiyKnfpxj RLeD7C6Ii1T4lHpUrs3JtY4WpoynpadQSTcpCzwmT6ZkD1z0yyRxnfEzCizAdoG9ervh 37Nc/DXogN8NMDp0yxMmpXBTt3HrYimPIfvDn04/VMtX/VWxaJ5uahfnwnpr7/cV66U6 tIAzLbMgaesBD5lCwbDV4M4eNfqOac9ES0ETrfs5EyaNxAIqcmTJq7pmGfB01gCl7p9R aohA== X-Gm-Message-State: AN3rC/7xJbLSTzGKS0EVbORNp2vDypGEQwF1hsa1qJy57WU9nnO0EnJ/ fsAACf8USWBDAur+89o= X-Received: by 10.99.223.70 with SMTP id h6mr764210pgj.50.1492225937633; Fri, 14 Apr 2017 20:12:17 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c3sm5462476pfg.46.2017.04.14.20.12.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 20:12:16 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201704150305.v3F35rNJ009780@pdx.rh.CN85.dnsmgr.net> Date: Fri, 14 Apr 2017 20:12:15 -0700 Cc: John Baldwin , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <1DC7F131-3EC6-4C59-8941-DC3EE77764C2@gmail.com> References: <201704150305.v3F35rNJ009780@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:12:18 -0000 --Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 20:05, Rodney W. Grimes = wrote: >=20 >>>=20 >>> On Apr 14, 2017, at 18:49, Rodney W. Grimes = wrote: >>>=20 >>>> On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: >>>>> Author: ngie >>>>> Date: Fri Apr 14 19:41:48 2017 >>>>> New Revision: 316938 >>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>>=20 >>>>> Log: >>>>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>>>=20 >>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>>> representable data to INT_MAX. Check the values received from >>>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>>> POLA. >>>>> - Use `KiB` instead of `kB` when describing free space, total = space, >>>>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>>=20 >>>> I will just rant lightly that no one actually uses this in the real = world. >>>>=20 >>>> Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin = drive. A >>>> kilobyte is a power of 2. The End. >>>>=20 >>>> (Next up we'll have to rename 4k displays to >>>> 4k) >>>=20 >>> Do we use KiB, MiB, GiB,... any place else in the system? I cant = think of >>> a place we do this, so please, lets not start doing this here? >>=20 >> humanize_number(3) from libutil uses IEC units. >=20 > And how many things bother to use this library function? Do the > ones that do call it produce the traditional output that has been > around for 40 years? >=20 >>> Yes, these are newer standards, perhaps some day we should make a = global >>> switch to them, but lets not start mixing and matching things. >>=20 >> I understand and agree. I?m not 100% sold on that one way or another, = but >> since I was going to redo the number representation in save core with >> humanize_number(3), because reading `KiB` is not = ideal > ^^^ > I hope we are not already reading KiB anyplace=E2=80=A6. I meant it=E2=80=99s a lot harder for humans to read = `KiB` instead of = ``. >> usability wise, and I don?t want to reinvent the wheel normalizing = numbers >> and printing out the unit. >>=20 >> Perhaps there should be a flag baked into humanize_number, etc for = parsing IEC vs non-IEC unit values? >=20 > I dont think it parses anything, but as far as producing strings from = values > it already has an IEC flag: HN_IEC_PREFIXES, please lets not use this = flag, > and if we are using it anyplace lets see if we can remove that use. I don=E2=80=99t see it used anywhere in the tree, based on a quick grep. > Also be careful, this function only accepts signed int 64, which means > we are not gona be able to use this in all places that probably need > this, so perhaps a larger can of paint for a bigger bike shead is = needed? I don=E2=80=99t necessarily follow the above statement 100%. Are you = warning against mass-conversion to libutil (if so, I agree=E2=80=A6 this = was just a case where it really helps readability in savecore(8))? Thanks! -Ngie --Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8Y+QAAoJEPWDqSZpMIYVX5kP/A0O7rb3xexdwfkxcWpizQG2 LqVrwCJfslZsuleUKtxWlaf1DH+uOBihXhlFYv5wjDBFkdw+fkzrQf9XdREElceF 35L7XOWZVvzriL2sBLH2VkK+xa9W2k60zJIRKefRtij1GDxvzq7EmoOFHZB6qUhk LAswQb2qrxdEhKJ8fHbKLBTTcYFm7/IQzUX61+lZiOtcsZ08iDCzW/NP6XBNoy26 VHwKGWUHcAp/fY4le80ie2NeLL96Av2TpSkDmTAKwI2qdGSV6eLkpgzf7AN8Y9HV A1YNuq1eC5LOAUnU7DuyT4Qaj96eDhpkRSMeFQ66OWIxCnxqby0HXPn2bvAN8TaM wPyC7GnvGZSTVUBtGumYMrWbdvz/zxRJGXwTKcoHpci+PPI6RlDUGmsE2dUZcLgo Xg+oh1wvp14JGl2woNmjmF7dlCZy7UjWjIT4bxw0EkKx20Vg0pIe1KDgUGSdAGDF lafih0LxFWO57hO3aa+bE/U5s0SeTN0uRmLQy3xQjD5Dx63INpJcOCMq2F6wqb3u E3vfiIuF1nhU2SYu67cL61R+haiG7rgUOZRFsWaOHIDrEbEYBG/pnevJNu+1DzeU tzomNMV1J2nK1aMc97Y28eiEe9soFiQOP5lq0HHSbU4G+B+OI8tp1hm8Q/D4MlPb 59fBblARl1BM9i6qsIHC =QKDO -----END PGP SIGNATURE----- --Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68--