Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177AbbHTGrm (ORCPT ); Thu, 20 Aug 2015 02:47:42 -0400 Received: from helcar.hengli.com.au ([209.40.204.226]:51155 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245AbbHTGrl (ORCPT ); Thu, 20 Aug 2015 02:47:41 -0400 Date: Thu, 20 Aug 2015 14:47:28 +0800 From: Herbert Xu To: Joonsoo Kim Cc: Andrew Morton , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, "David S. Miller" , Stephan Mueller , Joonsoo Kim Subject: Re: [PATCH v2 1/8] crypto: support (de)compression API that doesn't require tfm object Message-ID: <20150820064728.GA26840@gondor.apana.org.au> References: <1440052504-15442-1-git-send-email-iamjoonsoo.kim@lge.com> <1440052504-15442-2-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440052504-15442-2-git-send-email-iamjoonsoo.kim@lge.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1512 Lines: 34 On Thu, Aug 20, 2015 at 03:34:57PM +0900, Joonsoo Kim wrote: > Until now, tfm object embeds (de)compression context in it and > (de)compression in crypto API requires tfm object to use > this context. But, there are some algorithms that doesn't need > such context to operate. Therefore, this patch introduce new crypto > compression API that call (de)compression function via crypto_alg, > instead of tfm object. crypto_alg is required to get appropriate > (de)compression function pointer. This can reduce overhead of > maintaining multiple tfm if (de)compression doesn't require > any context to operate. > > Signed-off-by: Joonsoo Kim This isn't going to fly I'm afraid. The main purpose of a tfm is not to allocate memory but to track the crypto_alg object which could be a hardware device. So you're not going to get away with not allocating it. What you can do for these contextless algorithms (and by definition every compression algorithm is conxteless) is to allocate a system- wide tfm that is used by everybody, or at least by every one within your subsystem. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/