linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ashford@whisperpc.com
To: "Nick Krause" <xerofoify@gmail.com>
Cc: ashford@whisperpc.com, "Hugo Mills" <hugo@carfax.org.uk>,
	"linux-btrfs@vger.kernel.org SYSTEM list:BTRFS FILE"
	<linux-btrfs@vger.kernel.org>
Subject: Re: Work Queue for btrfs compression writes
Date: Wed, 30 Jul 2014 11:31:39 -0700	[thread overview]
Message-ID: <bec96bdc2461f34e88cda22119982fcf.squirrel@webmail.wanet.net> (raw)
In-Reply-To: <CAPDOMVgNRJete6N=q9xYCTo-xaL_E2Kjo=NOcfncGLSKkmGuig@mail.gmail.com>

Nick,

> On Wed, Jul 30, 2014 at 11:36 AM,  <ashford@whisperpc.com> wrote:
>>> On Tue, Jul 29, 2014 at 11:54:20PM -0400, Nick Krause wrote:
>>>> Hey Guys ,
>>>> I interested in helping improving the compression of btrfs by using  a
>>>> set of threads using work queues like XFS
>>>> or reads and keeping the page cache after reading compressed blocks as
>>>> these seem to be a great way to improve
>>>> on  compression performance mostly with large partitions of compressed
>>>> data.
>>>
>>>    I suspect that this may be a medium-sized project, rather than a
>>> small one. My gut feeling (based on limited experience) is that the
>>> fallocate extensions project would be considerably simpler.
>>>
>>>    Hugo.
>>
>> I may be in error, but I believe this may be a bit more complex than
>> just
>> routing all reads and writes through a decompression/compression work
>> queue.  On the write side, it might be better to compress the
>> synchronous
>> requests in-line, instead of going through a work queue.  Similarly, on
>> the read side, it might be better to decompress user-requested data (and
>> metadata) in-line, and have any system-generated read-ahead data be
>> decompressed in a work queue (the same work queue?).
>>
>> I believe that one of the significant concerns of the above is that the
>> compression and decompression routines will have to be verified to be
>> thread-safe.  If BTRFS is using the same compression/decompression
>> routines that other file-systems use, then the core code is almost
>> certainly thread-safe.  Any BTRFS wrapper code will have to be verified.
>
> Seems that the code from my reading is that the code is using the same
> compression
> routines as the other file systems. You seem to have some ideas on how
> to write this
> or improve it at least, if you want you can send me a list of ideas
> that you have.

Sorry.  It's been almost 20 years since I did any serious kernel work, and
that kernel (not Linux) didn't even know how to page.  There have been too
many changes since then for me to be able to climb back in with under a
year of hard work.  Even then, I would select a simpler task than this to
start on.

What I DO remember is that the layer you're working on is fairly low in
the stack.  The application, kernel and file-system have already had a
chance to prioritize the I/O requests as synchronous or asynchronous. 
That prioritization must be properly handled, or the overall stability of
BTRFS will be at risk.

Good luck.

Peter Ashford


  reply	other threads:[~2014-07-30 18:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  3:54 Work Queue for btrfs compression writes Nick Krause
2014-07-30  9:38 ` Hugo Mills
2014-07-30 14:13   ` Theodore Ts'o
2014-07-30 14:36     ` Peter Hurley
2014-07-31 11:35       ` Theodore Ts'o
2014-07-30 15:36   ` ashford
2014-07-30 17:19     ` Nick Krause
2014-07-30 18:31       ` ashford [this message]
2014-07-30 19:40         ` Nick Krause
2014-08-04 13:29 ` Chris Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bec96bdc2461f34e88cda22119982fcf.squirrel@webmail.wanet.net \
    --to=ashford@whisperpc.com \
    --cc=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=xerofoify@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).