linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] s390: update for altered page_state structure
@ 2004-03-14 22:44 Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2004-03-14 22:44 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Gerald Schaefer, linux-kernel, schwidefsky


> ChangeSet 1.1630, 2004/03/14 13:49:59-08:00, akpm@osdl.org
>
>	[PATCH] s390: update for altered page_state structure
>	
>	From: Olaf Hering <olh@suse.de>
>	
>	This patch is needed on s390.
>
>
> # This patch includes the following deltas:
> #	           ChangeSet	1.1629  -> 1.1630 
> #	arch/s390/appldata/appldata_mem.c	1.1     -> 1.2    
> #	include/linux/page-flags.h	1.44    -> 1.45   
> #
>
> arch/s390/appldata/appldata_mem.c |   15 +++++++++++----
> include/linux/page-flags.h        |    3 +++
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
>
> diff -Nru a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
> --- a/arch/s390/appldata/appldata_mem.c	Sun Mar 14 14:12:59 2004
> +++ b/arch/s390/appldata/appldata_mem.c	Sun Mar 14 14:12:59 2004
> @@ -54,7 +54,9 @@
>  	u64 freeswap;		/* free swap space */
>  
>  // New in 2.6 -->
> -	u64 pgalloc;		/* page allocations */
> +	u64 pgalloc_high;	/* page allocations */
> +	u64 pgalloc_normal;
> +	u64 pgalloc_dma;
>  	u64 pgfault;		/* page faults (major+minor) */
>  	u64 pgmajfault;		/* page faults (major only) */
>  // <-- New in 2.6
> ...

Sorry, this does not look like the right fix. The structure is
effectively ABI, because it is accessed as binary data by the
VM hypervisor. If changes to it can't be avoided, the structure
version needs to be changed as well and all documentation and
VM applications using it must be updated.

In this specific case, it should be simple enough to just leave
the pgalloc field in place and write the sum of the real kernel
values (high+normal+dma) to it.

Gerald, can you please look into this?

      Arnd <><

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] s390: update for altered page_state structure
@ 2004-03-15 18:02 Gerald Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Gerald Schaefer @ 2004-03-15 18:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: olh, arnd, akpm, schwidefsky

On Sunday 14 March 2004 11:46, Arnd wrote:

> Sorry, this does not look like the right fix. The structure is
> effectively ABI, because it is accessed as binary data by the
> VM hypervisor. If changes to it can't be avoided, the structure
> version needs to be changed as well and all documentation and
> VM applications using it must be updated.
> 
> In this specific case, it should be simple enough to just leave
> the pgalloc field in place and write the sum of the real kernel
> values (high+normal+dma) to it.
> 
> Gerald, can you please look into this?

This patch fixes the problems introduced by Olaf's patch, please apply.
I have added some comments to the data gathering modules to avoid
future confusion and summarized the pgalloc counts as described above.

