All of lore.kernel.org
 help / color / mirror / Atom feed
* DISCARD support in kernel driver
@ 2014-01-30  9:31 Jean-Tiare LE BIGOT
  2014-01-30 15:24 ` Gregory Farnum
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jean-Tiare LE BIGOT @ 2014-01-30  9:31 UTC (permalink / raw)
  To: Ceph Development

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 ?

Thanks,

-- 
Jean-Tiare, shared-hosting team


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-11 16:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-01-30 15:38     ` Gregory Farnum
2014-02-01  2:36 ` Alex Elsayed
2014-03-11 16:50 ` Sage Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.