(no subject)

View: New views
9 Messages — Rating Filter:   Alert me  

(no subject)

by fish-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm not sure what the impact is yet, but I question the following
logic in service.c:


  /* We use an MP factor table of 95, 90, ... */
  /* the table has one entry less then the amount of installed cpus
ie t
   * there is no entry for the first cpu which is running at rcci
speed */
  for (i = 0; i < MAX_CPU-1; i++, sccbmpf++)
    STORE_HW(sccbmpf->mpfy, (95 - (i*5)));


- --
"Fish" (David B. Trout) - fish@...
Fight Spam! Join CAUCE! <http://www.cauce.org/>
7 reasons why HTML email is a bad thing
http://www.georgedillon.com/web/html_email_is_evil.shtml
PGP key fingerprints:
RSA: 6B37 7110 7201 9917 9B0D 99E3 55DB 5D58 FADE 4A52
DH/DSS: 9F9B BAB0 BA7F C458 1A89 FE26 48F5 D7F4 C4EE 3E2A

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBSjt1JUj11/TE7j4qEQIltACeOsk2BlQX90GLnB2eutzZRFQiPbkAoOeP
gbX5pc9q6traC/98SyDKkaB+
=LXBW
-----END PGP SIGNATURE-----


Re:

by Ivan Warren :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fish wrote:

>  
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm not sure what the impact is yet, but I question the following
> logic in service.c:
>
>
>   /* We use an MP factor table of 95, 90, ... */
>   /* the table has one entry less then the amount of installed cpus
> ie t
>    * there is no entry for the first cpu which is running at rcci
> speed */
>   for (i = 0; i < MAX_CPU-1; i++, sccbmpf++)
>     STORE_HW(sccbmpf->mpfy, (95 - (i*5)));
>
>  
The table describes MP factoring for use by STSI
Basically, we (arbitrarily) indicate that when we have 2 CPUS, each CPU
will be running at 95% efficiency, when there are 3 CPUs, each CPU will
be running at 90% efficiency, etc..

What do you find wrong with the code ?

--Ivan




[Non-text portions of this message have been removed]


MP factor table

by fish-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In hercules-390@..., Ivan Warren <ivan@...> wrote:

>
> Fish wrote:
> >  
> > I'm not sure what the impact is yet, but I question the following
> > logic in service.c:
> >
> >
> >   /* We use an MP factor table of 95, 90, ...     */
> >   /* the table has one entry less then the amount */
> >   /* of installed cpus ie t there is no entry for */
> >   /* the first cpu which is running at rcci speed */
> >
> >   for (i = 0; i < MAX_CPU-1; i++, sccbmpf++)
> >     STORE_HW(sccbmpf->mpfy, (95 - (i*5)));
> >
> >  
> The table describes MP factoring for use by STSI
> Basically, we (arbitrarily) indicate that when we
> have 2 CPUS, each CPU will be running at 95% efficiency,
> when there are 3 CPUs, each CPU will be running at 90%
> efficiency, etc..
>
> What do you find wrong with the code ?
>
> --Ivan

(Replying via crappy Yahoo interface until I can resolve my email issue...)


How many CPUs do we support?  :)




Re: MP factor table

by Ivan Warren :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David B. Trout wrote:
>
> How many CPUs do we support?  :)
>
>  
...32...

Doh ! Good point !

--Ivan


[Non-text portions of this message have been removed]


RE: MP factor table

by John P. Baker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ivan,

 

Rather than subtracting 5 for each additional CPU, why not decrement to zero
(i.e., -5 for the 2nd CPU, -4 for the 3rd CPU, -3 for the 4th CPU, -2 for
the 5th CPU, -1 for the 6th CPU, and no further reduction thereafter)?

 

This gives a maximum MP reduction of -15 for 6 or more CPUs?

 

It may not be wholly accurate, but I don't think that it would be
significantly out-of-line.

 

John P. Baker

 

From: hercules-390@... [mailto:hercules-390@...] On
Behalf Of Ivan Warren
Sent: Friday, June 19, 2009 11:55 AM
To: hercules-390@...
Subject: Re: [hercules-390] MP factor table

...32...

Doh ! Good point !

--Ivan



[Non-text portions of this message have been removed]


RE: MP factor table

by fish-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Proposed patch:


