Thread (7 messages) 7 messages, 4 authors, 2018-08-07

Re: [PATCH] proc: add percpu populated pages count to meminfo

flat view

From: Dennis Zhou <hidden>
Date: 2018-08-07 15:03:35
Also in: linux-api, lkml

Hi Vlastimil,

On Tue, Aug 07, 2018 at 03:18:31PM +0200, Vlastimil Babka wrote:
Documentation/filesystems/proc.txt should be updated as well
Will do.
quoted
 
+/*
+ * The number of populated pages in use by the allocator, protected by
+ * pcpu_lock.  This number is kept per a unit per chunk (i.e. when a page gets
+ * allocated/deallocated, it is allocated/deallocated in all units of a chunk
+ * and increments/decrements this count by 1).
+ */
+static int pcpu_nr_populated;
It better be unsigned long, to match others.
Yeah that makes sense. I've changed this for v2.
quoted
+/*
+ * pcpu_nr_populated_pages - calculate total number of populated backing pages
+ *
+ * This reflects the number of pages populated to back the chunks.
+ * Metadata is excluded in the number exposed in meminfo as the number of
+ * backing pages scales with the number of cpus and can quickly outweigh the
+ * memory used for metadata.  It also keeps this calculation nice and simple.
+ *
+ * RETURNS:
+ * Total number of populated backing pages in use by the allocator.
+ */
+int pcpu_nr_populated_pages(void)
Also unsigned long please.
Changed for v2.

Thanks,
Dennis
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help