From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753874AbcHWQO7 (ORCPT ); Tue, 23 Aug 2016 12:14:59 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:33673 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbcHWQO5 (ORCPT ); Tue, 23 Aug 2016 12:14:57 -0400 Date: Tue, 23 Aug 2016 19:15:03 +0300 From: Alexey Dobriyan To: Brian Gerst Cc: the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH] x86: branchless clear_page() Message-ID: <20160823161502.GA1842@p183.telecom.by> References: <20160822205229.GA2638@p183.telecom.by> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 23, 2016 at 09:43:25AM -0400, Brian Gerst wrote: > > -ENTRY(clear_page_c_e) > > +ENTRY(clear_page_rep_stosb) > > movl $4096,%ecx > > xorl %eax,%eax > > rep stosb > > ret > > -ENDPROC(clear_page_c_e) > > +ENDPROC(clear_page_rep_stosb) > > I like this idea, but does it make sense to take it a step further and > inline the string instruction alternatives to avoid a call altogether? It is easy but you can't do runtime patching then. > Also, 32-bit should be converted to do the same thing as 64-bit. I don't run 32-bit. :-)