Re: [PATCH] add boot_time event of uncompress lzloader.elf

2018-04-11 Thread Waldek Kozaczuk
Including the author of the patch. 

Sent from my iPhone

> On Apr 10, 2018, at 23:45, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:
> 
> Again it looks correct but if we rework previous patch this would have had to 
> be adjusted as well.
> 
> Regards,
> Waldek
> 
>> On Monday, April 9, 2018 at 8:46:56 AM UTC-4, Wang Yu wrote:
>> sometimes i found uncompres cost serival times, 
>> so add boot_time event of uncompress lzloader.elf 
>> after patch 
>> ... 
>> disk read (real mode): 45.09ms, (+45.09ms) 
>> uncompress lzloader.elf: 76.90ms, (+31.81ms) 
>> TLS initialization: 77.65ms, (+0.75ms) 
>> .init functions: 82.69ms, (+5.04ms) 
>> SMP launched: 83.72ms, (+1.03ms) 
>> VFS initialized: 88.67ms, (+4.95ms) 
>> ... 
>> Signed-off-by: Wang Yu <yuw...@linux.alibaba.com> 
>> --- 
>>  arch/x64/arch-setup.cc | 5 + 
>>  arch/x64/boot16.S  | 7 ++- 
>>  include/osv/boot.hh| 2 +- 
>>  loader.cc  | 2 +- 
>>  4 files changed, 13 insertions(+), 3 deletions(-) 
>> 
>> diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc 
>> index 325c26a..ce81437 100644 
>> --- a/arch/x64/arch-setup.cc 
>> +++ b/arch/x64/arch-setup.cc 
>> @@ -50,6 +50,7 @@ struct osv_multiboot_info_type { 
>>  struct multiboot_info_type mb; 
>>  u32 tsc_init, tsc_init_hi; 
>>  u32 tsc_disk_done, tsc_disk_done_hi; 
>> +u32 tsc_uncompress_done, tsc_uncompress_done_hi; 
>>  u8 disk_err; 
>>  } __attribute__((packed)); 
>>   
>> @@ -140,6 +141,10 @@ void arch_setup_free_memory() 
>>  time = (time << 32) | omb.tsc_disk_done; 
>>  boot_time.arrays[1] = { "disk read (real mode)", time }; 
>>   
>> +time = omb.tsc_uncompress_done_hi; 
>> +time = (time << 32) | omb.tsc_uncompress_done; 
>> +boot_time.arrays[2] = { "uncompress lzloader.elf", time }; 
>> + 
>>  auto c = processor::cpuid(0x8000); 
>>  if (c.a >= 0x8008) { 
>>  c = processor::cpuid(0x8008); 
>> diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S 
>> index d8808bd..d053a3f 100644 
>> --- a/arch/x64/boot16.S 
>> +++ b/arch/x64/boot16.S 
>> @@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88) 
>>  mb_tsc1_hi = (mb_info + 88 + 4) 
>>  mb_tsc_disk_lo = (mb_info + 88 + 8) 
>>  mb_tsc_disk_hi = (mb_info + 88 + 12) 
>> -mb_disk_err = (mb_info + 88 + 16) 
>> +mb_uncompress_lo = (mb_info + 88 + 16) 
>> +mb_uncompress_hi = (mb_info + 88 + 20) 
>> +mb_disk_err = (mb_info + 88 + 24) 
>>  mb_cmdline = (mb_info + 16) 
>>  mb_mmap_len = (mb_info + 44) 
>>  mb_mmap_addr = (mb_info + 48) 
>> @@ -161,6 +163,9 @@ done_e820: 
>>  mov %eax, %fs 
>>  mov %eax, %ss 
>>  call *lzentry 
>> +rdtsc 
>> +mov %eax, mb_uncompress_lo 
>> +mov %edx, mb_uncompress_hi 
>>  mov $loader, %eax 
>>  mov $mb_info, %ebx 
>>  call *entry 
>> diff --git a/include/osv/boot.hh b/include/osv/boot.hh 
>> index ec5301c..4c67410 100644 
>> --- a/include/osv/boot.hh 
>> +++ b/include/osv/boot.hh 
>> @@ -20,7 +20,7 @@ public: 
>>  // relatively late (the code that takes the measure is so early it 
>> cannot 
>>  // call this one directly. Therefore, the measurements would appear in 
>> the 
>>  // middle of the list, and we want to preserve order. 
>> -int _event = 3; 
>> +int _event = 4; 
>>  private: 
>>   
>>  void print_one_time(int index); 
>> diff --git a/loader.cc b/loader.cc 
>> index 0d97151..841e146 100644 
>> --- a/loader.cc 
>> +++ b/loader.cc 
>> @@ -109,7 +109,7 @@ void premain() 
>>  } 
>>   
>>  setup_tls(inittab); 
>> -boot_time._event=2; 
>> +boot_time._event=3; 
>>  boot_time.event("TLS initialization"); 
>>  for (auto init = inittab.start; init < inittab.start + inittab.count; 
>> ++init) { 
>>  (*init)(); 
>> -- 
>> 1.8.3.1 
>> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "OSv Development" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/osv-dev/Ttl_xdH51i8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] add boot_time event of uncompress lzloader.elf

