Received: by 10.213.65.68 with SMTP id h4csp196331imn; Tue, 3 Apr 2018 18:41:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+qRk8mqoONx1rxsYX+F3ogH2nhpucD2kakroG6ILs+qjYEf/5phS9BU445L4/CW69K9pjq X-Received: by 10.98.65.220 with SMTP id g89mr12203496pfd.97.1522806108806; Tue, 03 Apr 2018 18:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522806108; cv=none; d=google.com; s=arc-20160816; b=FNBJiVk49A2PA5YjRUjQQa0YHzR+sCzboxVOM4ZydO+6hsKvW3dJy4rktc2d6cOr5V 0rmV2SKEweHeY5LUFOyd9ikajpDwZ3KDDHLpw/wktAAmLINITN2b096cezBh7tk7izVr ZoRCYotYN1n39pd5bF6Dzj/ilgVfgPNnEJpOEyRdkGCdiK7U5GUo27SZRtbBIgaNzl2F 6UP2QJL1soHaK0NzVhkwBrp51Sjj9OspP6DXP+wqbm4pnvS1YeITwsR9YjVDNvvqS9uV tWVOclVGjCGZlBYLa68YqE7bz2Z8vBufrn+KOxIKEZAzAVv5jdr6q5NU1avjuRlhl1gh WLmQ== 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:arc-authentication-results; bh=3NYOyoSvgAsDCCBdIrvttHuDXgLnQ7FhA8If8SrWXVQ=; b=xb3iyjgCR20FedzZClDvfveMPD8RxBufQeEwx/gvrX563V4An3VXJtyidxchkyyx2G uIJgQRk+Y5iO0sbau2SrOwHhjLjr+mClidBZ24yPOCHuN11APGJZuQAuM9Brb6HEVGZm CSz2+elWtPvwUIFJ/B+EEYRuez/IYdRZo3sgTbWjdsd2DZUP52Q3nUBYCof0X1+NudJ7 KrQtp+3/dQ0uMtIRlFSIZz1znSoifyeZN1LXndW5cx1eti90FnQxp6vLS4ds55JaR3yU KHuN2jX+JjGvCPUrad1do67EmugEar2+wpHxhfF4KF45pZteFgfRnfN091IwFUZmZWvR C/jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RuMYH6lW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si4264673plj.703.2018.04.03.18.41.34; Tue, 03 Apr 2018 18:41:48 -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=pass header.i=@gmail.com header.s=20161025 header.b=RuMYH6lW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754794AbeDDBkc (ORCPT + 99 others); Tue, 3 Apr 2018 21:40:32 -0400 Received: from mail-pl0-f50.google.com ([209.85.160.50]:39674 "EHLO mail-pl0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753733AbeDDBka (ORCPT ); Tue, 3 Apr 2018 21:40:30 -0400 Received: by mail-pl0-f50.google.com with SMTP id s24-v6so11736614plq.6; Tue, 03 Apr 2018 18:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3NYOyoSvgAsDCCBdIrvttHuDXgLnQ7FhA8If8SrWXVQ=; b=RuMYH6lW9NfTS8z9Q4cDcfm2LG9FKn6CnWH9PqY81xo1Wf2P1iZuwqBXYSdUYxgY5G W9VH7XrgHEowRBstOQ3+MZeBBuhMiawQ54I4Uhu0qB6AzdXpVQ5Et1ssNQpO/Jsp368d y70Wottc22DqsLTiBVd0VQR84OReO/yv+uusJqPJZG+oTlcKfP46It14xGrdkavrHitR o59G4P9FpZJ3LQqVx0H4/I3A+hIVLpHopLXSH041Bi7hMTnOQW2A8XunDMiXaCOjE+f2 smKQipV2d4CY0YbFJ0CT5bw05cmXsr1TPrNEkg5J3LfkMfkv//U5LcAYsI1Q2MlYmPtI xbWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3NYOyoSvgAsDCCBdIrvttHuDXgLnQ7FhA8If8SrWXVQ=; b=gq4oFOygdBZJ/VkA3DCDEIQIQoUkgx+fYB0wDN/3F7+6Jyt9Vcq4i8fNeIgt0qNpuK bSZW3dXZAumAYkZtI8I6UUEGoWPHq3WYJK7bQIX8xgHXm5gRkHWqQDCOkI6gv4QFWAEy ZhT5N7uDHa9EXbLk1Ghaso6O1WhGZceUGzbqUKwo3++S++4CHqQT/fVYMFEyNdw+qZgR CwsZhweFVYVYTNsOmA6yyht0lAzj6xuqYou9783N3rAYZWkO42CIrVAOt1jqQMtXvm0h 4YZwTtHF3rDw94bgkdn2uZHwHj8VhM6b7TcUQjlikDGvaKaxEZbFYGF3EZQlse4CzMWX sxHw== X-Gm-Message-State: AElRT7ELOEjSw4YFMj4oIV/N4qZlgcXwDRD4Lg7LY7j0/52bbBrywa4n Kbee7VOFTzixhiLLp87TCYI= X-Received: by 10.98.76.68 with SMTP id z65mr12431048pfa.181.1522806029743; Tue, 03 Apr 2018 18:40:29 -0700 (PDT) Received: from localhost ([110.70.27.13]) by smtp.gmail.com with ESMTPSA id 189sm7831336pfu.44.2018.04.03.18.40.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 18:40:28 -0700 (PDT) Date: Wed, 4 Apr 2018 10:40:23 +0900 From: Sergey Senozhatsky To: Vaneet Narang Cc: Maninder Singh , "sergey.senozhatsky.work@gmail.com" , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "minchan@kernel.org" , "ngupta@vflare.org" , "keescook@chromium.org" , "anton@enomsg.org" , "ccross@android.com" , "tony.luck@intel.com" , "akpm@linux-foundation.org" , "colin.king@canonical.com" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , PANKAJ MISHRA , AMIT SAHRAWAT Subject: Re: [PATCH 1/1] lz4: Implement lz4 with dynamic offset length. Message-ID: <20180404014023.GA5087@jagdpanzerIV> References: <20180403122642.GA26934@jagdpanzerIV> <20180321074948.GA2746@jagdpanzerIV> <1521607242-3968-1-git-send-email-maninder1.s@samsung.com> <1521607242-3968-2-git-send-email-maninder1.s@samsung.com> <20180402055152epcms5p546fdb62381b769ed0c719f3bedcee3b8@epcms5p5> <576192949.596772.1522763027665.JavaMail.jboss@ep1ml501> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <576192949.596772.1522763027665.JavaMail.jboss@ep1ml501> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (04/03/18 19:13), Vaneet Narang wrote: > Hi Sergey, > > >You shrink a 2 bytes offset down to a 1 byte offset, thus you enforce that > 2 Byte offset is not shrinked to 1 byte, Its only 1 bit is reserved out of > 16 bits of offset. So only 15 Bits can be used to store offset value. Yes, you are right. My bad, was thinking about something else. > >'page should be less than 32KB', which I'm sure will be confusing. > lz4_dyn will work on bigger data length(> 32k) but in that case compression > ratio may not be better than LZ4. This is same as LZ4 compressing data more > than 64K (16Bits). LZ4 can't store offset more than 64K similarly > LZ4 dyn can't store offset more than 32K. Then drop that `if PAGE_SIZE' thing. I'd rather do that stuff internally in lz4... if it needed at all. > >And you > >rely on lz4_dyn users to do the right thing - namely, to use that 'nice' > >`#if (PAGE_SIZE < (32 * KB))'. > They don't need to add this code Then drop it. > >Apart from that, lz4_dyn supports only data > >in up to page_size chunks. Suppose my system has page_size of less than 32K, > >so I legitimately can enable lz4_dyn, but suppose that I will use it > >somewhere where I don't work with page_size-d chunks. Will I able to just > >do tfm->compress(src, sz) on random buffers? The whole thing looks to be > >quite fragile. > No thats not true, lz4_dyn can work for random buffers and it need not be > of page size chunks. There is no difference in Lz4 and Lz4 dyn working. You are right. -ss