From ca2ec0c5cc73242a2a1d3863293c1fe647d6cc81 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Aug 2018 19:16:42 +0200 Subject: [PATCH] Revert "Use allocation granularity as the 'page_size' in /proc//status as well, for consistency with /proc//statm" This reverts commit 8a32c24a7bdb0f3d80daa8f267cc63d15edcf771. Replacing page_size() with allocation_granularity() was incorrect. The values returned by get_mem_values() are # of pages of size page_size(). Multiplying with allocation_granularity() here results in values 16 times too big. --- winsup/cygwin/fhandler_process.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 8df55ece9..cbadea164 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -1216,7 +1216,7 @@ format_process_status (void *data, char *&destbuf) if (!get_mem_values (p->dwProcessId, &vmsize, &vmrss, &vmtext, &vmdata, &vmlib, &vmshare)) return 0; - unsigned page_size = wincap.allocation_granularity (); + unsigned page_size = wincap.page_size (); vmsize *= page_size; vmrss *= page_size; vmdata *= page_size; vmtext *= page_size; vmlib *= page_size; /* The real uid value for *this* process is stored at cygheap->user.real_uid