lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150616130354.405ef993@mdontu-l.dsd.bitdefender.biz>
Date:	Tue, 16 Jun 2015 13:03:54 +0300
From:	Mihai Donțu <mihai.dontu@...il.com>
To:	Orestes Leal Rodriguez <lukes357@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] small update for strlen, strnlen, use less cpu
 instructions

On Tue, 16 Jun 2015 04:40:55 -0500 Orestes Leal Rodriguez wrote:
> very small update to strlen and strnlen that now use less cpu 
> instructions by using a counter to avoid the memory addresses 
> substraction to find the length of the string.

Nice. :-)

 Performance counter stats for './strnlen-new':

          3.602591      task-clock (msec)         #    0.836 CPUs utilized          
                 4      context-switches          #    0.001 M/sec                  
                 2      cpu-migrations            #    0.555 K/sec                  
                48      page-faults               #    0.013 M/sec                  
         9,607,307      cycles                    #    2.667 GHz                    
   <not supported>      stalled-cycles-frontend  
   <not supported>      stalled-cycles-backend   
        23,612,424      instructions              #    2.46  insns per cycle        
         9,121,754      branches                  # 2531.998 M/sec                  
             5,409      branch-misses             #    0.06% of all branches        

       0.004311477 seconds time elapsed


 Performance counter stats for './strnlen-old':

          3.181354      task-clock (msec)         #    0.930 CPUs utilized          
                 1      context-switches          #    0.314 K/sec                  
                 1      cpu-migrations            #    0.314 K/sec                  
                47      page-faults               #    0.015 M/sec                  
         8,558,129      cycles                    #    2.690 GHz                    
   <not supported>      stalled-cycles-frontend  
   <not supported>      stalled-cycles-backend   
        23,577,237      instructions              #    2.75  insns per cycle        
         9,114,760      branches                  # 2865.057 M/sec                  
             4,298      branch-misses             #    0.05% of all branches        

       0.003419085 seconds time elapsed

However, you will need to create a proper patch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/SubmittingPatches

-- 
Mihai Donțu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