2018-04-11 Thread Wang Yu

pls review


在 18/4/9 下午8:46, Wang Yu 写道:

sometimes i found uncompres cost serival times,
so add boot_time event of uncompress lzloader.elf
after patch
...
disk read (real mode): 45.09ms, (+45.09ms)
uncompress lzloader.elf: 76.90ms, (+31.81ms)
TLS initialization: 77.65ms, (+0.75ms)
.init functions: 82.69ms, (+5.04ms)
SMP launched: 83.72ms, (+1.03ms)
VFS initialized: 88.67ms, (+4.95ms)
...
Signed-off-by: Wang Yu <yuw...@linux.alibaba.com>
---
  arch/x64/arch-setup.cc | 5 +
  arch/x64/boot16.S  | 7 ++-
  include/osv/boot.hh| 2 +-
  loader.cc  | 2 +-
  4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index 325c26a..ce81437 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -50,6 +50,7 @@ struct osv_multiboot_info_type {
  struct multiboot_info_type mb;
  u32 tsc_init, tsc_init_hi;
  u32 tsc_disk_done, tsc_disk_done_hi;
+u32 tsc_uncompress_done, tsc_uncompress_done_hi;
  u8 disk_err;
  } __attribute__((packed));
  
@@ -140,6 +141,10 @@ void arch_setup_free_memory()

  time = (time << 32) | omb.tsc_disk_done;
  boot_time.arrays[1] = { "disk read (real mode)", time };
  
+time = omb.tsc_uncompress_done_hi;

+time = (time << 32) | omb.tsc_uncompress_done;
+boot_time.arrays[2] = { "uncompress lzloader.elf", time };
+
  auto c = processor::cpuid(0x8000);
  if (c.a >= 0x8008) {
  c = processor::cpuid(0x8008);
diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S
index d8808bd..d053a3f 100644
--- a/arch/x64/boot16.S
+++ b/arch/x64/boot16.S
@@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88)
  mb_tsc1_hi = (mb_info + 88 + 4)
  mb_tsc_disk_lo = (mb_info + 88 + 8)
  mb_tsc_disk_hi = (mb_info + 88 + 12)
-mb_disk_err = (mb_info + 88 + 16)
+mb_uncompress_lo = (mb_info + 88 + 16)
+mb_uncompress_hi = (mb_info + 88 + 20)
+mb_disk_err = (mb_info + 88 + 24)
  mb_cmdline = (mb_info + 16)
  mb_mmap_len = (mb_info + 44)
  mb_mmap_addr = (mb_info + 48)
@@ -161,6 +163,9 @@ done_e820:
  mov %eax, %fs
  mov %eax, %ss
  call *lzentry
+rdtsc
+mov %eax, mb_uncompress_lo
+mov %edx, mb_uncompress_hi
  mov $loader, %eax
  mov $mb_info, %ebx
  call *entry
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index ec5301c..4c67410 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -20,7 +20,7 @@ public:
  // relatively late (the code that takes the measure is so early it cannot
  // call this one directly. Therefore, the measurements would appear in the
  // middle of the list, and we want to preserve order.
