Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3243067ybt; Mon, 29 Jun 2020 20:10:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3gjHXN8SU28DQoyv2VmFwFBlzUFDCHowicaIWfu7tnPR1jF4UsIqR6WO9Q62e3x9zOI30 X-Received: by 2002:aa7:d457:: with SMTP id q23mr17878925edr.376.1593486630018; Mon, 29 Jun 2020 20:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593486630; cv=none; d=google.com; s=arc-20160816; b=AzABffdSA/zRCnIcvauj8RWC9lhX0iXkCYIBZBm+harG9yHT5sCGnp9FyuudC1jdR6 vozG6N8Ka+a8Xkf0HqpQQR4jlAdP2YD8of172F0yanuMJO/3UAD3GfqUFDACX/TqhNpD l5C9NNvhdz2no93b/AJZ7Uayzn1XtEHv82TPfdCk7nrjAXRLXDynQ1POiE/GByOrlWLA deJ/HOpn8eYdxUxoI3SqG9pRti63WU5o+a9wzVMRtPqqIp07CkftWD6W+sA55oUoCH/k FOcr9Od9SUB+tp2QeB4wgjYr+ROtjfirfsgbRtKpae4akjhdaGsP0eyfeq8AtrierVT1 1rtg== 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; bh=MEkSIlLz7wMs/pzG8HJMtInTXq0MERCvLeo8UqGgm9c=; b=aEe4TKBCeTN/MWT1YJhpNzpDZ6EXdVQACeXzAY0tsOlYt4n89C3PEpJGaWrlqShkig TP7vMpAti63cY7KV9b+3Im5eRNIRObU9jkRjzQ+v4vNasczli9mcoJSQDRCsEixHsYLE v3YEBPpcCuoTp/TKoGN+hlBvX7h4583GT+zVqd9KQO1Es/vRxg6Rx8Eux8ruqfcrXcVj 2gA4w/Vb0Cbaj8cAn7pSBS5hHhLhRb1QkGkGTFKUkyeadlubgkzEvOIg9OouHm8vX9wp DtIZC4Bj9h2hfYpty1R+BbJSKWkLLzyc6tlXC5CYNLc7+dRyM6htppPshz6a24tIJwU7 9TMA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p26si892714edy.181.2020.06.29.20.10.06; Mon, 29 Jun 2020 20:10:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728956AbgF3DJ5 (ORCPT + 99 others); Mon, 29 Jun 2020 23:09:57 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:60732 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbgF3DJ5 (ORCPT ); Mon, 29 Jun 2020 23:09:57 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1jq6eW-0007F8-FF; Tue, 30 Jun 2020 13:09:45 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Tue, 30 Jun 2020 13:09:44 +1000 Date: Tue, 30 Jun 2020 13:09:44 +1000 From: Herbert Xu To: Damien Le Moal Cc: Ignat Korchagin , "agk@redhat.com" , "snitzer@redhat.com" , "dm-devel@redhat.com" , "dm-crypt@saout.de" , "linux-kernel@vger.kernel.org" , "ebiggers@kernel.org" , "mpatocka@redhat.com" , "kernel-team@cloudflare.com" Subject: Re: [PATCH v2] dm crypt: add flags to optionally bypass dm-crypt workqueues Message-ID: <20200630030944.GA20706@gondor.apana.org.au> References: <20200626210302.1813-1-ignat@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 30, 2020 at 02:51:17AM +0000, Damien Le Moal wrote: > > > @@ -1463,12 +1465,12 @@ static void crypt_alloc_req_skcipher(struct crypt_config *cc, > > * requests if driver request queue is full. > > */ > > skcipher_request_set_callback(ctx->r.req, > > - CRYPTO_TFM_REQ_MAY_BACKLOG, > > + nobacklog ? 0 : CRYPTO_TFM_REQ_MAY_BACKLOG, > > kcryptd_async_done, dmreq_of_req(cc, ctx->r.req)); > > Will not specifying CRYPTO_TFM_REQ_MAY_BACKLOG always cause the crypto API to > return -EBUSY ? From the comment above the skcipher_request_set_callback(), it > seems that this will be the case only if the skcipher diver queue is full. So in > other word, keeping the kcryptd_async_done() callback and executing the skcipher > request through crypt_convert() and crypt_convert_block_skcipher() may still end > up being an asynchronous operation. Can you confirm this and is it what you > intended to implement ? The purpose of MAY_BACKLOG is to make the crypto request reliable. It has nothing to do with whether the request will be synchronous or not. Without the backlog flag, if the hardware queue is full the request will simply be dropped, which is appropriate in the network stack with IPsec where congestion can be dealt with at the source. Block layer on the other hand should always use the backlog flag and stop sending more requests to the crypto API until the congestion goes away. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt