[lkml]   [2014]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: fs/stat: Reduce memory requirements for stat_open
On Thu, Jun 12, 2014 at 03:00:17PM +0200, Stefan Bader wrote:
> When reading from /proc/stat we allocate a large buffer to maximise
> the chances of the results being from a single run and thus internally
> consistent. This currently is sized at 128 * num_possible_cpus() which,
> in the face of kernels sized to handle large configurations (256 cpus
> plus), results in the buffer being an order-4 allocation or more.
> When system memory becomes fragmented these cannot be guarenteed, leading
> to read failures due to allocation failures.
> There seem to be two issues in play here. Firstly the allocation is
> going to be vastly over sized in the common case, as we only consume the
> buffer based on the num_online_cpus(). Secondly, regardless of size we
> should not be requiring allocations greater than PAGE_ALLOC_COSTLY_ORDER
> as allocations above this order are significantly more likely to fail.
> The following patch addesses both of these issues. Does that make sense
> generally? It seemed to stop top complaining wildly for the reporter
> at least.

Hi Stefan,

see also

and one possible solution:

and the other one:


 \ /
  Last update: 2014-06-12 16:21    [W:0.065 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site