-int _event = 3;
+int _event = 4;
  private:
  
  void print_one_time(int index);

diff --git a/loader.cc b/loader.cc
index 0d97151..841e146 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
  }
  
  setup_tls(inittab);

-boot_time._event=2;
+boot_time._event=3;
  boot_time.event("TLS initialization");
  for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
  (*init)();


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] add boot_time event of uncompress lzloader.elf

2018-04-10 Thread Waldek Kozaczuk
Again it looks correct but if we rework previous patch this would have had 
to be adjusted as well.

Regards,
Waldek

On Monday, April 9, 2018 at 8:46:56 AM UTC-4, Wang Yu wrote:
>
> sometimes i found uncompres cost serival times, 
> so add boot_time event of uncompress lzloader.elf 
> after patch 
> ... 
> disk read (real mode): 45.09ms, (+45.09ms) 
> uncompress lzloader.elf: 76.90ms, (+31.81ms) 
> TLS initialization: 77.65ms, (+0.75ms) 
> .init functions: 82.69ms, (+5.04ms) 
> SMP launched: 83.72ms, (+1.03ms) 
> VFS initialized: 88.67ms, (+4.95ms) 
> ... 
> Signed-off-by: Wang Yu <yuw...@linux.alibaba.com > 
> --- 
>  arch/x64/arch-setup.cc | 5 + 
>  arch/x64/boot16.S  | 7 ++- 
>  include/osv/boot.hh| 2 +- 
>  loader.cc  | 2 +- 
>  4 files changed, 13 insertions(+), 3 deletions(-) 
>
> diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc 
> index 325c26a..ce81437 100644 
> --- a/arch/x64/arch-setup.cc 
> +++ b/arch/x64/arch-setup.cc 
> @@ -50,6 +50,7 @@ struct osv_multiboot_info_type { 
>  struct multiboot_info_type mb; 
>  u32 tsc_init, tsc_init_hi; 
>  u32 tsc_disk_done, tsc_disk_done_hi; 
> +u32 tsc_uncompress_done, tsc_uncompress_done_hi; 
>  u8 disk_err; 
>  } __attribute__((packed)); 
>   
> @@ -140,6 +141,10 @@ void arch_setup_free_memory() 
>  time = (time << 32) | omb.tsc_disk_done; 
>  boot_time.arrays[1] = { "disk read (real mode)", time }; 
>   
> +time = omb.tsc_uncompress_done_hi; 
> +time = (time << 32) | omb.tsc_uncompress_done; 
> +boot_time.arrays[2] = { "uncompress lzloader.elf", time }; 
> + 
>  auto c = processor::cpuid(0x8000); 
>  if (c.a >= 0x8008) { 
>  c = processor::cpuid(0x8008); 
> diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S 
> index d8808bd..d053a3f 100644 
> --- a/arch/x64/boot16.S 
> +++ b/arch/x64/boot16.S 
> @@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88) 
>  mb_tsc1_hi = (mb_info + 88 + 4) 
>  mb_tsc_disk_lo = (mb_info + 88 + 8) 
>  mb_tsc_disk_hi = (mb_info + 88 + 12) 
> -mb_disk_err = (mb_info + 88 + 16) 
> +mb_uncompress_lo = (mb_info + 88 + 16) 
> +mb_uncompress_hi = (mb_info + 88 + 20) 
> +mb_disk_err = (mb_info + 88 + 24) 
>  mb_cmdline = (mb_info + 16) 
>  mb_mmap_len = (mb_info + 44) 
>  mb_mmap_addr = (mb_info + 48) 
> @@ -161,6 +163,9 @@ done_e820: 
>  mov %eax, %fs 
>  mov %eax, %ss 
>  call *lzentry 
> +rdtsc 
> +mov %eax, mb_uncompress_lo 
> +mov %edx, mb_uncompress_hi 
>  mov $loader, %eax 
>  mov $mb_info, %ebx 
>  call *entry 
> diff --git a/include/osv/boot.hh b/include/osv/boot.hh 
> index ec5301c..4c67410 100644 
> --- a/include/osv/boot.hh 
> +++ b/include/osv/boot.hh 
> @@ -20,7 +20,7 @@ public: 
>  // relatively late (the code that takes the measure is so early it 
> cannot 
>  // call this one directly. Therefore, the measurements would appear 
> in the 
>  // middle of the list, and we want to preserve order. 
> -int _event = 3; 
> +int _event = 4; 
>  private: 
>   
>  void print_one_time(int index); 
> diff --git a/loader.cc b/loader.cc 
> index 0d97151..841e146 100644 
> --- a/loader.cc 
> +++ b/loader.cc 
> @@ -109,7 +109,7 @@ void premain() 
>  } 
>   
>  setup_tls(inittab); 
> -boot_time._event=2; 
> +boot_time._event=3; 
>  boot_time.event("TLS initialization"); 
>  for (auto init = inittab.start; init < inittab.start + inittab.count; 
> ++init) { 
>  (*init)(); 
> -- 
> 1.8.3.1 
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] add boot_time event of uncompress lzloader.elf

