Re: ld.so speedup for large binaries with many shared libraries

2011-04-27 Thread Antoine Jacoutot
On Sat, 23 Apr 2011, Dale Rahn wrote:

> Here is a diff that was originally hatched at c2k10 and finally implemented
> at k2k11. This has been tested lightly so needs to be tested on all systems
> with big and small programs.
> 
> On some machines this can shave 15% off of the startup time of large
> applications with lots of dynamically loaded libraries.
> 
> Please test and let me know if there are any problems found.
> 
> Yes I am intentionally cross posting this to ports@ as large ports
> are the most affected by this diff.
> 
> Maybe this will finally get ajacoutot@ off my back ;)

Heh ;-)

Anyway, I've been running with several variations of that diff on 
some machines (i386 and macppc) for several weeks without seeing any 
regressions.
And I can confirm large beasts do benefit from it.

-- 
Antoine



Re: apply(1) small cleanup

2011-04-27 Thread Nicholas Marriott
Er saying "pointless" was a little impolite so apologies for that.



On Wed, Apr 27, 2011 at 11:32:19PM +0100, Nicholas Marriott wrote:
> __dead is in sys/cdefs.h, it is portable for OpenBSD and outside it is
> only a #define away.
> 
> Anyway diff seems a little pointless but fine, so ok nicm
> 
> 
> 
> On Wed, Apr 27, 2011 at 02:18:52PM +0500, Mark Lumsden wrote:
> > On Tue, Apr 26, 2011 at 05:59:45AM -0700, patrick keshishian wrote:
> > > On Tue, Apr 26, 2011 at 09:13:08PM +0500, Mark Lumsden wrote:
> > > > Make a "Private" function private and other things. ok?
> > > > 
> > > > -mark
> > > > 
> > > > 
> > > > Index: apply.c
> > > > ===
> > > > RCS file: /cvs/src/usr.bin/apply/apply.c,v
> > > > retrieving revision 1.24
> > > > diff -u -p -r1.24 apply.c
> > > > --- apply.c 27 Oct 2009 23:59:35 -  1.24
> > > > +++ apply.c 26 Apr 2011 09:40:48 -
> > > > @@ -44,8 +44,8 @@
> > > >  #include 
> > > >  #include 
> > > >  
> > > > -void   usage(void);
> > > > -intmysystem(const char *);
> > > > +static voidusage(void);
> > > 
> > > +__dead void  usage(void);
> > > 
> > 
> > is __dead portable across all compilers/archs?
> > 
> > -mark
> > PS I see it sprinkled through the src tree though.



Re: apply(1) small cleanup

2011-04-27 Thread Nicholas Marriott
__dead is in sys/cdefs.h, it is portable for OpenBSD and outside it is
only a #define away.

Anyway diff seems a little pointless but fine, so ok nicm



On Wed, Apr 27, 2011 at 02:18:52PM +0500, Mark Lumsden wrote:
> On Tue, Apr 26, 2011 at 05:59:45AM -0700, patrick keshishian wrote:
> > On Tue, Apr 26, 2011 at 09:13:08PM +0500, Mark Lumsden wrote:
> > > Make a "Private" function private and other things. ok?
> > > 
> > > -mark
> > > 
> > > 
> > > Index: apply.c
> > > ===
> > > RCS file: /cvs/src/usr.bin/apply/apply.c,v
> > > retrieving revision 1.24
> > > diff -u -p -r1.24 apply.c
> > > --- apply.c   27 Oct 2009 23:59:35 -  1.24
> > > +++ apply.c   26 Apr 2011 09:40:48 -
> > > @@ -44,8 +44,8 @@
> > >  #include 
> > >  #include 
> > >  
> > > -void usage(void);
> > > -int  mysystem(const char *);
> > > +static   voidusage(void);
> > 
> > +__dead voidusage(void);
> > 
> 
> is __dead portable across all compilers/archs?
> 
> -mark
> PS I see it sprinkled through the src tree though.



Re: alc(4) support for Atheros AR815x

2011-04-27 Thread Jonathan Gray
On Tue, Jan 25, 2011 at 06:24:28PM +0800, Kevin Lo wrote:
> Hi,
> 
> The following diff adds support for Atheros AR8151/AR8152 chipsets;
> mostly from FreeBSD. It also fixes an issue i386/6311.
> Tested on Acer AOD255E.

