Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1430031

Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise their DAX support

From Yigal Korman <yigal@plexistor.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise their DAX support
Date 2016-06-23 20:10 +0200
Message-ID <rNheF-5oI-1@gated-at.bofh.it> (permalink)
References <rN0nw-28g-5@gated-at.bofh.it> <rN0nw-28g-15@gated-at.bofh.it> <rNfPz-4cB-7@gated-at.bofh.it> <rNgLD-4Qw-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jun 23, 2016 at 8:36 PM, Kani, Toshimitsu <toshi.kani@hpe.com> wrote:
> On Thu, 2016-06-23 at 19:31 +0300, Yigal Korman wrote:
>> On Thu, Jun 23, 2016 at 2:54 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
>> >
>> >
>> > Currently, presence of direct_access() in block_device_operations
>> > indicates support of DAX on its block device.  Because
>> > block_device_operations is instantiated with 'const', this DAX
>> > capablity may not be enabled conditinally.
>> >
>> > In preparation for supporting DAX to device-mapper devices, add
>> > QUEUE_FLAG_DAX to request_queue flags to advertise their DAX
>> > support.  This will allow to set the DAX capability based on how
>> > mapped device is composed.
>>
>> Hi Toshi,
>> This patch is very helpful!
>> I think QUEUE_FLAG_DAX can also help with identifying dax devices in
>> userspace.
>> Perhaps you'd be willing to squash the patch below with this one or
>> add it to your submission?
>
> Hi Yigal,
>
> Good idea.  Mike can probably take it into his tree, but I will include it
> into the series if I needed to submit v3.
>
> Acked-by: Toshi Kani <toshi.kani@hpe.com>

Great, Thanks!
I'll follow the thread to see if it goes through or needs to be resubmitted.

>
> I have one minor comment below.

My reply below as well.

>
>> [PATCH] block: expose QUEUE_FLAG_DAX in sysfs
>>
>> There's currently no way to identify DAX enabled devices in userspace.
>>
>> Signed-off-by: Yigal Korman <yigal@plexistor.com>
>> ---
>>  block/blk-sysfs.c | 15 +++++++++++++++
>>  1 file changed, 15 insertions(+)
>>
>> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
>> index 9920596..d55126d 100644
>> --- a/block/blk-sysfs.c
>> +++ b/block/blk-sysfs.c
>> @@ -379,6 +379,15 @@ static ssize_t queue_wc_store(struct
>> request_queue *q, const char *page,
>>         return count;
>>  }
>>
>> +static ssize_t queue_dax_show(struct request_queue *q, char *page)
>> +{
>> +       int bit;
>> +
>> +       bit = test_bit(QUEUE_FLAG_DAX, &q->queue_flags);
>> +
>> +       return queue_var_show(bit, page);
>
> This can be:
>         return queue_var_show(blk_queue_dax(q), page);

Oh, sure, of course you're right. thanks.

Subject: [PATCH] block: expose QUEUE_FLAG_DAX in sysfs

There's currently no way to identify DAX enabled devices in userspace.

Signed-off-by: Yigal Korman <yigal@plexistor.com>
Acked-by: Toshi Kani <toshi.kani@hpe.com>
---
 block/blk-sysfs.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 9920596..f87a7e7 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -379,6 +379,11 @@ static ssize_t queue_wc_store(struct
request_queue *q, const char *page,
        return count;
 }

+static ssize_t queue_dax_show(struct request_queue *q, char *page)
+{
+       return queue_var_show(blk_queue_dax(q), page);
+}
+
 static struct queue_sysfs_entry queue_requests_entry = {
        .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
        .show = queue_requests_show,
@@ -516,6 +521,11 @@ static struct queue_sysfs_entry queue_wc_entry = {
        .store = queue_wc_store,
 };

+static struct queue_sysfs_entry queue_dax_entry = {
+       .attr = {.name = "dax", .mode = S_IRUGO },
+       .show = queue_dax_show,
+};
+
 static struct attribute *default_attrs[] = {
        &queue_requests_entry.attr,
        &queue_ra_entry.attr,
@@ -542,6 +552,7 @@ static struct attribute *default_attrs[] = {
        &queue_random_entry.attr,
        &queue_poll_entry.attr,
        &queue_wc_entry.attr,
+       &queue_dax_entry.attr,
        NULL,
 };

--
1.9.3

Thanks,
Yigal

>
> Thanks,
> -Toshi
>
>> +}
>> +
>>  static struct queue_sysfs_entry queue_requests_entry = {
>>         .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
>>         .show = queue_requests_show,
>> @@ -516,6 +525,11 @@ static struct queue_sysfs_entry queue_wc_entry = {
>>         .store = queue_wc_store,
>>  };
>>
>> +static struct queue_sysfs_entry queue_dax_entry = {
>> +       .attr = {.name = "dax", .mode = S_IRUGO },
>> +       .show = queue_dax_show,
>> +};
>> +
>>  static struct attribute *default_attrs[] = {
>>         &queue_requests_entry.attr,
>>         &queue_ra_entry.attr,
>> @@ -542,6 +556,7 @@ static struct attribute *default_attrs[] = {
>>         &queue_random_entry.attr,
>>         &queue_poll_entry.attr,
>>         &queue_wc_entry.attr,
>> +       &queue_dax_entry.attr,
>>         NULL,
>>  };
>>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] Support DAX for device-mapper dm-linear devices Toshi Kani <toshi.kani@hpe.com> - 2016-06-23 02:10 +0200
  [PATCH v2 2/3] dm: add infrastructure for DAX support Toshi Kani <toshi.kani@hpe.com> - 2016-06-23 02:10 +0200
  [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise their DAX support Toshi Kani <toshi.kani@hpe.com> - 2016-06-23 02:10 +0200
    Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise  their DAX support Yigal Korman <yigal@plexistor.com> - 2016-06-23 18:40 +0200
      Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise  their DAX support "Kani, Toshimitsu" <toshi.kani@hpe.com> - 2016-06-23 19:40 +0200
        Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise  their DAX support Yigal Korman <yigal@plexistor.com> - 2016-06-23 20:10 +0200
          Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise  their DAX support Dan Williams <dan.j.williams@intel.com> - 2016-06-23 20:20 +0200
        Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to  advertise their DAX support Mike Snitzer <snitzer@redhat.com> - 2016-06-23 23:20 +0200
  [PATCH v2 3/3] dm linear: add DAX support Toshi Kani <toshi.kani@hpe.com> - 2016-06-23 02:10 +0200

csiph-web