From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752044AbcJJGoK (ORCPT ); Mon, 10 Oct 2016 02:44:10 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:36424 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbcJJGoI (ORCPT ); Mon, 10 Oct 2016 02:44:08 -0400 Date: Mon, 10 Oct 2016 15:44:04 +0900 From: Sergey Senozhatsky To: Cory Pruce Cc: Sergey Senozhatsky , Nitin Gupta , "minchan@kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: Zram for FreeBSD Message-ID: <20161010064404.GA488@swordfish> References: <20161006044321.GC5458@swordfish> <3D1127B8-789C-4276-803E-49E10D2C4280@juniper.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3D1127B8-789C-4276-803E-49E10D2C4280@juniper.net> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (10/07/16 17:30), Cory Pruce wrote: > Cool, I am starting to get a good grasp on what is going on (I’ll probably > need to use FreeBSD’s archive.h as opposed to Linux’s crypto.h). I am trying > to get a hold on what exactly I need to port to FreeBSD. I see that (as Nitin > suggested) zsmalloc is the main brains of handling the objects and that it > creates a fixed amount of sharded “pages” which a compressed (or > uncompressed) actual page can span. I see also that that depends on zpool. zsmalloc doesn't depend on zpool. zpool is an abstraction layer used by zswap. > I will probably find all “dependencies”; however, if one of you could > describe the components used/implemented for this, that’d be awesome. Also, > any linux specific setup/layout details come to mind? there is a whole bunch of hacks that Nitin, Minchan and others used in zsmalloc() to minimize its space consumption (struct page fields re-usage, etc). comments in zsmalloc() can shed some light. -ss