2018-04-09 Thread Wang Yu
sometimes i found uncompres cost serival times,
so add boot_time event of uncompress lzloader.elf
after patch
...
disk read (real mode): 45.09ms, (+45.09ms)
uncompress lzloader.elf: 76.90ms, (+31.81ms)
TLS initialization: 77.65ms, (+0.75ms)
.init functions: 82.69ms, (+5.04ms)
SMP launched: 83.72ms, (+1.03ms)
VFS initialized: 88.67ms, (+4.95ms)
...
Signed-off-by: Wang Yu <yuw...@linux.alibaba.com>
---
 arch/x64/arch-setup.cc | 5 +
 arch/x64/boot16.S  | 7 ++-
 include/osv/boot.hh| 2 +-
 loader.cc  | 2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index 325c26a..ce81437 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -50,6 +50,7 @@ struct osv_multiboot_info_type {
 struct multiboot_info_type mb;
 u32 tsc_init, tsc_init_hi;
 u32 tsc_disk_done, tsc_disk_done_hi;
+u32 tsc_uncompress_done, tsc_uncompress_done_hi;
 u8 disk_err;
 } __attribute__((packed));
 
@@ -140,6 +141,10 @@ void arch_setup_free_memory()
 time = (time << 32) | omb.tsc_disk_done;
 boot_time.arrays[1] = { "disk read (real mode)", time };
 
+time = omb.tsc_uncompress_done_hi;
+time = (time << 32) | omb.tsc_uncompress_done;
+boot_time.arrays[2] = { "uncompress lzloader.elf", time };
+
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
 c = processor::cpuid(0x8008);
diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S
index d8808bd..d053a3f 100644
--- a/arch/x64/boot16.S
+++ b/arch/x64/boot16.S
@@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88)
 mb_tsc1_hi = (mb_info + 88 + 4)
 mb_tsc_disk_lo = (mb_info + 88 + 8)
 mb_tsc_disk_hi = (mb_info + 88 + 12)
-mb_disk_err = (mb_info + 88 + 16)
+mb_uncompress_lo = (mb_info + 88 + 16)
+mb_uncompress_hi = (mb_info + 88 + 20)
+mb_disk_err = (mb_info + 88 + 24)
 mb_cmdline = (mb_info + 16)
 mb_mmap_len = (mb_info + 44)
 mb_mmap_addr = (mb_info + 48)
@@ -161,6 +163,9 @@ done_e820:
 mov %eax, %fs
 mov %eax, %ss
 call *lzentry
+rdtsc
+mov %eax, mb_uncompress_lo
+mov %edx, mb_uncompress_hi
 mov $loader, %eax
 mov $mb_info, %ebx
 call *entry
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index ec5301c..4c67410 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -20,7 +20,7 @@ public:
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 3;
+int _event = 4;
 private:
 
 void print_one_time(int index);
diff --git a/loader.cc b/loader.cc
index 0d97151..841e146 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
-boot_time._event=2;
+boot_time._event=3;
 boot_time.event("TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.