Index: control.c
===================================================================
- --- control.c (revision 5421)
+++ control.c (working copy)
@@ -6490,22 +6490,11 @@
 int        cputype;                     /* work                    
*/
 #endif /*defined(FEATURE_CONFIGURATION_TOPOLOGY_FACILITY)*/
 
- -
                            /*  "0    1    2    3    4    5    6  
7" */
 static BYTE hexebcdic[16] = {
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,
                            /*  "8    9    A    B    C    D    E  
F" */
                             
0xF8,0xF9,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6 };
 
- -                        /* x'004B' = 75 = 75% for each subsequent
cpu */
- -static BYTE mpfact[32*2] = {
0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B,
- -                            
0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B,
- -                            
0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B,
- -                            
0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B,
- -                            
0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B,
- -                            
0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B,
- -                            
0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B,
- -                             0x00,0x4B,0x00,0x4B,0x00,0x4B,0x00,0x4B
};
- -
 #define STSI_CAPABILITY   stsi_capability(regs)
 
     S(inst, regs, b2, effective_addr2);
@@ -6697,9 +6686,11 @@
                 STORE_HW(sysib122->totcpu, MAX_CPU);
                 STORE_HW(sysib122->confcpu, sysblk.cpus);
                 STORE_HW(sysib122->sbcpu, MAX_CPU - sysblk.cpus);
- -                memcpy(sysib122->mpfact,mpfact,(MAX_CPU-1)*2);
+                // memcpy(sysib122->mpfact,mpfact,(MAX_CPU-1)*2);
+                get_mpfactors((BYTE*)sysib122->mpfact);
                 STORE_FW(sysib122->accap, STSI_CAPABILITY);
- -                memcpy(sysib122->ampfact,mpfact,(MAX_CPU-1)*2);
+                //memcpy(sysib122->ampfact,mpfact,(MAX_CPU-1)*2);
+                get_mpfactors((BYTE*)sysib122->ampfact);
                 regs->psw.cc = 0;
                 break;
 
Index: hexterns.h
===================================================================
- --- hexterns.h (revision 5421)
+++ hexterns.h (working copy)
@@ -304,6 +304,7 @@
 void set_sysname(BYTE *name);
 void set_systype(BYTE *name);
 void set_sysplex(BYTE *name);
+void get_mpfactors(BYTE *dest);
 
 /* Functions in module impl.c */
 IMPL_DLL_IMPORT void system_cleanup(void);
Index: loadparm.c
===================================================================
- --- loadparm.c (revision 5421)
+++ loadparm.c (working copy)
@@ -276,3 +276,106 @@
 {
     memcpy(dst, sysplex, sizeof(sysplex));
 }
