From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B638C2D0B1 for ; Tue, 4 Feb 2020 14:58:55 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07E0D20674; Tue, 4 Feb 2020 14:58:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="dueObL6s"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="OUb1hjq2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="jToIu+2g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07E0D20674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iyzfB-0001Eo-8Q; Tue, 04 Feb 2020 14:58:53 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iyzf8-0001Eb-5f for linux-f2fs-devel@lists.sourceforge.net; Tue, 04 Feb 2020 14:58:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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=AfAKF0TXjgF6cXOTs0IpvR8bmv7Y5y+OTvhW+uwkYRk=; b=dueObL6sYj8f2S4hWYWp+sEZGl Muxa/7WDdyPMrWbL0h+iuSRubggPaHcdJL3KnJI8UwxWfYq5eCDJiKHLeo6jlFRvlEUxpoFy/KoIf K9k7r2Cm+r3mIvxL0i+jO4HDw/EYl/zewEQPrX9vvxNc7ggg1BZ/swApbJp48bNj3fJI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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=AfAKF0TXjgF6cXOTs0IpvR8bmv7Y5y+OTvhW+uwkYRk=; b=OUb1hjq2d+b4n71L+WxGwPnlFO 0XCbaBzkt4SLA0vthjlPVowUDyKHCx7T4sY08tT8vJKrFjVD8VPZilKmifEIhvQmQ5jhdjLRjZ4lc kwZHtC583xz/xZxd+dZDJWbOtq3mQZQXv3q4WIAXEYejje92nfhoJDxOfg8vrI+ULEeQ=; Received: from bombadil.infradead.org ([198.137.202.133]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1iyzf6-00A4NW-CZ for linux-f2fs-devel@lists.sourceforge.net; Tue, 04 Feb 2020 14:58:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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; bh=AfAKF0TXjgF6cXOTs0IpvR8bmv7Y5y+OTvhW+uwkYRk=; b=jToIu+2geApo4hExEekSN8//Dd 2Rr+plF0PB/eoNuH+8VtbAXDE4wYNJTu1b6Hwfffr8N7g3sN6DCWKoRtmBGp+SWEVhVij0/295+Xm 3KYG9tLY7mPgoajeQTZgnjfrZ6xrGHk8TzUFisU2KUe3DsgMpPSiIh3ixf2CkKWhkGlX/KElGf4dk iZlJn5y8HhHxHYup8syqlIqOrhpMUibNDf2+udSBBTeqGaFZy2Kf3MVIgiD56cJ3muEF4LrO4XjLd fU8nHmNSSwQ/sLJtRKRlo+OkWXSuQnCeW7JZuczjuyrd1raDGzt3bW6Mw90hAGtEGOlHripIRvONT GICtGCaw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyzeq-0001AI-T3; Tue, 04 Feb 2020 14:58:32 +0000 Date: Tue, 4 Feb 2020 06:58:32 -0800 From: Christoph Hellwig To: Satya Tangirala Message-ID: <20200204145832.GA28393@infradead.org> References: <20191218145136.172774-1-satyat@google.com> <20200108140556.GB2896@infradead.org> <20200108184305.GA173657@google.com> <20200117085210.GA5473@infradead.org> <20200201005341.GA134917@google.com> <20200203091558.GA28527@infradead.org> <20200204033915.GA122248@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200204033915.GA122248@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Headers-End: 1iyzf6-00A4NW-CZ Subject: Re: [f2fs-dev] [PATCH v6 0/9] Inline Encryption Support X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, Kim Boojin , Kuohong Wang , Barani Muthukumaran , linux-f2fs-devel@lists.sourceforge.net, Christoph Hellwig , linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, Feb 03, 2020 at 07:39:15PM -0800, Satya Tangirala wrote: > Wouldn't that mean that all the other requests in the queue, even ones that > don't even need any inline encryption, also don't get processed until the > queue is woken up again? For the basic implementation yes. > And if so, are we really ok with that? That depends on the use cases. With the fscrypt setup are we still going to see unencrypted I/O to the device as well? If so we'll need to refine the setup and only queue up unencrypted requests. But I'd still try to dumb version first and then refine it. > As you said, we'd need the queue to wake up once a keyslot is available. > It's possible that only some hardware queues and not others get blocked > because of keyslot programming, so ideally, we could somehow make the > correct hardware queue(s) wake up once a keyslot is freed. But the keyslot > manager can't assume that it's actually blk-mq that's being used > underneath, Why? The legacy requet code is long gone. > Also I forgot to mention this in my previous mail, but there may be some > drivers/devices whose keyslots cannot be programmed from an atomic context, > so this approach which might make things difficult in those situations (the > UFS v2.1 spec, which I followed while implementing support for inline > crypto for UFS, does not care whether we're in an atomic context or not, > but there might be specifications for other drivers, or even some > particular UFS inline encryption hardware that do). We have an option to never call ->queue_rq from atomic context (BLK_MQ_F_BLOCKING). But do you know of existing hardware that behaves like this or is it just hypothetical? > So unless you have strong objections, I'd want to continue programming > keyslots per-bio for the above reasons. I'm pretty sure from looking at the code that doing inline encryption at the bio level is the wrong approach. That isn't supposed to end the discussion, but especially things like waking up after a keyslot becomes available fits much better into the request layer resource model that is built around queuing limitations, and not the make_request model that assumes the driver can always queue. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel