Skip to contentSkip to conversation

2.6.8.1: display committed memory limit and available in meminfo

PATCH In review Frank Hirtz 1 participant 3 messages Aug 19, 2004 – Sep 14, 2004 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6.8.1: display committed memory limit and available in meminfo

The following patch will have the committed memory limit (per the current overcommit ratio) and the amount of memory remaining under this limit displayed in meminfo.

It's presently somewhat difficult to use the strict memory overcommit settings as it's somewhat difficult to determine the amount of memory remaining under the cap. This patch would make using strict overcommit a good bit simpler. Does such an addition seem reasonable?

Thank you,

Frank.

fs/proc/proc_misc.c +7 -1
@@ -153,7 +153,7 @@
 				 int count, int *eof, void *data)
 {
 	struct sysinfo i;
-	int len, committed;
+	int len, committed, allowed;
 	struct page_state ps;
 	unsigned long inactive;
 	unsigned long active;
@@ -171,6 +171,8 @@
 	si_meminfo(&i);
 	si_swapinfo(&i);
 	committed = atomic_read(&vm_committed_space);
+	allowed = ((totalram_pages - hugetlb_total_pages()) 
+		* sysctl_overcommit_ratio / 100) + total_swap_pages;
 
 	vmtot = (VMALLOC_END-VMALLOC_START)>>10;
 	vmi = get_vmalloc_info();
@@ -198,7 +200,9 @@
 		"Writeback:    %8lu kB\n"
 		"Mapped:       %8lu kB\n"
 		"Slab:         %8lu kB\n"
+		"CommitLimit:  %8lu kB\n"
 		"Committed_AS: %8u kB\n"
+		"CommitAvail:  %8ld kB\n"
 		"PageTables:   %8lu kB\n"
 		"VmallocTotal: %8lu kB\n"
 		"VmallocUsed:  %8lu kB\n"
@@ -220,7 +224,9 @@
 		K(ps.nr_writeback),
 		K(ps.nr_mapped),
 		K(ps.nr_slab),
+		K(allowed),
 		K(committed),
+		K(allowed - committed),
 		K(ps.nr_page_table_pages),
 		vmtot,
 		vmi.used,
#1 lore raw

Hi,

I'm new to the list, and was wondering since I've not seen any feedback on this patch whether that was because the patch is not good/a good idea or whether no one has an opinion on displaying this information. I'd like to get this included and any feedback would be greatly appreciated.

Thanks again,

Frank.

Quoted 51 lines · Frank Hirtz

The following patch will have the committed memory limit (per the current overcommit ratio) and the amount of memory remaining under this limit displayed in meminfo.

It's presently somewhat difficult to use the strict memory overcommit settings as it's somewhat difficult to determine the amount of memory remaining under the cap. This patch would make using strict overcommit a good bit simpler. Does such an addition seem reasonable?

Thank you,

Frank.

------------------------------------------------------------------------

fs/proc/proc_misc.c +7 -1
@@ -153,7 +153,7 @@
 				 int count, int *eof, void *data)
 {
 	struct sysinfo i;
-	int len, committed;
+	int len, committed, allowed;
 	struct page_state ps;
 	unsigned long inactive;
 	unsigned long active;
@@ -171,6 +171,8 @@
 	si_meminfo(&i);
 	si_swapinfo(&i);
 	committed = atomic_read(&vm_committed_space);
+	allowed = ((totalram_pages - hugetlb_total_pages()) 
+		* sysctl_overcommit_ratio / 100) + total_swap_pages;
 
 	vmtot = (VMALLOC_END-VMALLOC_START)>>10;
 	vmi = get_vmalloc_info();
@@ -198,7 +200,9 @@
 		"Writeback:    %8lu kB\n"
 		"Mapped:       %8lu kB\n"
 		"Slab:         %8lu kB\n"
+		"CommitLimit:  %8lu kB\n"
 		"Committed_AS: %8u kB\n"
+		"CommitAvail:  %8ld kB\n"
 		"PageTables:   %8lu kB\n"
 		"VmallocTotal: %8lu kB\n"
 		"VmallocUsed:  %8lu kB\n"
@@ -220,7 +224,9 @@
 		K(ps.nr_writeback),
 		K(ps.nr_mapped),
 		K(ps.nr_slab),
+		K(allowed),
 		K(committed),
+		K(allowed - committed),
 		K(ps.nr_page_table_pages),
 		vmtot,
 		vmi.used,
#2 lore raw
Quoted 9 lines
Quoted 7 lines

The following patch will have the committed memory limit (per the current overcommit ratio) and the amount of memory remaining under this limit displayed in meminfo.

It's presently somewhat difficult to use the strict memory overcommit settings as it's somewhat difficult to determine the amount of memory remaining under the cap. This patch would make using strict overcommit a good bit simpler. Does such an addition seem reasonable?

Thank you,

Frank.

Quoted 11 lines · Frank Hirtz

Hi,

I'm new to the list, and was wondering since I've not seen any feedback on this patch whether that was because the patch is not good/a good idea or whether no one has an opinion on displaying this information. I'd like to get this included and any feedback would be greatly appreciated.

Thanks again,

Frank.

Hearing no feedback on this, I'd like to request that this patch be included in the stock kernel release. As always, any feedback is appreciated.

Thank you again,

Frank.

fs/proc/proc_misc.c +7 -1
@@ -153,7 +153,7 @@
 				 int count, int *eof, void *data)
 {
 	struct sysinfo i;
-	int len, committed;
+	int len, committed, allowed;
 	struct page_state ps;
 	unsigned long inactive;
 	unsigned long active;
@@ -171,6 +171,8 @@
 	si_meminfo(&i);
 	si_swapinfo(&i);
 	committed = atomic_read(&vm_committed_space);
+	allowed = ((totalram_pages - hugetlb_total_pages()) 
+		* sysctl_overcommit_ratio / 100) + total_swap_pages;
 
 	vmtot = (VMALLOC_END-VMALLOC_START)>>10;
 	vmi = get_vmalloc_info();
@@ -198,7 +200,9 @@
 		"Writeback:    %8lu kB\n"
 		"Mapped:       %8lu kB\n"
 		"Slab:         %8lu kB\n"
+		"CommitLimit:  %8lu kB\n"
 		"Committed_AS: %8u kB\n"
+		"CommitAvail:  %8ld kB\n"
 		"PageTables:   %8lu kB\n"
 		"VmallocTotal: %8lu kB\n"
 		"VmallocUsed:  %8lu kB\n"
@@ -220,7 +224,9 @@
 		K(ps.nr_writeback),
 		K(ps.nr_mapped),
 		K(ps.nr_slab),
+		K(allowed),
 		K(committed),
+		K(allowed - committed),
 		K(ps.nr_page_table_pages),
 		vmtot,
 		vmi.used,