+
+/*-------------------------------------------------------------------
*/
+/* Retrieve Multiprocessing CPU-Capability Adjustment Factors      
*/
+/*                                                                  
*/
+/* This function retrieves the Multiprocessing CPU-Capability      
*/
+/* Adjustment Factor values for SYSIB (System Information Block)    
*/
+/* 1.2.2 as described in the Principles of Operations manual for    
*/
+/* the STORE SYSTEM INFORMATION instruction.                        
*/
+/*                                                                  
*/
+/* Input:                                                          
*/
+/*      dest  Address of where to store the information.            
*/
+/* Output:                                                          
*/
+/*      The requested MP Factor values at the address specified.    
*/
+/* Used by:                                                        
*/
+/*      B27D STSI  Store System Information (Basic-machine All CPUs)
*/
+/*      B220 SERVC Service Call             (read_scpinfo)          
*/
+/*-------------------------------------------------------------------
*/
+void get_mpfactors(BYTE *dest)
+{
+    /* APAR OA20135:
+
+       SUPPORT THE NEW MP FACTOR RANGE (0-65535) OF Z10 SERVERS
+
+       http://www-01.ibm.com/support/docview.wss?uid=isg1OA20135
+
+       Granularity in MP Factors:
+       The base MP factor has been changed on z10 servers from 255
+       to  65535 for better granularity.  SRM gets the MP Factors
+       from the STSI instruction and stores them in the control
+       blocks IRACCT (primary MP factors) and IRALCCT (secondary
+       MP factors).  STSI provides the MP factors from CPU 2-n and
+       the first MP factor is derived from the second.  Modules
+       IEAVNP10 and IRAEVSSI have now been changed to set the
+       first MP factor based on the second MP factor to 100, 255
+       or 65535.  If the second MP factor is greater than 100 then
+       the first MP factor will be set to 255, if it is greater
+       than 255 the first MP factor will be set to 65535, which is
+       the new base value.
+
+       ------------------------------------------------------------
+
+         Multiprocessing CPU-Capability Adjustment Fac-
+         tors: Beginning with bytes 0 and 1 of word 11, the
+         SYSIB contains a series  of contiguous two-byte
+         fields, each containing a 16-bit unsigned binary inte-
+         ger used to form an adjustment factor (fraction) for
+         the value contained in the CPU-capability field. Such
+         a fraction is developed by using the value (V) of the
+         first two-byte field according to one of the following
+         methods:
+
+         * If V is in the range 0<V<=100, a denominator of
+           100 is indicated which produces a fraction of
+           V/100.
+
+         * If V is in the range 101<=V<255, a denominator of
+           255 is indicated which produces a fraction of
+           V/255.
+
+         * If V is in the range 255<=V<65,536, a denominator
+           of 65,536 is indicated which produces a fraction
+           of V/65,536.
+
+         Thus, the fraction represented by each two-byte field
+         is then developed by dividing the contents of a two-
+         byte field by the indicated denominator.
+
+         The number of adjustment-factor fields is one less
+         than the number of CPUs specified in the total-CPU-
+         count field. The adjustment-factor fields correspond
+         to configurations with increasing numbers of CPUs in
+         the configured state. The first adjustment-factor field
+         corresponds to a configuration with two CPUs in the
+         configured state. Each successive adjustment-factor
+         field corresponds to a configuration with a number of
+         CPUs in the configured state that is one more than
+         that for the preceding field.
+    */
+
+#define  MPFACTOR_BASE_VALUE    65536
+#define  MPFACTOR_PERCENT       95
+
+    static U16 mpfactors[MAX_CPU_ENGINES-1] = {0};
+    static BYTE didthis = 0;
+
+    if (!didthis)
+    {
+        /* First time: initialize array... */
+        U32 mpfactor = MPFACTOR_BASE_VALUE;
+        int i;
+        for (i=0; i < arraysize( mpfactors ); i++)
+        {
+            /* Calculate the value of each subsequent entry
+               as percentage of the previous entry's value. */
+            mpfactor = (mpfactor * MPFACTOR_PERCENT) / 100;
+            mpfactors[i] = CSWAP16( (U16) mpfactor );
+        }
+        didthis = 1;
+    }
+
+    /* Return the requested information... */
+    memcpy( dest, &mpfactors[0], (MAX_CPU-1) * sizeof(U16) );
+}
Index: service.c
===================================================================
- --- service.c (revision 5421)
+++ service.c (working copy)
@@ -1300,12 +1300,9 @@
 #if defined(FEATURE_MPF_INFO)
         /* Define machine capacity */
         STORE_FW(sccbscp->rcci, 10000);
+        /* Fill in the MP Factors array */
         sccbmpf = (SCCB_MPF_INFO*)(sccbcpu);
- -        /* We use an MP factor table of 95, 90, ... */
- -        /* the table has one entry less then the amount of installed
cpus ie t
- -         * there is no entry for the first cpu which is running at
rcci speed */
- -        for (i = 0; i < MAX_CPU-1; i++, sccbmpf++)
- -            STORE_HW(sccbmpf->mpfy, (95 - (i*5)));
+        get_mpfactors((BYTE*)sccbmpf);
 #endif /*defined(FEATURE_MPF_INFO)*/
 
         /* Set response code X'0010' in SCCB header */



- --
"Fish" (David B. Trout) - fish@...
Fight Spam! Join CAUCE! <http://www.cauce.org/>
7 reasons why HTML email is a bad thing
http://www.georgedillon.com/web/html_email_is_evil.shtml
PGP key fingerprints:
RSA: 6B37 7110 7201 9917 9B0D 99E3 55DB 5D58 FADE 4A52
DH/DSS: 9F9B BAB0 BA7F C458 1A89 FE26 48F5 D7F4 C4EE 3E2A

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBSj80NEj11/TE7j4qEQJ3TQCfeFnITRUR6nOTDS56v7RA8fhlDssAniIa
DWrocGwZFp+6Xa71EzAZ/iq3
=JgVZ
-----END PGP SIGNATURE-----


Re: MP factor table

