From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Marshall Subject: Re: fs compression Date: Wed, 27 May 2015 11:53:17 -0700 Message-ID: <5566129D.9040509@cyngn.com> References: <1431145253-2019-1-git-send-email-jaegeuk@kernel.org> <1431145253-2019-3-git-send-email-jaegeuk@kernel.org> <20150513020208.GK15721@dastard> <20150513064802.GA48682@jaegeuk-mac02.hsd1.ca.comcast.net> <20150514003721.GN15721@dastard> <20150516132403.GA2998@thunk.org> <20150516171326.GA24795@eden.sea.cyngn.com> <20150520174635.GA17651@eden.sea.cyngn.com> <20150520213641.GM2871@thunk.org> <20150520224630.GA10927@eden.sea.cyngn.com> <20150521042819.GA14709@eden.sea.cyngn.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Jaegeuk Kim , linux-fsdevel@vger.kernel.org To: Theodore Ts'o Return-path: Received: from mail-pa0-f43.google.com ([209.85.220.43]:32860 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbbE0SxU (ORCPT ); Wed, 27 May 2015 14:53:20 -0400 Received: by padbw4 with SMTP id bw4so4242841pad.0 for ; Wed, 27 May 2015 11:53:20 -0700 (PDT) In-Reply-To: <20150521042819.GA14709@eden.sea.cyngn.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: As I mentioned earlier, I had a hack working for transparent file compression. But it has a few problems. The two major ones are (1) It reads the lower pages synchronously by waiting on pages with wait_on_page_locked(), destroying readahead, and (2) it is swapping out i_size to call the lower readpage. So I'm ditching that and going another route. My idea now is to create a wrapper inode that is passed back to the VFS layer. The wrapper inode would have the correct i_size, blkbits, and implement address_space_operations. The implementation of readpage/readpages would then call down into the lower filesystem's readpage/readpages to fetch compressed data. When the required pages are available, it would decompress and populate its own requested pages. But one thing I'm wrestling with is how to be asynchronously notified when the lower readpage/readpages complete. The two ideas that come to mind are (1) plumbing a callback into mpage_end_io(), (2) allowing override of mpage_end_io() with a custom function, (3) creating kernel threads analogous to kblockd to wait for pending pages. But again, I'm new at this, so maybe there's an easier or better way?