From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753238AbdJTQWp (ORCPT ); Fri, 20 Oct 2017 12:22:45 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36584 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753034AbdJTQWn (ORCPT ); Fri, 20 Oct 2017 12:22:43 -0400 Date: Fri, 20 Oct 2017 18:22:27 +0200 From: Peter Zijlstra To: Kees Cook Cc: Joe Perches , Michael Davidson , Andrew Morton , Ingo Molnar , David Miller , Matthew Wilcox , LKML Subject: Re: [PATCH] lib/int_sqrt.c: optimize for small argument values Message-ID: <20171020162227.GE6524@worktop.programming.kicks-ass.net> References: <20171019203137.131042-1-md@google.com> <1508480027.6806.44.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 20, 2017 at 07:18:51AM -0700, Kees Cook wrote: > On Thu, Oct 19, 2017 at 11:13 PM, Joe Perches wrote: > > On Thu, 2017-10-19 at 13:31 -0700, Michael Davidson wrote: > >> int_sqrt() currently takes approximately constant time > >> regardless of the value of the argument. By using the > >> magnitude of the operand to set the initial conditions > >> for the calculation the cost becomes proportional to > >> log2 of the argument with the worst case behavior not > >> being measurably slower than it currently is. > > > > https://lkml.org/lkml/2017/7/24/408 > > Ah! Cool. I don't see this version queued up for -next. Where does > Peter's version stand? Oh, crud, forgot all about it. I'd have to double check I addressed the concerns Linus had with my Changelogs, but other than that he seemed to be OK.