by Roger Bowler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday, June 22, 2009 Fish wrote:
> Proposed patch:
...
> - -                memcpy(sysib122->mpfact,mpfact,(MAX_CPU-1)*2);
> +                // memcpy(sysib122->mpfact,mpfact,(MAX_CPU-1)*2);
> +                get_mpfactors((BYTE*)sysib122->mpfact);
>                  STORE_FW(sysib122->accap, STSI_CAPABILITY);
> - -                memcpy(sysib122->ampfact,mpfact,(MAX_CPU-1)*2);
> +                //memcpy(sysib122->ampfact,mpfact,(MAX_CPU-1)*2);
> +                get_mpfactors((BYTE*)sysib122->ampfact);

When replacing statements, don't leave the old statement as a comment.
Subversion does a neater job of tracking changes and allowing them to
be reverted if necessary.


> +    /* APAR OA20135:
> +
> +       SUPPORT THE NEW MP FACTOR RANGE (0-65535) OF Z10 SERVERS
> +
> +       http://www-01.ibm.com/support/docview.wss?uid=isg1OA20135
> +

Do not include text of an IBM apar in the code. It could be regarded
as a copyright infringement, and at best it looks like plagiarism. If
necessary, you could simply refer to the apar number. But in this case
I don't think it's necessary since all of the information is in the
principles of operation manual.

> +            mpfactors[i] = CSWAP16( (U16) mpfactor );

To store a U16 into main storage in S/370 format, use STORE_HW not CSWAP16.

> +    /* Return the requested information... */
> +    memcpy( dest, &mpfactors[0], (MAX_CPU-1) * sizeof(U16) );

Functions which store into caller's storage without allowing the
caller to specify the maximum buffer length are considered to be a
potential security flaw (e.g. http://en.wikipedia.org/wiki/Gets)

All in all, I think this patch is over-engineered. It's fixing two
problems: (1) the current mp factors are wrong, and (2) the values are
inconsistent between STSI and SERVC. It would be sufficient just to
correct the values in the static table and have the table shared
between STSI and SERVC.

http://en.wikipedia.org/wiki/Occam%27s_Razor

P.S. Code changes are normally reviewed on the zHercules list.

--
Regards,
Roger Bowler
http://perso.wanadoo.fr/rbowler
Hercules "I can't believe it's not a mainframe!"


RE: MP factor table

by fish-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> P.S. Code changes are normally reviewed on the zHercules list.

I wouldn't accept a re-invitation even if you begged me.

- - --
"Fish" (David B. Trout) - fish@...
Fight Spam! Join CAUCE! <http://www.cauce.org/>
7 reasons why HTML email is a bad thing
http://www.georgedillon.com/web/html_email_is_evil.shtml
PGP key fingerprints:
RSA: 6B37 7110 7201 9917 9B0D 99E3 55DB 5D58 FADE 4A52
DH/DSS: 9F9B BAB0 BA7F C458 1A89 FE26 48F5 D7F4 C4EE 3E2A

- -----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBSj9pr0j11/TE7j4qEQK3GQCfaSOJotrfdqAl40DRk53aKOA7PtwAoJ2R
Ey2kbaaFVTp6vFfEQc9PBESt
=8wZr
- -----END PGP SIGNATURE-----

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBSj9pwUj11/TE7j4qEQJjjwCfdGW7sn5nsNyomvmoumyDUqL6NZIAn3qD
08XGeyxoyZmXhJ4KKI5JSUYQ
=1p5b
-----END PGP SIGNATURE-----


RE: MP factor table

by fish-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[...]
> [...] It would be sufficient just to correct
> the values in the static table and have the
> table shared between STSI and SERVC.

Be my guest.

- - --
"Fish" (David B. Trout) - fish@...
Fight Spam! Join CAUCE! <http://www.cauce.org/>
7 reasons why HTML email is a bad thing
http://www.georgedillon.com/web/html_email_is_evil.shtml
PGP key fingerprints:
RSA: 6B37 7110 7201 9917 9B0D 99E3 55DB 5D58 FADE 4A52
DH/DSS: 9F9B BAB0 BA7F C458 1A89 FE26 48F5 D7F4 C4EE 3E2A

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBSj/KDkj11/TE7j4qEQIWdQCffLD1pa7dM4mpd9knFfw3smTrZK4An1Xg
HU0JZt9dG5JT1SM+icxZcUi8
=squ2
-----END PGP SIGNATURE-----