From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751789AbcFWRgf (ORCPT ); Thu, 23 Jun 2016 13:36:35 -0400 Received: from mail-bl2on0122.outbound.protection.outlook.com ([65.55.169.122]:35712 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751159AbcFWRgc (ORCPT ); Thu, 23 Jun 2016 13:36:32 -0400 From: "Kani, Toshimitsu" To: "yigal@plexistor.com" CC: "linux-s390@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "agk@redhat.com" , "heiko.carstens@de.ibm.com" , "linux-raid@vger.kernel.org" , "snitzer@redhat.com" , "axboe@kernel.dk" , "dan.j.williams@intel.com" , "viro@zeniv.linux.org.uk" , "linux-nvdimm@lists.01.org" , "dm-devel@redhat.com" , "schwidefsky@de.ibm.com" Subject: Re: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise their DAX support Thread-Topic: [PATCH v2 1/3] block: add QUEUE_FLAG_DAX for devices to advertise their DAX support Thread-Index: AQHRzOL4V381Uc0IB0+q8QvArux9y5/3P7CAgAAPOIA= Date: Thu, 23 Jun 2016 17:36:29 +0000 Message-ID: <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> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=toshi.kani@hpe.com; x-originating-ip: [15.219.163.9] x-ms-office365-filtering-correlation-id: 4e789fbc-ab12-467d-26c6-08d39b8ce905 x-microsoft-exchange-diagnostics: 1;CS1PR84MB0008;6:s7WVxdsV/wa7iQFT73XvVx/9sxvPwjiyJvGiC+66zxpoLQkc1oMPnz/97OZX9zr2yU/ZnT3uPnPUOHOhASi2rx3U0LFtH7mSBtNNO/B6NVavM1Axg4M6zv4riq+6JFdCN7Bw/w9XXCbOwOYb3D/VY33FVpXyc5U0DoqXmHFJZKYIGSESMQgLPyABP5dl7UNQBYbb2zO26CNvOSFqzH3jmBvjcs3/Xd3YGVY2N2aDlYyECt/0C9/Hu6BXHjACaxYjk4mX12maPG3aSr/T3mGJ0mQpDD4YZee2sZyawwIm5V/i/lh0H0bWQV9t80pdHL7Q;5:tyt3aXDoYZVWAKAsK+JxVs6w9khJECnkpXK6Ob4q/grAD5U9qxVNHBLl+6lk/jQf/NbKMoknyackQZtQU2Qy6qHOlpkrMb32JGFnDU2LYQKF6nOHMi/sPg3221vw2qNyU1hhkTdB+wFW7fIncttnnA==;24:FL2Kos0ELSaKhKecn3R0aKcaFN7c725oeMWhT9GZqjq6MLeT2wIpue+Ng7s40y0FKweMxIn2MnIOWFHOJxR8LwT3ynMTdn1ZMxwymf5wJo4=;7:D2q4J1XAMID2tEXzB5XxXkEuxsaqW50Ve9WMerGLT8ddh+35riI5b9UU/jFyq3Svoz2adlCzhqjVqgGa9602K4X8T4pnAnZVfEJWt0K2VYD/15kt9J9eqj+bVMeWo30lOsWjL9j3P9c5B3xLxoxe2e22WMi64+ohHNQrl9xYqoWdX5trpRfmzfjCEirMfS1XX+HyWOI/mvYyMtTNC7dDsQ2+l6aA1An9vmydmQEk6i9Cd57EfYtSS0YLcMZJhb0VuwLc22a6/x/tHNHgWVCtxw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0008; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:CS1PR84MB0008;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0008; x-forefront-prvs: 098291215C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(24454002)(377424004)(199003)(189002)(377454003)(5002640100001)(76176999)(2906002)(10400500002)(586003)(2501003)(102836003)(4326007)(5640700001)(50986999)(3846002)(6116002)(8936002)(54356999)(101416001)(110136002)(97736004)(103116003)(19580405001)(189998001)(77096005)(105586002)(106356001)(106116001)(19580395003)(33646002)(2900100001)(2950100001)(2351001)(66066001)(36756003)(86362001)(99286002)(305945005)(7736002)(3280700002)(7846002)(68736007)(3660700001)(81156014)(8676002)(1730700003)(81166006)(92566002)(122556002)(87936001);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0008;H:CS1PR84MB0005.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2016 17:36:29.3935 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0008 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u5NHafsF020026 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 I have one minor comment below. > [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); 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, >  }; >