===== arch/s390/appldata/appldata_mem.c 1.2 vs edited =====
--- 1.2/arch/s390/appldata/appldata_mem.c	Sun Mar 14 20:17:11 2004
+++ edited/arch/s390/appldata/appldata_mem.c	Mon Mar 15 15:35:23 2004
@@ -27,6 +27,15 @@
 
 /*
  * Memory data
+ *
+ * This is accessed as binary data by z/VM. If changes to it can't be avoided,
+ * the structure version (product ID, see appldata_base.c) needs to be changed
+ * as well and all documentation and z/VM applications using it must be
+ * updated.
+ * 
+ * The record layout is documented in the Linux for zSeries Device Drivers
+ * book:
+ * http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml
  */
 struct appldata_mem_data {
 	u64 timestamp;
@@ -54,9 +63,7 @@
 	u64 freeswap;		/* free swap space */
 
 // New in 2.6 -->
-	u64 pgalloc_high;	/* page allocations */
-	u64 pgalloc_normal;
-	u64 pgalloc_dma;
+	u64 pgalloc;		/* page allocations */
 	u64 pgfault;		/* page faults (major+minor) */
 	u64 pgmajfault;		/* page faults (major only) */
 // <-- New in 2.6
@@ -71,9 +78,7 @@
 	P_DEBUG("pgpgout    = %8lu KB\n", mem_data->pgpgout);
 	P_DEBUG("pswpin     = %8lu Pages\n", mem_data->pswpin);
 	P_DEBUG("pswpout    = %8lu Pages\n", mem_data->pswpout);
-	P_DEBUG("pgalloc_high   = %8lu \n", mem_data->pgalloc_high);
-	P_DEBUG("pgalloc_normal = %8lu \n", mem_data->pgalloc_normal);
-	P_DEBUG("pgalloc_dma    = %8lu \n", mem_data->pgalloc_dma);
+	P_DEBUG("pgalloc    = %8lu \n", mem_data->pgalloc);
 	P_DEBUG("pgfault    = %8lu \n", mem_data->pgfault);
 	P_DEBUG("pgmajfault = %8lu \n", mem_data->pgmajfault);
 	P_DEBUG("sharedram  = %8lu KB\n", mem_data->sharedram);
@@ -109,14 +114,10 @@
 	mem_data->pgpgout    = ps.pgpgout >> 1;
 	mem_data->pswpin     = ps.pswpin;
 	mem_data->pswpout    = ps.pswpout;
-	mem_data->pgalloc_high   = ps.pgalloc_high;
-	mem_data->pgalloc_normal = ps.pgalloc_normal;
-	mem_data->pgalloc_dma    = ps.pgalloc_dma;
+	mem_data->pgalloc    = ps.pgalloc_high + ps.pgalloc_normal +
+			       ps.pgalloc_dma;
 	mem_data->pgfault    = ps.pgfault;
 	mem_data->pgmajfault = ps.pgmajfault;
-
-P_DEBUG("pgalloc_high = %lu, pgalloc_normal = %lu, pgalloc_dma = %lu, pgfree = %lu\n",
-	ps.pgalloc_high, ps.pgalloc_normal, ps.pgalloc_dma, ps.pgfree);
 
 	si_meminfo(&val);
 	mem_data->sharedram = val.sharedram;
===== arch/s390/appldata/appldata_net_sum.c 1.1 vs edited =====
--- 1.1/arch/s390/appldata/appldata_net_sum.c	Thu Feb 26 12:21:55 2004
+++ edited/arch/s390/appldata/appldata_net_sum.c	Mon Mar 15 15:35:59 2004
@@ -26,6 +26,14 @@
 
 /*
  * Network data
+ *
+ * This is accessed as binary data by z/VM. If changes to it can't be avoided,
+ * the structure version (product ID, see appldata_base.c) needs to be changed
+ * as well and all documentation and z/VM applications using it must be updated.
+ * 
+ * The record layout is documented in the Linux for zSeries Device Drivers
+ * book:
+ * http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml
  */
 struct appldata_net_sum_data {
 	u64 timestamp;
===== arch/s390/appldata/appldata_os.c 1.1 vs edited =====
--- 1.1/arch/s390/appldata/appldata_os.c	Thu Feb 26 12:21:55 2004
+++ edited/arch/s390/appldata/appldata_os.c	Mon Mar 15 15:35:04 2004
@@ -28,6 +28,15 @@
 
 /*
  * OS data
+ *
+ * This is accessed as binary data by z/VM. If changes to it can't be avoided,
+ * the structure version (product ID, see appldata_base.c) needs to be changed
+ * as well and all documentation and z/VM applications using it must be
+ * updated.
+ * 
+ * The record layout is documented in the Linux for zSeries Device Drivers
+ * book:
+ * http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml
  */
 struct appldata_os_per_cpu {
 	u32 per_cpu_user;	/* timer ticks spent in user mode   */
===== include/linux/page-flags.h 1.45 vs edited =====
--- 1.45/include/linux/page-flags.h	Sun Mar 14 20:17:11 2004
+++ edited/include/linux/page-flags.h	Mon Mar 15 13:10:26 2004
@@ -80,9 +80,6 @@
 /*
  * Global page accounting.  One instance per CPU.  Only unsigned longs are
  * allowed.
- *
- * NOTE: if this structure is changed then mm/page_alloc.c and
- * arch/s390/appldata/appldata_mem.c must be updated accordingly
  */
 struct page_state {
 	unsigned long nr_dirty;		/* Dirty writeable pages */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-15 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-14 22:44 [PATCH] s390: update for altered page_state structure Arnd Bergmann
2004-03-15 18:02 Gerald Schaefer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).