CEPH filesystem development
 help / color / mirror / Atom feed
From: Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
To: Gregory Farnum <greg@inktank.com>
Cc: Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: DISCARD support in kernel driver
Date: Thu, 30 Jan 2014 16:27:57 +0100	[thread overview]
Message-ID: <52EA6F7D.30001@ovh.net> (raw)
In-Reply-To: <CAPYLRzi5gx-zSnvnAaywNaHq6SNevLL-815P7F_D3zCadVchFg@mail.gmail.com>

Hi Greg,

Thanks for your answer. I did

  $ mount -t ext4 -o discard /dev/rbd1 /mnt
  # did not see any DISCARD op after that
  $ fstrim /mnt
  # neither

Maybe missing something there ? I expected '-o discard' to be enough ?

On 01/30/14 16:24, Gregory Farnum wrote:
> On Thu, Jan 30, 2014 at 1:31 AM, Jean-Tiare LE BIGOT
> <jean-tiare.le-bigot@ovh.net> wrote:
>> Hi,
>>
>> I started to implement 'DISCARD' support in RBD kernel driver as described
>> on http://tracker.ceph.com/issues/190
>>
>> This first (easy) step was to add at the end of
>> drivers/block/rbd.c:rbd_init_disk
>>
>>      /* Advertise discard support for aligned blocks */
>>      queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
>>      disk->queue->limits.discard_granularity = segment_size;
>>      disk->queue->limits.discard_alignment = segment_size;
>>
>> With this both 'mount -o discard' and 'fstrim' stopped to complain about
>> missing 'DISCARD' support. Good !
>>
>> Next step was to add support on `rbd_request_fn` which I did (sort of). But
>> here I'm stuck. If I understood well FS drivers uses `REQ_DISCARD` flag of
>> `rq->cmd_flags` to notify the driver of the discard operation. But the
>> problem is that (rq->cmd_flags & REQ_DISCARD) never appears to be set.
>>
>> I tried copying then removing large files, lots of small files, forcing
>> fstrim. But I never got it. I must be missing something obvious but I can't
>> manage to find what ? Do you have any clue what could be wrong ?
>
> I don't know anything about the relevant kernel internal interfaces
> here, but don't most FSes need to be told explicitly to do trimming?
> Did you do that?
> -Greg
> Software Engineer #42 @ http://inktank.com | http://ceph.com
>

-- 
Jean-Tiare, shared-hosting team



  reply	other threads:[~2014-01-30 16:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30  9:31 DISCARD support in kernel driver Jean-Tiare LE BIGOT
2014-01-30 15:24 ` Gregory Farnum
2014-01-30 15:27   ` Jean-Tiare LE BIGOT [this message]
2014-01-30 15:38     ` Gregory Farnum
2014-02-01  2:36 ` Alex Elsayed
2014-03-11 16:50 ` Sage Weil

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=52EA6F7D.30001@ovh.net \
    --to=jean-tiare.le-bigot@ovh.net \
    --cc=ceph-devel@vger.kernel.org \
    --cc=greg@inktank.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