Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753317AbdCJDt5 convert rfc822-to-8bit (ORCPT ); Thu, 9 Mar 2017 22:49:57 -0500 Received: from smtprelay0203.hostedemail.com ([216.40.44.203]:52508 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750781AbdCJDtz (ORCPT ); Thu, 9 Mar 2017 22:49:55 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::,RULES_HIT:41:152:355:379:599:800:960:973:988:989:1260:1261:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3653:3865:3866:3867:3870:3871:3872:3874:4043:5007:6117:6119:6299:7576:7652:7875:7903:8531:10004:10400:10848:11026:11232:11658:11914:12296:12895:13069:13311:13357:13618:14096:14097:14181:14721:14777:21080:21451:30012:30026:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: wax54_7339ecbbf222e X-Filterd-Recvd-Size: 2176 Date: Thu, 09 Mar 2017 22:49:49 -0500 User-Agent: K-9 Mail for Android In-Reply-To: References: <20170309224204.066497548@goodmis.org> <20170309224447.678652367@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH 1/2] x86/nmi: Optimize the check for being in the repeat_nmi code To: Andy Lutomirski CC: "linux-kernel@vger.kernel.org" , Linus Torvalds , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Andrew Morton From: Steven Rostedt Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 936 Lines: 35 On March 9, 2017 9:42:57 PM EST, Andy Lutomirski wrote: >On Thu, Mar 9, 2017 at 2:42 PM, Steven Rostedt >wrote: >> From: "Steven Rostedt (Red Hat)" >> >> Linus mentioned that doing two compares can be replaced by a single >> compare. That is, instead of: >> >> movq $repeat_nmi, %rdx >> cmpq 8(%rsp), %rdx >> ja not_in_region >> movq $end_repeat_nmi, %rdx >> cmpq 8(%rsp), %rdx >> ja in_region >> >> we can replace that with: >> >> movq 8(%rsp), %rdx >> subq $repeat_nmi, %rdx >> cmpq $end_repeat_nmi-repeat_nmi, %rdx >> jb in_region > >Seems reasonable to me. Good luck ever noticing the speedup :) > It had nothing to do with speedup. Linus said that the current code makes the assembly programmer in him die a little. I want to cure that. -- Steve >--Andy -- Sent from my Android device with K-9 Mail. Please excuse my brevity.