Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp7068485imm; Sun, 20 May 2018 17:55:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqBe1blVqCfKDIGLMekb1ZdG8wTFKeynRtTFkF/l4CPb+zE5wFlTHBI4RNMiWnjavxRGy0+ X-Received: by 2002:a63:b144:: with SMTP id g4-v6mr14065022pgp.253.1526864143950; Sun, 20 May 2018 17:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526864143; cv=none; d=google.com; s=arc-20160816; b=vbkgSEvC4rZPwq6rF0vmZNZycN9a7iR2O1TIxKxCe8mIawdqGRf/69MJFl5LZWjzG1 kIOnUnt3ZbrEfK+kD1yvY5qwhDeVgBG/3WEBh8MW7rD900j+E4z55WQK1JCKKkaAYPKr xo3OtdP86jWbawbR8c8YDEuK6INY1ENAv0APZsedmHT/lriVZGvN1L56Fxcyrct/h6Ca c4/I3xV3eVHbG930zO+PX/KrANykHgBw1QWyDGziM0GSchp9z04/IjGlZKjDRUaDiWqO hHvRp11SzfFusrPbmI9YOQ03t74zdyJOiy9INPTmIxVd1AToiKUQX6GDfKbdVVYcZsaQ qXqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=QpRbokLUzRRA0RiyMSXu5hEi2fUSGNJFJuu5RtuAH1U=; b=w5u3wAm25oz/DwsurZ752SCyUaugW3IAoLvW/Kkfyz3ADg1/t4iOR7wuGl/vAYfEAd dRYNYoEdkHE7j21W4gNdP5iWKWAZPRPMkUOgwrDyft/HPPoKg77mG5fX2N6YkGByvC2S h56OlVpuDJ6mKGkFyTbq70EysdYY9ZLPQ+8RA0+3e1UmHSemuC14KYrzvS67+2s+8VIg dfX7V/mfkiowlBEZaxtS1uK674tl6K5M4YSf2dTfyUWoLVKdz83ind4FzX7UAMGPoV3S zT6KUhCSSx9IJg8lnWaqP7+n2l8YJEX8tT3ps3WlgOTkslODTWwnYJ1yFwLpoDhmpHMP 12Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=h9vTIFAE; 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 i63-v6si5868130pgc.607.2018.05.20.17.55.28; Sun, 20 May 2018 17:55:43 -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=fail header.i=@thunk.org header.s=ef5046eb header.b=h9vTIFAE; 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 S1751559AbeEUAzR (ORCPT + 99 others); Sun, 20 May 2018 20:55:17 -0400 Received: from imap.thunk.org ([74.207.234.97]:59594 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbeEUAzQ (ORCPT ); Sun, 20 May 2018 20:55:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QpRbokLUzRRA0RiyMSXu5hEi2fUSGNJFJuu5RtuAH1U=; b=h9vTIFAE7u0uoO3BGoQSbKv8SA GLfrs2CXoiIyNq2AXdJ1yL9YEM9SYNXtw9tzOeJjf7gyoloBw/llwrr+FaLsiF9VlUvQijxx+5JQk QPtvRO+I/oR1Yq+W9b0AIx3LrO1MEUz5BKglhYNQhYSHUnjIytPzHBHJoUcYr2RVbjRk=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fKZ6U-0007Gg-EN; Mon, 21 May 2018 00:55:11 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 109FA7A4B08; Sun, 20 May 2018 20:55:03 -0400 (EDT) Date: Sun, 20 May 2018 20:55:02 -0400 From: "Theodore Y. Ts'o" To: Eric Biggers Cc: linux-fscrypt@vger.kernel.org, Jaegeuk Kim , Paul Crowley , Enric Balletbo i Serra , Mikulas Patocka , linux-kernel@vger.kernel.org Subject: Re: [PATCH] fscrypt: use unbound workqueue for decryption Message-ID: <20180521005502.GA4464@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Eric Biggers , linux-fscrypt@vger.kernel.org, Jaegeuk Kim , Paul Crowley , Enric Balletbo i Serra , Mikulas Patocka , linux-kernel@vger.kernel.org References: <20180420233002.134687-1-ebiggers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180420233002.134687-1-ebiggers@google.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 04:30:02PM -0700, Eric Biggers wrote: > Improve fscrypt read performance by switching the decryption workqueue > from bound to unbound. With the bound workqueue, when multiple bios > completed on the same CPU, they were decrypted on that same CPU. But > with the unbound queue, they are now decrypted in parallel on any CPU. > > Although fscrypt read performance can be tough to measure due to the > many sources of variation, this change is most beneficial when > decryption is slow, e.g. on CPUs without AES instructions. For example, > I timed tarring up encrypted directories on f2fs. On x86 with AES-NI > instructions disabled, the unbound workqueue improved performance by > about 25-35%, using 1 to NUM_CPUs jobs with 4 or 8 CPUs available. But > with AES-NI enabled, performance was unchanged to within ~2%. > > I also did the same test on a quad-core ARM CPU using xts-speck128-neon > encryption. There performance was usually about 10% better with the > unbound workqueue, bringing it closer to the unencrypted speed. > > The unbound workqueue may be worse in some cases due to worse locality, > but I think it's still the better default. dm-crypt uses an unbound > workqueue by default too, so this change makes fscrypt match. > > Signed-off-by: Eric Biggers Applied, thanks. - Ted