From: Mike Snitzer <snitzer@redhat.com>
To: Amar Mudrankit <amar.mudrankit@gmail.com>
Cc: dm-devel@redhat.com
Subject: Re: Query about dm device max_discard_sectors
Date: Sun, 25 Mar 2012 21:49:11 -0400 [thread overview]
Message-ID: <20120326014910.GA31951@redhat.com> (raw)
In-Reply-To: <20120325235421.GA31320@redhat.com>
On Sun, Mar 25 2012 at 7:54pm -0400,
Mike Snitzer <snitzer@redhat.com> wrote:
> On Sun, Mar 25 2012 at 6:46pm -0400,
> Amar Mudrankit <amar.mudrankit@gmail.com> wrote:
>
> > Hi all,
> >
> > I am building an experimental device mapper target which is supposed to
> > receive
> > all TRIM requests (REQ_DISCARD). Irrespective of whether underlying actual
> > physical block device supports discards or not, my device mapper target
> > should
> > receive REQ_DISCARD bios.
>
> I'm just curious but: what will your target do in general?
>
> > In my target, I set:
> >
> > ti->num_discard_requests = 1;
> > ti->discards_supported = 1;
>
> You'll also want to set ti->discards_supported
>
> see: http://git.kernel.org/linus/4c259327
ah, I now see you already did set discards_supported.
> > So, if my device mapper target does not implement iterate_devices function
> > (used to set max_discard_sectors based on underlying physical device's
> > discard
> > support) or underlying physical device does not support discards, then there
> > is no way for device mapper target to set max_discard_sectors more than 0
> > to receive REQ_DISCARD commands.
> >
> > Is this analysis correct? Or I am missing something?
>
> All DM targets should implement .iterate_devices -- intent is to iterate
> over all data devices.
>
> You'll also want to implement .io_hints to set limits->max_discard_sectors
> (like drivers/md/dm-thin.c does).
BTW, the dm-thin.c discard changes will be merged in 3.4, you can see
the relevant patches here:
http://people.redhat.com/agk/patches/linux/editing/dm-thin-support-discards.patch
http://people.redhat.com/agk/patches/linux/editing/dm_thin-add-pool-target-flags-to-control-discard.patch
next prev parent reply other threads:[~2012-03-26 1:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-25 22:46 Query about dm device max_discard_sectors Amar Mudrankit
2012-03-25 23:54 ` Mike Snitzer
2012-03-26 1:49 ` Mike Snitzer [this message]
2012-03-26 13:55 ` Amar Mudrankit
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=20120326014910.GA31951@redhat.com \
--to=snitzer@redhat.com \
--cc=amar.mudrankit@gmail.com \
--cc=dm-devel@redhat.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 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.