It turns out we (you) were not the first ones running into it. The IBM
mainframe guys (obviously) have the same need to potentially allow many
CPUs. The upstream discussion is here:
https://lkml.org/lkml/2014/5/21/251

So, while the change I made does work in this case, it can cause issues. 
Firstly /proc/stat uses a open_single interface. That means the proc file is 
not seekable and has no iterator. So all output has to be done in one go. And 
that means the buffer _has_ to be big enough to hold all output. Which means 
the part that limits the maximum size to order-3 allocations can cause issue on 
systems that really have a lot of CPUs.
The other part of changing the buffer from holding x*possible number of CPUs to 
x*online CPUs was also thought of in the upstream thread. The problem there is 
that between open (buffer gets allocated) and show (buffer is filled) it is 
possible than a bunch of CPUs are set online. So one needs to be extra careful 
what would happen then.

Sounds like the most likely outcome could be to have a vmalloc fallback
option. But the discussion does not seem to be finished, yet.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1319244

Title:
  iostat: Cannot open /proc/stat: Cannot allocate memory

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1319244/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to