5838 a Linux-like free(1M) would probably not be a bad thing

Review Request #657 — Created Sept. 6, 2017 and discarded

wiedi
illumos-gate
general

a "free" command to display memory usage

Executed inside global zone and non global zones with and without memory cap on OmniOS.

While testing this on OI I noticed that this depends on functionality not yet upstreamed from SmartoS:

commit f3861a7cccef3296d09052f75b91c493572fd94a "OS-399 zone phys. mem. cap should be a rctl and have associated kstat"

So this will have to wait.

Loading file attachments...

  • 0
  • 0
  • 10
  • 0
  • 10
Description From Last Updated
jbk
  1. 
      
  2. usr/src/cmd/free/free.c (Diff revision 1)
     
     

    Since swapctl isn't largefile aware, 32-bit versions of this this can fail w/ EOVERFLOW if there is > 4GB of swap configured. Traditional convention would be to build 32 & 64 bit versions and use /usr/lib/isaexec to invoke the correct version. swap(1) (among others) does this.

  3. 
      
yuripv
  1. 
      
  2. usr/src/cmd/free/free.c (Diff revision 1)
     
     

    Just use the extern const char *__progname, which libc does provide -- even if non-standard, it seems to be supported everywhere nowadays.

  3. usr/src/cmd/free/free.c (Diff revision 1)
     
     

    I guess here (and everywhere else) the stupid lint won't be happy about you not casting the return value to (void).

  4. usr/src/cmd/free/free.c (Diff revision 1)
     
     

    Don't think this is really needed, usage isn't intended for descriptions, even if someone thinks it is...

  5. usr/src/cmd/free/free.c (Diff revision 1)
     
     

    case indented same as switch.

  6. usr/src/cmd/free/free.c (Diff revision 1)
     
     

    Really, use err(3C) here instead, i.e. err(1, "get_free_info");, and drop the return (-1);

  7. usr/src/man/man1/free.1 (Diff revision 1)
     
     

    Use .Dd June 18, 2017, Mdocdate is OpenBSD stuff related to CVS.

  8. 
      
wiedi
yuripv
  1. 
      
  2. usr/src/man/man1/free.1 (Diff revision 2)
     
     

    .Op Fl b Ns | Ns Fl k Ns | Ns Fl m Ns | Ns Fl g Ns | Ns Fl h

  3. usr/src/man/man1/free.1 (Diff revision 2)
     
     

    Ugh...

    For zones with
    .Sy capped-memory
    .Po see
    .Xr zonecfg 1M
    .Pc
    usage is calculated
    
  4. usr/src/man/man1/free.1 (Diff revision 2)
     
     

    New sentence, new line, git nits will surely whine here.

    1. Oddly it did not, and I figured out that the reason seems to be the ")" character. Thanks for spotting this and the other improvements to the man page.

  5. 
      
wiedi
wiedi
wiedi
Review request changed

Status: Discarded

Loading...