Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2162536imm; Thu, 27 Sep 2018 08:21:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV625+lR6ZFIgg6fJCFH4OsvJ2spvcH/Y6/liMhNAxBo5tiy3YoEGDnzS41ZZQNtUAxzg03Qt X-Received: by 2002:a62:fd06:: with SMTP id p6-v6mr12019403pfh.167.1538061711803; Thu, 27 Sep 2018 08:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538061711; cv=none; d=google.com; s=arc-20160816; b=iJWGDxbAaD49jXzZu+npuqw4DBYOFqnClL9++xAAfMDwQUx4MTs+zaON0+LhP4st0b qgCUAazefx7ulLEhKS7yTHTlH8McasmkRzzcLfiLW3PoFvjGjwzIUHB7nWtnUOSu3YnE 321IcwFlY56KZad9s2cv3q5VwLM/N5f8IMNAHT0STLpcqBgElJ/kHLiPyIWmAbBUfpiO 9nNZ9wPqjfdV3Wef8DpmeZNtWww03KsPFFrNE/1+X3Mg+4zSZlhokpgzI4YGwt4RTAGe 2/Z3DUURN0ilZ7oBHwgqv6z/qRW/+MUi35HQVFk5yZUsDVdZPS25lrT1gil4ile4aEyq XcUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/+rwjflgHFrfp2N0aWXU7O1CPY4uook+b6zV/O4wmbo=; b=QhCaZ5gBIzjLcHdrk82lniR5aa7zgFujyM5bG88A/BOVF3zRsMY/kAzEyYfm/vm3y9 eG+q1vrOuhtFGlit0aKJ8W7fR3FjPzIsYswVlsl+z792RnaMRbgdO9MnJ9Ppsbr8qxjD 7Tc2JNpcG2KFs0bVyIuzhfXVrtkRHTotrPVFaDxJw1jYZHtFirKHtBgYgmO4EefcWjfH R9Jh7yDlRAmwIxYj3LbFBWFsAqFh2+/Gc0gSlZ/ZMFEJhagMOn1i5tHO3NkTaVs6rhOA DSkwGQz++rmN45h7hfYRP6+z5mX7NFdrfw9Nln3f/OYRJS3xVgOhIs428xX0FmcYKb/B 0uuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=h951CBQg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce15-v6si2490793plb.391.2018.09.27.08.21.35; Thu, 27 Sep 2018 08:21:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=h951CBQg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727621AbeI0ViX (ORCPT + 99 others); Thu, 27 Sep 2018 17:38:23 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:53713 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbeI0ViX (ORCPT ); Thu, 27 Sep 2018 17:38:23 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id c4a546ee; Thu, 27 Sep 2018 15:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type:content-transfer-encoding; s=mail; bh=iLnXO5fKnraQ ngk0pcl0LLQQ7Dw=; b=h951CBQgdTG1Qz1B1v05Kw8da0/imuUTbCtTjmuQsvpL Fer3u31q8/iJ6MLTdlCNefFvMaRPgr8ydW4ikyBblmub8StDLRQoTOCbqdS5gZs1 4ZEpBy5Y3fSv9GuFvBBUueMUBua7hP2sAeTAvDeinvUWJE61WiMvlc5njROaq2VS ek6QsLxcpMwRB0j3I4I6GJ+ppGOyIUaULGOmDuEfNQ63qsrYNtLSuphUyGNAUq5o 9NU6nUS0AVNVYMWNQ0yMwMoaET07l6MDD71YnIc1zgACpUNGINLbIEz7Tr4i+7W9 KHjrPsUYlHKUuftQhCrr1CiI0XszUJplr5BO0opRBw== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 964dab80 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO); Thu, 27 Sep 2018 15:00:52 +0000 (UTC) Received: by mail-ot1-f46.google.com with SMTP id h26-v6so2900838otl.9; Thu, 27 Sep 2018 08:19:33 -0700 (PDT) X-Gm-Message-State: ABuFfohnBOYWeQcLX2jc5O0Z5+F+URxUDGe0PLBSuAYeI+9zXlfAv+Bv BvhjANfaSk8piJ2dWJEJZEXQJheoxY+sEQ54p8U= X-Received: by 2002:a9d:309d:: with SMTP id s29-v6mr7603737otc.144.1538061572188; Thu, 27 Sep 2018 08:19:32 -0700 (PDT) MIME-Version: 1.0 References: <20180925145622.29959-1-Jason@zx2c4.com> <20180925145622.29959-8-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Thu, 27 Sep 2018 17:19:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v6 07/23] zinc: ChaCha20 ARM and ARM64 implementations To: Thomas Gleixner , Peter Zijlstra Cc: Ard Biesheuvel , LKML , Netdev , Linux Crypto Mailing List , David Miller , Greg Kroah-Hartman , Samuel Neves , Andrew Lutomirski , Jean-Philippe Aumasson , Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey again Thomas, On Thu, Sep 27, 2018 at 3:26 PM Jason A. Donenfeld wrote: > > Hi Thomas, > > I'm trying to optimize this for crypto performance while still taking > into account preemption concerns. I'm having a bit of trouble figuring > out a way to determine numerically what the upper bounds for this > stuff looks like. I'm sure I could pick a pretty sane number that's > arguably okay -- and way under the limit -- but I still am interested > in determining what that limit actually is. I was hoping there'd be a > debugging option called, "warn if preemption is disabled for too > long", or something, but I couldn't find anything like that. I'm also > not quite sure what the latency limits are, to just compute this with > a formula. Essentially what I'm trying to determine is: > > preempt_disable(); > asm volatile(".fill N, 1, 0x90;"); > preempt_enable(); > > What is the maximum value of N for which the above is okay? What > technique would you generally use in measuring this? > > Thanks, > Jason From talking to Peter (now CC'd) on IRC, it sounds like what you're mostly interested in is clocktime latency on reasonable hardware, with a goal of around ~20=C2=B5s as a maximum upper bound? I don't expect to get anywhere near this value at all, but if you can confirm that's a decent ballpark, it would make for some interesting calculations. Regards, Jason