From patchwork Thu Jun 23 18:05:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yigal Korman X-Patchwork-Id: 9195717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 250886075F for ; Thu, 23 Jun 2016 18:06:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 158C928410 for ; Thu, 23 Jun 2016 18:06:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06FB628469; Thu, 23 Jun 2016 18:06:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0278428410 for ; Thu, 23 Jun 2016 18:05:58 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8E69B1A1DFA; Thu, 23 Jun 2016 11:06:29 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 480241A1DFA for ; Thu, 23 Jun 2016 11:06:28 -0700 (PDT) Received: by mail-lf0-x22a.google.com with SMTP id q132so100950467lfe.3 for ; Thu, 23 Jun 2016 11:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plexistor-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jbzOUGv/JROPOgQ8qTcf4pDnFdY/2TLnzNZ1zG+j1xU=; b=RZiNfvxKQKBcV5pEG/nooWeT3kQ08CztRGOnY6sAjfVnOMf21dZ4ZlwhqvZYraomkB OXCSuO0ecNBNCqibtmNK+/1PB+jxhabZ9Ah0zwiTfZGdZef5wGLMtUG0xdN4Kwv7hPuv p2eg2Lv3z1hqZNkgLuoKhCj+ytGnlqJroDmIfswokVd4YZ6wrvKMxDxQyK/zT0c6rT7q LxNXzS6xgYtQk3eTaBK5DE/BogeqcmWNKb02haPCuLeUzU8uLJt41Mkv9h06Cd4LTgJ3 CFk7XWOJhsMqWL6ND/O9t6XxxHpFEoCosXEqxPXwZVz/iwwpLViyKUAYfqfu54Xuh2b/ xh7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jbzOUGv/JROPOgQ8qTcf4pDnFdY/2TLnzNZ1zG+j1xU=; b=Mz6zdg2IOyieYO1AyYMzRAj4Kko/CjkobNe61I1aUVkHFhh0Rrd0SR5d83idWAxHbq QSti67rQRvGBRz+0B+wdWp2PsXJiqMoh1AEk5mrYlpPvi++N1sRm6tR0q1p34iGb+GJU OQsegzW82nqjm/vDsj6sHGcrb7DYcZDk4GJpgeLpLXWm9vpnEz0KfCklOjwWOvtpBlmX 7pK5BgjfglVPckNQDa6uH824z2Mfu48dj6fHo5QeUg8+SE3xv5V4w+Uux37wGS5YglUe ilgDVbjPv2kNAZQYKnGaA4MNADpMRUqZk1UOMDu4IfPZmLz8azeS8VtgbAL7Hm0oEfI/ 6Xlg== X-Gm-Message-State: ALyK8tIi14lYl3dNKMDrbTc0vFUzXFTjy6AC6uFTYEGzhAoHD42qWZKk3Yqpyk86ucCQo+OouILQIJFWtKRZ6w== X-Received: by 10.46.32.11 with SMTP id g11mr10875463ljg.46.1466705154538; Thu, 23 Jun 2016 11:05:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.149.83 with HTTP; Thu, 23 Jun 2016 11:05:34 -0700 (PDT) In-Reply-To: <1466702773.3504.363.camel@hpe.com> References: <1466639694-25394-1-git-send-email-toshi.kani@hpe.com> <1466639694-25394-2-git-send-email-toshi.kani@hpe.com> <1466702773.3504.363.camel@hpe.com> From: Yigal Korman Date: Thu, 23 Jun 2016 21:05:34 +0300 Message-ID: Subject: Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise their DAX support To: "Kani, Toshimitsu" X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "axboe@kernel.dk" , "linux-s390@vger.kernel.org" , "snitzer@redhat.com" , "linux-nvdimm@lists.01.org" , "heiko.carstens@de.ibm.com" , "linux-kernel@vger.kernel.org" , "linux-raid@vger.kernel.org" , "dm-devel@redhat.com" , "viro@zeniv.linux.org.uk" , "schwidefsky@de.ibm.com" , "agk@redhat.com" Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jun 23, 2016 at 8:36 PM, Kani, Toshimitsu wrote: > On Thu, 2016-06-23 at 19:31 +0300, Yigal Korman wrote: >> On Thu, Jun 23, 2016 at 2:54 AM, Toshi Kani 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 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 >> --- >> 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 Acked-by: Toshi Kani Acked-by: Dan Williams --- block/blk-sysfs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) .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, >> }; >> 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 },