Is there an updated diff for this?  It seems this never made it
into the tree.



Re: attach acpithinkpad on newer lenovo thinkpads

2011-04-27 Thread Marco Peereboom
sure

On Wed, Apr 27, 2011 at 03:36:44PM -0500, joshua stein wrote:
> this attaches acpithinkpad to newer lenovo thinkpads like the x120e.
> 
> hw.sensors.acpithinkpad0.temp0=57.00 degC
> hw.sensors.acpithinkpad0.temp1=0.00 degC
> hw.sensors.acpithinkpad0.temp2=57.00 degC
> hw.sensors.acpithinkpad0.temp3=0.00 degC
> hw.sensors.acpithinkpad0.temp4=0.00 degC
> hw.sensors.acpithinkpad0.temp5=0.00 degC
> hw.sensors.acpithinkpad0.temp6=27.00 degC
> hw.sensors.acpithinkpad0.temp7=0.00 degC
> hw.sensors.acpithinkpad0.fan0=335 RPM
> 
> 
> Index: acpi.c
> ===
> RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
> retrieving revision 1.223
> diff -u -p -u -p -r1.223 acpi.c
> --- acpi.c22 Apr 2011 18:22:01 -  1.223
> +++ acpi.c27 Apr 2011 20:32:46 -
> @@ -2328,7 +2328,8 @@ acpi_foundhid(struct aml_node *node, voi
>   aaa.aaa_name = "acpibtn";
>   else if (!strcmp(dev, ACPI_DEV_ASUS))
>   aaa.aaa_name = "acpiasus";
> - else if (!strcmp(dev, ACPI_DEV_THINKPAD)) {
> + else if (!strcmp(dev, ACPI_DEV_IBM) ||
> + !strcmp(dev, ACPI_DEV_LENOVO)) {
>   aaa.aaa_name = "acpithinkpad";
>   acpi_thinkpad_enabled = 1;
>   } else if (!strcmp(dev, ACPI_DEV_ASUSAIBOOSTER))
> Index: acpireg.h
> ===
> RCS file: /cvs/src/sys/dev/acpi/acpireg.h,v
> retrieving revision 1.24
> diff -u -p -u -p -r1.24 acpireg.h
> --- acpireg.h 4 Jan 2011 21:17:49 -   1.24
> +++ acpireg.h 27 Apr 2011 20:32:47 -
> @@ -713,7 +713,8 @@ struct acpi_ivrs {
>  #define ACPI_DEV_THZ "THERMALZONE"   /* Thermal Zone */
>  #define ACPI_DEV_FFB "FIXEDBUTTON"   /* Fixed Feature Button */
>  #define ACPI_DEV_ASUS"ASUS010"   /* ASUS Hotkeys */
> -#define ACPI_DEV_THINKPAD "IBM0068"  /* ThinkPad support */
> +#define ACPI_DEV_IBM "IBM0068"   /* IBM ThinkPad support */
> +#define ACPI_DEV_LENOVO  "LEN0068"   /* Lenovo ThinkPad support */
>  #define ACPI_DEV_ASUSAIBOOSTER   "ATK0110"   /* ASUSTeK AI Booster */
>  
>  #endif   /* !_DEV_ACPI_ACPIREG_H_ */
> Index: acpithinkpad.c
> ===
> RCS file: /cvs/src/sys/dev/acpi/acpithinkpad.c,v
> retrieving revision 1.25
> diff -u -p -u -p -r1.25 acpithinkpad.c
> --- acpithinkpad.c2 Jan 2011 04:56:57 -   1.25
> +++ acpithinkpad.c27 Apr 2011 20:32:47 -
> @@ -114,7 +114,9 @@ struct cfdriver acpithinkpad_cd = {
>   NULL, "acpithinkpad", DV_DULL
>  };
>  
> -const char *acpithinkpad_hids[] = { ACPI_DEV_THINKPAD, 0 };
> +const char *acpithinkpad_hids[] = {
> + ACPI_DEV_IBM, ACPI_DEV_LENOVO, 0
> +};
>  
>  int
>  thinkpad_match(struct device *parent, void *match, void *aux)
> 
> 
> 
> OpenBSD 4.9-current (GENERIC.MP) #6: Thu Dec 31 18:16:11 CST 2009
> j...@re.superblock.net:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> RTC BIOS diagnostic error 80
> real mem = 3867213824 (3688MB)
> avail mem = 3750223872 (3576MB)
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xf9ba0 (60 entries)
> bios0: vendor LENOVO version "8FET27WW (1.11 )" date 03/24/2011
> bios0: LENOVO 05962RU
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP SLIC HPET APIC MCFG UEFI UEFI SSDT SSDT UEFI
> acpi0: wakeup devices PB4_(S4) PB5_(S4) PB6_(S4) PB7_(S4) OHC1(S3) EHC1(S3) 
> OHC2(S3) EHC2(S3) OHC3(S3) EHC3(S3) OHC4(S3) SBAZ(S4) GEC_(S4) P2P_(S5) 
> SPB0(S4) SPB1(S4) SPB2(S4) SPB3(S4) LID_(S4)
> acpitimer0 at acpi0: 3579545 Hz, 32 bits
> acpihpet0 at acpi0: 14318180 Hz
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: AMD E-350 Processor, 1597.52 MHz
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,SSSE3,CX16,POPCNT,NXE,MMXX,FFXSR,LONG
> cpu0: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 512KB 
> 64b/line 16-way L2 cache
> cpu0: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
> cpu0: apic clock running at 199MHz
> cpu1 at mainbus0: apid 1 (application processor)
> cpu1: AMD E-350 Processor, 1596.60 MHz
> cpu1: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,SSSE3,CX16,POPCNT,NXE,MMXX,FFXSR,LONG
> cpu1: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 512KB 
> 64b/line 16-way L2 cache
> cpu1: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
> ioapic0 at mainbus0: apid 2 pa 0xfec0, version 21, 24 pins
> ioapic0: misconfigured as apic 0, remapped to apid 2
> acpimcfg0 at acpi0 addr 0xf800, bus 0-31
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus -1 (PB4_)
> acpiprt2 at acpi0: bus -1 (PB5_)
> acpiprt3 at acpi0: bus 1 (PB6_)
> acpiprt4 at acpi0: bus -1 (PB7_)
> acpiprt5 at acpi0: bus 2 (P2P_)
> acpiprt6 at acpi0: bus 3

Soporte Tecnico Ilimitado para Empresas

2011-04-27 Thread Soluciones Tecnicas
Tienes problemas con los computadores o laptops de tu empresa ?
Tu internet y Equipos son muy lentos ?
Tu empresa se para constantemente por que no funciona nada ?
Tu sistema siempre se cae.!!!
TENEMOS LA SOLUCION TECNICA PARA TODAS TUS SITUACIONES INFORMATICAS
Llamanos ahora mismo para hacerte una asesoria totalmente GRATIS
8093792096
www.infoservicesrd.com
Infoservices es una empresa especializada en  Servidores, Redes y
Comunicaciones con un alto nivel tC)cnico dedicado al crecimiento de su
empresa. Nuestra gran experiencia esta a su disposiciC3n
www.infoservicesrd.com

Contamos con el mejor sistema de soporte del paC-s, ayudando a su empresa a
que no se detenga por situaciones informC!ticas. www.soporterd.com

ComunC-cate con nosotros ahora mismo para informarte sobre nuestros planes de
Soporte TC)cnico
809 3792096

ven...@infoservicesrd.com



attach acpithinkpad on newer lenovo thinkpads

2011-04-27 Thread joshua stein
this attaches acpithinkpad to newer lenovo thinkpads like the x120e.

hw.sensors.acpithinkpad0.temp0=57.00 degC
hw.sensors.acpithinkpad0.temp1=0.00 degC
hw.sensors.acpithinkpad0.temp2=57.00 degC
hw.sensors.acpithinkpad0.temp3=0.00 degC
hw.sensors.acpithinkpad0.temp4=0.00 degC
hw.sensors.acpithinkpad0.temp5=0.00 degC
hw.sensors.acpithinkpad0.temp6=27.00 degC
hw.sensors.acpithinkpad0.temp7=0.00 degC
hw.sensors.acpithinkpad0.fan0=335 RPM


Index: acpi.c
===
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.223
diff -u -p -u -p -r1.223 acpi.c
--- acpi.c  22 Apr 2011 18:22:01 -  1.223
+++ acpi.c  27 Apr 2011 20:32:46 -
@@ -2328,7 +2328,8 @@ acpi_foundhid(struct aml_node *node, voi
aaa.aaa_name = "acpibtn";
else if (!strcmp(dev, ACPI_DEV_ASUS))
aaa.aaa_name = "acpiasus";
-   else if (!strcmp(dev, ACPI_DEV_THINKPAD)) {
+   else if (!strcmp(dev, ACPI_DEV_IBM) ||
+   !strcmp(dev, ACPI_DEV_LENOVO)) {
aaa.aaa_name = "acpithinkpad";
acpi_thinkpad_enabled = 1;
} else if (!strcmp(dev, ACPI_DEV_ASUSAIBOOSTER))
Index: acpireg.h
===
RCS file: /cvs/src/sys/dev/acpi/acpireg.h,v
retrieving revision 1.24
diff -u -p -u -p -r1.24 acpireg.h
--- acpireg.h   4 Jan 2011 21:17:49 -   1.24
+++ acpireg.h   27 Apr 2011 20:32:47 -
@@ -713,7 +713,8 @@ struct acpi_ivrs {
 #define ACPI_DEV_THZ   "THERMALZONE"   /* Thermal Zone */
 #define ACPI_DEV_FFB   "FIXEDBUTTON"   /* Fixed Feature Button */
 #define ACPI_DEV_ASUS  "ASUS010"   /* ASUS Hotkeys */
-#define ACPI_DEV_THINKPAD "IBM0068"/* ThinkPad support */
+#define ACPI_DEV_IBM   "IBM0068"   /* IBM ThinkPad support */
+#define ACPI_DEV_LENOVO"LEN0068"   /* Lenovo ThinkPad support */
 #define ACPI_DEV_ASUSAIBOOSTER "ATK0110"   /* ASUSTeK AI Booster */
 
 #endif /* !_DEV_ACPI_ACPIREG_H_ */
Index: acpithinkpad.c
===
RCS file: /cvs/src/sys/dev/acpi/acpithinkpad.c,v
retrieving revision 1.25
diff -u -p -u -p -r1.25 acpithinkpad.c
--- acpithinkpad.c  2 Jan 2011 04:56:57 -   1.25
+++ acpithinkpad.c  27 Apr 2011 20:32:47 -
@@ -114,7 +114,9 @@ struct cfdriver acpithinkpad_cd = {
NULL, "acpithinkpad", DV_DULL
 };
 
-const char *acpithinkpad_hids[] = { ACPI_DEV_THINKPAD, 0 };
+const char *acpithinkpad_hids[] = {
+   ACPI_DEV_IBM, ACPI_DEV_LENOVO, 0
+};
 
 int
 thinkpad_match(struct device *parent, void *match, void *aux)



OpenBSD 4.9-current (GENERIC.MP) #6: Thu Dec 31 18:16:11 CST 2009
j...@re.superblock.net:/usr/src/sys/arch/amd64/compile/GENERIC.MP
RTC BIOS diagnostic error 80
real mem = 3867213824 (3688MB)
avail mem = 3750223872 (3576MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xf9ba0 (60 entries)
bios0: vendor LENOVO version "8FET27WW (1.11 )" date 03/24/2011
bios0: LENOVO 05962RU
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SLIC HPET APIC MCFG UEFI UEFI SSDT SSDT UEFI
acpi0: wakeup devices PB4_(S4) PB5_(S4) PB6_(S4) PB7_(S4) OHC1(S3) EHC1(S3) 
OHC2(S3) EHC2(S3) OHC3(S3) EHC3(S3) OHC4(S3) SBAZ(S4) GEC_(S4) P2P_(S5) 
SPB0(S4) SPB1(S4) SPB2(S4) SPB3(S4) LID_(S4)
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpihpet0 at acpi0: 14318180 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD E-350 Processor, 1597.52 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,SSSE3,CX16,POPCNT,NXE,MMXX,FFXSR,LONG
cpu0: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD E-350 Processor, 1596.60 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,SSSE3,CX16,POPCNT,NXE,MMXX,FFXSR,LONG
cpu1: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu1: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 21, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 2
acpimcfg0 at acpi0 addr 0xf800, bus 0-31
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PB4_)
acpiprt2 at acpi0: bus -1 (PB5_)
acpiprt3 at acpi0: bus 1 (PB6_)
acpiprt4 at acpi0: bus -1 (PB7_)
acpiprt5 at acpi0: bus 2 (P2P_)
acpiprt6 at acpi0: bus 3 (SPB0)
acpiprt7 at acpi0: bus 4 (SPB1)
acpiprt8 at acpi0: bus -1 (SPB2)
acpiprt9 at acpi0: bus -1 (SPB3)
acpiec0 at acpi0
acpicpu0 at acpi0: C2, PSS
acpicpu1 at acpi0: C2, PSS
acpitz0 at acpi0: critical temperature 92 degC
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi

Novedades de politica y gestión #5

2011-04-27 Thread Guillermo Justo Chaves
Guillermo  Justo Chaves en la Feria del Libro El
próximo JUEVES 28 DE ABRIL DE 18 A 19  HS. ,
el Director del INCAP, Guillermo Justo Chaves, va  a
dar una charla en el marco de la Feria del Libro. El
 tema que se abordará es :”El legado del Presidente
 Kirchner a la Argentina y a las nuevas generaciones”. Ver
 Mas   EL PERONISMO. 
NECESIDAD DE DEBATE Y ACTUALIZACION. Una visión generacional Las
polémicas y los debates acerca de la identidad   
  del peronismo han sido un clásico desde la aparición
 misma del movimiento nacional. La astucia del
“Viejo”  en su última etapa o del
“General” en  su momento de esplendor;
su habilidad allá por  mediados del siglo
pasado, para sintetizar las diferentes  corrientes
ideológicas que confluían en  el culto
a la personalidad del tremendo líder, 
hicieron que todo esté dentro de ese gran proyecto   
  nacional y popular.  Ese momento original arrancó  
 con una lógica de la praxis, es decir, primero  
 el acceso del Coronel Perón al poder, luego de  
 constituirse como el abanderado de un nuevo actor, que 
  pasaría a ser el “sujeto
histórico”:el trabajador. A
través de la incorporaciónal
sistema político de una cantidad de argentinos   
que miraban -parafraseando a Discepolín- 
  con “la ñata contra el vidrio” el país  
 de las vaquitas y el trigo, se fue construyendo otra   
realidad, otra “verdad”. Las grandes
conquistaspolíticas, sociales,
económicas y -porque no- culturales, una
vez que pasaron a formar partedel acervo de los
nuevos sujetos, se comenzaron a plasmaren un
cuerpo de doctrina. VerMas
www.guillermochaves.com.ar conta...@guillermochaves.com.ar



Sitios web a bajos costos

2011-04-27 Thread depagina...@gmail.com
Diseqo de sitios web

Diseqo DePaginasWeb

Un sitio web trabaja las 24 horas los 365 dias del aqo, las posibilidades
de darse a conocer y mejorar su posicion en el mercado son inmensas si
sabe aprovecharlas a su favor.

Sitio Web Insitucional

Obtenga su sitio web institucional para empresas a bajos costos.

Sitio Web PYMES

Obtenga su sitio para PYMES y hagase a conocer en Internet y el mundo.

Tienda Virtual

Obtenga su Tienda Virtual y venda sus productos a potenciales clientes.

DePaginasWeb. Telifono: 4582-4002 / 4583-5006. Mail:
i...@depaginasweb.com.ar

Para desuscribirse haga click aqui

---



Re: spurious sys/types.h include in man pages

2011-04-27 Thread Amit Kulkarni
Ok thanks.

On Wed, Apr 27, 2011 at 12:20 AM, Theo de Raadt  wrote:
>> Maybe I am missing something but the following manpages don't really need
>> sys/types.h.
>
> you are wrong.
>
> You are only trying on OpenBSD.
>
> If only everything was OpenBSD.
>
> However, everything is not OpenBSD.



[Private Photo Share] Cali Girl- Has sent you private photos.

2011-04-27 Thread carlicbufriends
I do not want the entire group seeing these photos.Because some may recognize
me. Here's the link:

http://losley.zoomshare.com/files/friend.htm



Joan Manuel Serrat - Discografía mas Pendrive de Regalo - (38 Álbumes)

2011-04-27 Thread Discos MP3 - Solo de Oferta
Como  Ho Fa El Vent o   S   
   Una  Guitarra  O   q
Canço  de matinada  oAra Que Tinc
Vint Anys EP i   Cançons 
Tradicionals o   S La, La, Lao o   s Manuel. Single o  Per  
   Sant Joan. Single o   Antonio
 Machado S   Mare  Lola o  o   Penelope.
 Single o   Como
 Un Gorrion. Single o   o  Mi Niñez o   o Serrat 4  n   Lucia.   
  Single  o  Mediterraneo S   Miguel
 Hernandez  Per  Al Meu Amic
e  Cancion  Infantil  Edurne.   
   Single  Para  Piel De
Manzana  ResNo Es Mesquí  o  
1978 o  Talcom  raja  En
TransitooCada Loco  Con Su Tema  Ara
   Que Tinc Vint Anys  El   
  Sur Tambien Existe o   Sinceramente Teu o   o Bienaventurados o  
Material Sensible o   Nadie  Es Perfecto The
 o  Banda  Sonora D'un Temps D'un
Paìs  Serrat  y Sabina Dos Pajaros De
Un Tiro  Sombras De China  oVersos  En La
Boca o   Sinfonico o   Mô   o



Re: macppc: support for Dynamic Frequency Switching

2011-04-27 Thread Martin Pieuchot
On 27/04/11(Wed) 12:41, Martin Pieuchot wrote:
> On 26/04/11(Tue) 18:29, Martin Pieuchot wrote:
> > The following diff adds support for dfs. It requires my precedent patch
> > about GPIOs. I don't have a machine with a MPC7448 so it's only tested
> > with a MPC7447A.
> > 
> > I'm also interested in various device-tree dumps for further development.
> > If you can send me yours, contact me off list.
> 
> Updated diff, correct the voltage offset in case the value of the reg
> property is relative to the gpio controller offset.

As pointed by landry@ I didn't explain what's dfs. Dynamic Frequency
Switching, aka dfs, is a feature available (at least) in the MPC7447A
and MPC7448 processors that adds the ability to divide the processor bus
ratio. Concretely it allows you to reduce the speed and power consumption
on some Apple G4 machine. 

For example, the difference here on an ibook G4:

-hw.sensors.adt0.volt1=1.54 VDC (Vccp)
+hw.sensors.adt0.volt1=1.29 VDC (Vccp)
 hw.sensors.adt0.volt2=3.28 VDC (Vcc)
 hw.sensors.adt0.volt3=0.00 VDC (+5V)
 hw.sensors.adt0.volt4=0.00 VDC (+12V)
-hw.cpuspeed=1333
-hw.setperf=100
+hw.cpuspeed=666
+hw.setperf=0

You can check if your machine supports it by looking for the
cpu-vcore-select node in your openfirmware dump:

$ eeprom -p |grep vcore

Regards,
Martin



Re: malloc: speed vs randomization

2011-04-27 Thread Otto Moerbeek
On Tue, Apr 26, 2011 at 09:13:47PM +0200, Otto Moerbeek wrote:

> On Tue, Apr 26, 2011 at 10:09:23AM -0400, Ted Unangst wrote:
> 
> > On Tue, Apr 26, 2011 at 9:33 AM, Otto Moerbeek  wrote:
> > > This diff implements a tradeoff to gain speed at the cost of reducing
> > > the randomness of chunk allocation in malloc slightly.
> > >
> > > The idea is only to randomize the first half of chunks in a page. The
> > > second half of chunks will fill in the gaps in-order. The
> > > effectiveness of the current randomization decreases already with the
> > > number of free slots diminishing in a page.
> > >
> > > In one test case, this diff reduced the runtime from 31s to 25s. I'm
> > > not completely sure if the reduced randomness is acceptable. But if
> > 
> > Perhaps a quarter?  We want to prevent adjacent consecutive
> > allocations, which is still very likely at the half way point, but
> > diminishes after that.
> 
> Yes, that might be better, though you some of the performance gain is
> lost because you are scanning a lot of bits: i free bits + all bits in
> between that are not free. If a chunk page is pretty full, that's a
> lot of bits before you find the i'th free chunk. 
> 
> Originally I though most of the time was lost getting the random bits,
> but now it seems the scanning of the bits is to blame. Unless I'm
> misinterpreting my data
> 
>   -Otto

Second version of diff. This is a conservative one, i.e. it does not
change randomization in any way. The diff achieves a speedup by:

- Move from long units to short, making the test for a complete non-free
unit more effective.

- In the randomization loop, also consider whole units instead of always
doing it bit by bit. 


-Otto

Index: malloc.c
===
RCS file: /cvs/src/lib/libc/stdlib/malloc.c,v
retrieving revision 1.127
diff -u -p -r1.127 malloc.c
--- malloc.c16 Dec 2010 18:47:01 -  1.127
+++ malloc.c27 Apr 2011 07:43:43 -
@@ -138,7 +138,7 @@ struct dir_info {
  *
  * How many bits per u_long in the bitmap
  */
-#define MALLOC_BITS(NBBY * sizeof(u_long))
+#define MALLOC_BITS(NBBY * sizeof(u_short))
 struct chunk_info {
LIST_ENTRY(chunk_info) entries;
void *page; /* pointer to the page */
@@ -148,7 +148,7 @@ struct chunk_info {
u_short free;   /* how many free chunks */
u_short total;  /* how many chunk */
/* which chunks are free */
-   u_long bits[(MALLOC_PAGESIZE / MALLOC_MINSIZE) / MALLOC_BITS];
+   u_short bits[(MALLOC_PAGESIZE / MALLOC_MINSIZE) / MALLOC_BITS];
 };
 
 struct malloc_readonly {
@@ -958,10 +958,10 @@ omalloc_make_chunks(struct dir_info *d, 
 
/* Do a bunch at a time */
for (; (k - i) >= MALLOC_BITS; i += MALLOC_BITS)
-   bp->bits[i / MALLOC_BITS] = ~0UL;
+   bp->bits[i / MALLOC_BITS] = (u_short)~0U;
 
for (; i < k; i++)
-   bp->bits[i / MALLOC_BITS] |= 1UL << (i % MALLOC_BITS);
+   bp->bits[i / MALLOC_BITS] |= (u_short)1U << (i % MALLOC_BITS);
 
LIST_INSERT_HEAD(&d->chunk_dir[bits], bp, entries);
 
@@ -982,7 +982,7 @@ malloc_bytes(struct dir_info *d, size_t 
 {
int i, j;
size_t  k;
-   u_long  u, *lp;
+   u_short u, *lp;
struct chunk_info *bp;
 
if (mopts.malloc_canary != (d->canary1 ^ (u_int32_t)(uintptr_t)d) ||
@@ -1026,22 +1026,26 @@ malloc_bytes(struct dir_info *d, size_t 
}
 
/* advance a random # of positions */
-   i = getrnibble() % bp->free;
-   while (i > 0) {
-   u += u;
-   k++;
-   if (k >= MALLOC_BITS) {
-   lp++;
-   u = 1;
-   k = 0;
-   }
-   if (lp - bp->bits > (bp->total - 1) / MALLOC_BITS) {
-   wrterror("chunk overflow", NULL);
-   errno = EFAULT;
-   return (NULL);
+   if (bp->free > 1) {
+   i = getrnibble() % bp->free;
+   while (i > 0) {
+   u += u;
+   k++;
+   if (k >= MALLOC_BITS) {
+   while (!*++lp)
+   /* EMPTY */;
+   u = 1;
+   k = 0;
+   if (lp - bp->bits > (bp->total - 1) /
+   MALLOC_BITS) {
+   wrterror("chunk overflow", NULL);
+   errno = EFAULT;
+   return (NULL);
+   }
+   }
+   if (*lp & u)
+   i--;
}
-  

Re: macppc: support for Dynamic Frequency Switching

2011-04-27 Thread Martin Pieuchot
On 26/04/11(Tue) 18:29, Martin Pieuchot wrote:
> The following diff adds support for dfs. It requires my precedent patch
> about GPIOs. I don't have a machine with a MPC7448 so it's only tested
> with a MPC7447A.
> 
> I'm also interested in various device-tree dumps for further development.
> If you can send me yours, contact me off list.

Updated diff, correct the voltage offset in case the value of the reg
property is relative to the gpio controller offset.


Index: dev/dfs.c
===
RCS file: dev/dfs.c
diff -N dev/dfs.c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ dev/dfs.c   27 Apr 2011 07:06:17 -
@@ -0,0 +1,160 @@
+/* $OpenBSD$   */
+/*
+ * Copyright (c) 2011 Martin Pieuchot 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#defineDFS2(1 << 22)   /* Divide-by-Two */
+#defineDFS4(1 << 23)   /* Divide-by-Four (MPC7448 Specific) */
+
+extern int perflevel;
+static int voltage;
+
+intdfs_match(struct device *, void *, void *);
+void   dfs_attach(struct device *, struct device *, void *);
+void   dfs_setperf(int);
+void   dfs_scale_frequency(u_int);
+
+struct cfattach dfs_ca = {
+   sizeof(struct device), dfs_match, dfs_attach
+};
+
+struct cfdriver dfs_cd = {
+   NULL, "dfs", DV_DULL
+};
+
+int
+dfs_match(struct device *parent, void *arg, void *aux)
+{
+   struct confargs *ca = aux;
+   uint16_t cpu;
+
+   if (strcmp(ca->ca_name, "cpu-vcore-select") != 0)
+   return (0);
+
+   cpu = ppc_mfpvr() >> 16;
+   if (cpu == PPC_CPU_MPC7447A || cpu == PPC_CPU_MPC7448)
+   return (1);
+
+   return (0);
+}
+
+void
+dfs_attach(struct device *parent, struct device *self, void *aux)
+{
+   struct confargs *ca = aux;
+   uint32_t hid1, reg;
+   uint16_t cpu;
+
+   /*
+* On some models the vcore-select offset is relative to
+* its parent offset and not to the bus base address.
+*/
+   OF_getprop(OF_parent(ca->ca_node), "reg", ®, sizeof(reg));
+   if (reg > ca->ca_reg[0])
+   voltage = reg + ca->ca_reg[0];
+   else
+   voltage = ca->ca_reg[0];
+
+   hid1 = ppc_mfhid1();
+
+   if (hid1 & DFS4) {
+   ppc_curfreq = ppc_maxfreq / 4;
+   perflevel = 25;
+   } else if (hid1 & DFS2) {
+   ppc_curfreq = ppc_maxfreq / 2;
+   perflevel = 50;
+   }
+
+   cpu_setperf = dfs_setperf;
+
+   printf(": Dynamic Frequency Switching, speeds: ");
+   printf("%d, %d", ppc_maxfreq, ppc_maxfreq / 2);
+
+   cpu = ppc_mfpvr() >> 16;
+   if (cpu == PPC_CPU_MPC7448)
+   printf(", %d MHz\n", ppc_maxfreq / 4);
+   else
+   printf(" MHz\n");
+}
+
+void
+dfs_setperf(int perflevel)
+{
+   if (perflevel > 50) {
+   if (ppc_curfreq != ppc_maxfreq) {
+   macobio_write(voltage, GPIO_DDR_OUTPUT | 1);
+   DELAY(1000);
+   dfs_scale_frequency(FREQ_FULL);
+   }
+   } else {
+   uint16_t cpu;
+
+   cpu = ppc_mfpvr() >> 16;
+   if (cpu == PPC_CPU_MPC7448 && perflevel <= 25)  {
+   if (ppc_curfreq != ppc_maxfreq / 4) {
+   dfs_scale_frequency(FREQ_QUARTER);
+   macobio_write(voltage, GPIO_DDR_OUTPUT | 0);
+   DELAY(1000);
+   }
+   } else { 
+   if (ppc_curfreq != ppc_maxfreq / 2) {
+   dfs_scale_frequency(FREQ_HALF);
+   macobio_write(voltage, GPIO_DDR_OUTPUT | 0);
+   DELAY(1000);
+   }
+   }
+   }
+}
+
+void
+dfs_scale_frequency(u_int freq_scale)
+{
+   uint32_t hid1;
+   int s;
+
+   s = splhigh();
+   hid1 = ppc_mfhid1();
+
+   hid1 &= ~(DFS2 | DFS4);
+   switch (freq_scale) {
+   case FREQ_QUARTER:
+   hid1 |= DFS4;
+   ppc_curfreq = ppc_maxfreq / 4;
+   break;
+   case FREQ