Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3697373ybt; Tue, 23 Jun 2020 08:38:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOTvCa5AUg1bRzli5+QRuy2vg7xyL6Lo7EJs5GOo4dxcCc36yBQSB7XhYbNc2R/oejEEsg X-Received: by 2002:a17:906:1d5b:: with SMTP id o27mr20491826ejh.344.1592926698496; Tue, 23 Jun 2020 08:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592926698; cv=none; d=google.com; s=arc-20160816; b=Xdz7/GfhudyNVFNE/qAYC+AZ05dzON8NQQacYa2B5TQ2kIzey5CkU/21DTxI9eBYzT QP6nwtSg4mLPbtCLYH+x8LITDuRwMCwhvaiVQffliWMfnhrm5wnpv9zkQ39JQ4Qis08e Cx95vc0UuTyEA2lUyceeRyYAOgKRURGNAEVxfvQ4/r17YBFsUFFZ7CAzJjloPyLXHr3S TU24w1H5OnslzBhr1oNUOfjAHoMAowYrLcqhRwcalkRy1Q1ssZmjQL6jO9aSaKv0YNMe 18XH8+DDgccOBEeewfia0DLjKFF9uIFtmHPAF642dQPvBs/Z4+1tjsV4ubV7iUnPwDac f6Gg== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=s4vipZzC2aXfqHyxgFFKgIRQV3lS7HzdSqHHonX0YJ8=; b=TM/k2XyS7t9psvcy4eJ3PHlmQyLxmZgw3dpAjLzZjcmK+QcPnS/jwnBhC7ji1EvPh5 SkNtYrzzI0ZCoEIEFxZC7fGw6Du/kkRP3ShJzrFiRjZ8PaR6HSdniYDai5c0DkW78WoB B0PI7kPkjsZoDcxH//95vGfa2eH2PCeewuc6oYglfBaJTvBeSBMsbdwJp/mTOKmzRLZQ v8dgrTghTnHQNJ5iAbejXkqVZbcDtxoQ1C6N8w7XWXQCnA01JRoJCYDlVb2YXcrJ8XN1 9RJF+CW7eICizwylafpv8xE22Ze60URXDfLN70tE3h/CBHPmL3TrFsgekvAqsTx4+MVO bYEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZaoN8QA7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ba14si5747002edb.145.2020.06.23.08.37.55; Tue, 23 Jun 2020 08:38:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZaoN8QA7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732955AbgFWPeE (ORCPT + 99 others); Tue, 23 Jun 2020 11:34:04 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:32931 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732738AbgFWPeD (ORCPT ); Tue, 23 Jun 2020 11:34:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592926442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s4vipZzC2aXfqHyxgFFKgIRQV3lS7HzdSqHHonX0YJ8=; b=ZaoN8QA7wuvFXHStbwhsxIc/NggX33O3FEQoiYRjeGEL57Uu0/djE1vLAeHfKHJi7q4nrM tXJ8EtzuOaZtuFEvFKWcPXnSyE20sq2P3/YOyHjnkWegWpgtgLRv3QxywAuSQ6ihH7h6fT XbeYox/SlzJMVpTfXSSqZgR50W7bxO8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-Fdj0HluaO2Wwf1FVUy9ZjQ-1; Tue, 23 Jun 2020 11:33:58 -0400 X-MC-Unique: Fdj0HluaO2Wwf1FVUy9ZjQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D641019057A1; Tue, 23 Jun 2020 15:33:56 +0000 (UTC) Received: from localhost (unknown [10.18.25.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B0597CCF9; Tue, 23 Jun 2020 15:33:53 +0000 (UTC) Date: Tue, 23 Jun 2020 11:33:52 -0400 From: Mike Snitzer To: Herbert Xu , Ignat Korchagin Cc: Mikulas Patocka , Ignat Korchagin , "David S. Miller" , agk@redhat.com, dm-devel@redhat.com, dm-crypt@saout.de, linux-kernel@vger.kernel.org, kernel-team@cloudflare.com Subject: Re: [RFC PATCH 0/1] dm-crypt excessive overhead Message-ID: <20200623153352.GA19783@redhat.com> References: <20200619164132.1648-1-ignat@cloudflare.com> <20200619165548.GA24779@redhat.com> <20200620012332.GA25340@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200620012332.GA25340@gondor.apana.org.au> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 19 2020 at 9:23pm -0400, Herbert Xu wrote: > On Fri, Jun 19, 2020 at 02:39:39PM -0400, Mikulas Patocka wrote: > > > > I'm looking at this and I'd like to know why does the crypto API fail in > > hard-irq context and why does it work in tasklet context. What's the exact > > reason behind this? > > You're not supposed to do any real work in IRQ handlers. All > the substantial work should be postponed to softirq context. > > Why do you need to do work in hard IRQ context? Ignat, think you may have missed Herbert's question? My understanding is that you're doing work in hard IRQ context (via tasklet) precisely to avoid overhead of putting to a workqueue? Did you try using a workqueue and it didn't work adequately? If so, do you have a handle on why that is? E.g. was it due to increased latency? or IO completion occurring on different cpus that submitted (are you leaning heavily on blk-mq's ability to pin IO completion to same cpu as IO was submitted?) I'm fishing here but I'd just like to tease out the details for _why_ you need to do work from hard IRQ via tasklet so that I can potentially defend it if needed. Thanks, Mike