Received: by 10.213.65.68 with SMTP id h4csp356809imn; Mon, 26 Mar 2018 23:55:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELszZrq6sypYo0eXYt51HXRjyRNKERzn8l3moX/bTh/Wr66V53LZmhAmkAky0q9clwKeSGjV X-Received: by 2002:a17:902:481:: with SMTP id e1-v6mr43515095ple.377.1522133713213; Mon, 26 Mar 2018 23:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522133713; cv=none; d=google.com; s=arc-20160816; b=cBh/LAF4sS/Ikjoihd0hQjvEJieF6iFvX1301JrX7GqBPC9ZKdSCqibkMH6qZFrfpc 4Q6RV7DJW2D/U3yVWOlO/qfOMy8afbbp07REmYZMB89FgX6prD0JGfB2Mh0IgcVsrIO9 08M0C7V2PRGTeFuhA4P69hXNtkuyT2BnM2ErbCIR9KpD/VooIQzQL09rYqAEXUN6PJsL WdYm+5GDhifqe7rFKO2TVnUT4HJaohvde7LHlg61LYX3d8VH6WVzRGulU28p6xxSLe2u d4VlJD26GxWYPU/RYQLb9cMQg68vS//99BXGTyZQ2XPJsZQxi77oQmpijayXXrrbIlh3 B8uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=g9iGx5aVN9+PweoWXMWFkHmX7rGoKGZNTse23cdgxx0=; b=vyv4ITSiC4PkIdGhBBk5KI9DW6/yJyEeEzq41wyfxbS8bbVDU4j3TXGo2HVxQVRbk8 Pj2vvnXzrsijtS0X03J/099HIaoU22Ivd9/EQ15kgwJimbx5TVngeYdamGzNyfwPP7ar YInICnSb38uhCVEesKpH2SQnfQfydMd+VdGWQzMxHaMFVjFwTr97YYzqQs7i95X8n0B7 AJFWDFGXlbztSS1xe5myvsZzts9HHnbLRix6taLPEgDqLzolmZhCd0CYVf17eVc0Lykp EJ29JvlY5+Cv6QOrGPS7V1sXiQW1Am17b1uPoKCoGYB5hvr78qBWyFHfPl+rZLcV58so BwSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@benyossef-com.20150623.gappssmtp.com header.s=20150623 header.b=GIoubr60; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si445395pgp.94.2018.03.26.23.54.59; Mon, 26 Mar 2018 23:55:13 -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=@benyossef-com.20150623.gappssmtp.com header.s=20150623 header.b=GIoubr60; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbeC0Gwu (ORCPT + 99 others); Tue, 27 Mar 2018 02:52:50 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:40235 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635AbeC0Gws (ORCPT ); Tue, 27 Mar 2018 02:52:48 -0400 Received: by mail-ua0-f194.google.com with SMTP id n20so4913704ual.7 for ; Mon, 26 Mar 2018 23:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benyossef-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=g9iGx5aVN9+PweoWXMWFkHmX7rGoKGZNTse23cdgxx0=; b=GIoubr60dx9Q2ck8UdMwu40wmKpyzsgZcSZAl9wDabHNB1rMnEfgEKbU+kKliyKDA4 jofC4UQIOQuP4v4ONBHqGXIwm8KCGob/EcbATam8ZsRBZN3yq3GRmkLFhV1DgN9W0GFY ca7YCnspaqGXo2vghmsEPIp3dHHFgCPVoGJAFvIpHPCAtd7337c+tVko9f/ovNz2EcMk Au2prpbtmHNvPyYtd23IG0pwiHTaugGR/qcqbP5NJy24hrVlrtLSqlH1vePslfHm70H+ 89ydIlrJQxU2h8PzFhiFqmg84USQ+Vm/dDDwmoPKjuqX+JbHZGONN5Q9+/l6g98YsKZu 2Gow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g9iGx5aVN9+PweoWXMWFkHmX7rGoKGZNTse23cdgxx0=; b=sGCFr6/T+OKK9d1SuvyVv7StujibfPv+/hywjUeiiduFQCh9Mrc4QrtfUQgFIYqda0 ZEIfnS1AJSKour9YteisFK+zyy6jtptWtbdFXwf1/RkNolzboKYGvD2Ei7jWq7XpZcHo 5rsbfd2+4TEvMQQcUZBjZOfOnOOwgIUW5A9P/XV8tsS/tRYN5A+WLKdh1u282qKq4dmF MjmeHZ/IJYuTHxjgzzyVRzDINaGUXxfzaoRaaXvgjogQsTkSb8qk5q15hXbe8D3zw7OR 5NWSyyYiyr38eTpnp5DSBxmKOL16SIaF6CKRyGRIY90/m+JihaTwaqS909s3RX7rxdnC 5iaQ== X-Gm-Message-State: AElRT7GdxnlfNsCD4Ry8lXJxwmVeHTTEfoey8nDrSBk38A3rZsZMZsAe WakIckXySUY3r65sW1DbIzrq7OOoSkSbk5pMeA+zgw== X-Received: by 10.176.17.79 with SMTP id g15mr19520464uac.188.1522133567120; Mon, 26 Mar 2018 23:52:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.28.3 with HTTP; Mon, 26 Mar 2018 23:52:46 -0700 (PDT) X-Originating-IP: [217.140.96.140] In-Reply-To: <20180327010633.GB23487@redhat.com> References: <1522003290-27243-1-git-send-email-yael.chemla@foss.arm.com> <1522003290-27243-2-git-send-email-yael.chemla@foss.arm.com> <20180327010633.GB23487@redhat.com> From: Gilad Ben-Yossef Date: Tue, 27 Mar 2018 09:52:46 +0300 Message-ID: Subject: Re: [PATCH 2/2] md: dm-verity: allow parallel processing of bio blocks To: Mike Snitzer Cc: Yael Chemla , Alasdair Kergon , device-mapper development , Linux kernel mailing list , ofir.drang@gmail.com, Yael Chemla Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 27, 2018 at 4:06 AM, Mike Snitzer wrote: > On Sun, Mar 25 2018 at 2:41pm -0400, > Yael Chemla wrote: > >> Allow parallel processing of bio blocks by moving to async. completion >> handling. This allows for better resource utilization of both HW and >> software based hash tfm and therefore better performance in many cases, >> depending on the specific tfm in use. >> >> Tested on ARM32 (zynq board) and ARM64 (Juno board). >> Time of cat command was measured on a filesystem with various file sizes. >> 12% performance improvement when HW based hash was used (ccree driver). >> SW based hash showed less than 1% improvement. >> CPU utilization when HW based hash was used presented 10% less context >> switch, 4% less cycles and 7% less instructions. No difference in >> CPU utilization noticed with SW based hash. >> >> Signed-off-by: Yael Chemla > > This one had various issues. I've fixed most of what I saw and staged > in linux-next (purely for build test coverage purposes). I may drop > this patch if others disagree with it (or my sg deallocation in the > error path question isn't answered). > > I've staged the changes here (and in linux-next via 'for-next'): > https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/log/?h=dm-4.17 > > I switched all the new GFP_KERNEL uses to GFP_NOIO. The fact that > you're doing allocations at all (per IO) is bad enough. Using > GFP_KERNEL is a serious liability (risk of deadlock if dm-verity were to > be used for something like.. swap.. weird setup but possible). Out of my curiosity, since I thought whether or not this should use GFP_NOIO during my review but than answered to myself "Nah, dm-verity is read only, can't swap to that" - how does one use a read only DM-Verity to host swap partition/file? :-) > > But the gfp flags aside, the need for additional memory and the > expectation of scalable async parallel IO is potentially at odds with > changes like this (that I just staged, and had to rebase your 2 patches > ontop of): > https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.17&id=a89f6a2cfec86fba7a115642ff082cb4e9450ea6 > > So I'm particulalry interested to hear from google folks to understand > if they are OK with your proposed verity async crypto API use. If by "scalable async parallel IO" you mean crypto HW than for what it's worth, my experience is that makers of devices with is less powerful CPUs are the ones that tend to add them, so they stands to benefit the most of this change. Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru