From: Pankaj Gupta <pagupta@redhat.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: rdunlap@infradead.org, jack@suse.cz, kvm@vger.kernel.org,
mst@redhat.com, jasowang@redhat.com, david@fromorbit.com,
qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org,
dm-devel@redhat.com, adilger kernel <adilger.kernel@dilger.ca>,
zwisler@kernel.org, aarcange@redhat.com,
dave jiang <dave.jiang@intel.com>,
jstaron@google.com, linux-nvdimm@lists.01.org,
vishal l verma <vishal.l.verma@intel.com>,
david@redhat.com, willy@infradead.org, hch@infradead.org,
linux-acpi@vger.kernel.org, jmoyer@redhat.com,
linux-ext4@vger.kernel.org, lenb@kernel.org, kilobyte@angband.pl,
riel@surriel.com, yuval shaia <yuval.shaia@oracle.com>,
stefanha@redhat.com, imammedo@redhat.com,
dan j williams <dan.j.williams@intel.com>,
lcapitulino@redhat.com, kwolf@redhat.com, nilal@redhat.com
Subject: Re: [Qemu-devel] [PATCH v11 4/7] dm: enable synchronous dax
Date: Tue, 11 Jun 2019 12:04:21 -0400 (EDT) [thread overview]
Message-ID: <1006124881.34430329.1560269061491.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20190611150427.GA29288@redhat.com>
>
> > Hi Mike,
> >
> > Thanks for the review Please find my reply inline.
> >
> > >
> > > dm_table_supports_dax() is called multiple times (from
> > > dm_table_set_restrictions and dm_table_determine_type). It is strange
> > > to have a getter have a side-effect of being a setter too. Overloading
> > > like this could get you in trouble in the future.
> > >
> > > Are you certain this is what you want?
> >
> > I agree with you.
> >
> > >
> > > Or would it be better to refactor dm_table_supports_dax() to take an
> > > iterate_devices_fn arg and have callers pass the appropriate function?
> > > Then have dm_table_set_restrictions() caller do:
> > >
> > > if (dm_table_supports_dax(t, device_synchronous, NULL))
> > > set_dax_synchronous(t->md->dax_dev);
> > >
> > > (NULL arg implies dm_table_supports_dax() refactoring would take a int
> > > *data pointer rather than int type).
> > >
> > > Mike
> > >
> >
> > I am sending below patch as per your suggestion. Does it look
> > near to what you have in mind?
>
> Yes, it does.. just one nit I noticed inlined below.
>
> > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> > index 350cf0451456..8d89acc8b8c2 100644
> > --- a/drivers/md/dm-table.c
> > +++ b/drivers/md/dm-table.c
>
> ...
>
> > @@ -1910,8 +1919,13 @@ void dm_table_set_restrictions(struct dm_table *t,
> > struct request_queue *q,
> > }
> > blk_queue_write_cache(q, wc, fua);
> >
> > - if (dm_table_supports_dax(t, PAGE_SIZE))
> > + if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {
> > +
>
> No need for an empty newline here ^
Sure. Will remove this and send official v12 patchset with the updated patch 4.
Thanks,
Pankaj
>
> > blk_queue_flag_set(QUEUE_FLAG_DAX, q);
> > + if (dm_table_supports_dax(t, device_synchronous, NULL))
> > + set_dax_synchronous(t->md->dax_dev);
> > + }
> > else
> > blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
> >
>
> Thanks,
> Mike
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Pankaj Gupta <pagupta@redhat.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: rdunlap@infradead.org, jack@suse.cz, kvm@vger.kernel.org,
mst@redhat.com, jasowang@redhat.com, david@fromorbit.com,
qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org,
dm-devel@redhat.com, adilger kernel <adilger.kernel@dilger.ca>,
zwisler@kernel.org, aarcange@redhat.com,
dave jiang <dave.jiang@intel.com>,
jstaron@google.com, linux-nvdimm@lists.01.org,
vishal l verma <vishal.l.verma@intel.com>,
david@redhat.com, willy@infradead.org, hch@infradead.org,
linux-acpi@vger.kernel.org, jmoyer@redhat.com,
linux-ext4@vger.kernel.org, lenb@kernel.org, kilobyte@angband.pl,
riel@surriel.com, yuval shaia <yuval.shaia@oracle.com>,
stefanha@redhat.com, imammedo@redhat.com,
dan j williams <dan.j.williams@intel.com>,
lcapitulino@redhat.com, kwolf@redhat.com, nilal@redhat.com,
tytso@mit.edu, xiaoguangrong eric <xiaoguangrong.eric@gmail.com>,
cohuck@redhat.com, rjw@rjwysocki.net,
linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, pbonzini@redhat.com,
darrick wong <darrick.wong@oracle.com>
Subject: Re: [Qemu-devel] [PATCH v11 4/7] dm: enable synchronous dax
Date: Tue, 11 Jun 2019 12:04:21 -0400 (EDT) [thread overview]
Message-ID: <1006124881.34430329.1560269061491.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20190611150427.GA29288@redhat.com>
>
> > Hi Mike,
> >
> > Thanks for the review Please find my reply inline.
> >
> > >
> > > dm_table_supports_dax() is called multiple times (from
> > > dm_table_set_restrictions and dm_table_determine_type). It is strange
> > > to have a getter have a side-effect of being a setter too. Overloading
> > > like this could get you in trouble in the future.
> > >
> > > Are you certain this is what you want?
> >
> > I agree with you.
> >
> > >
> > > Or would it be better to refactor dm_table_supports_dax() to take an
> > > iterate_devices_fn arg and have callers pass the appropriate function?
> > > Then have dm_table_set_restrictions() caller do:
> > >
> > > if (dm_table_supports_dax(t, device_synchronous, NULL))
> > > set_dax_synchronous(t->md->dax_dev);
> > >
> > > (NULL arg implies dm_table_supports_dax() refactoring would take a int
> > > *data pointer rather than int type).
> > >
> > > Mike
> > >
> >
> > I am sending below patch as per your suggestion. Does it look
> > near to what you have in mind?
>
> Yes, it does.. just one nit I noticed inlined below.
>
> > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> > index 350cf0451456..8d89acc8b8c2 100644
> > --- a/drivers/md/dm-table.c
> > +++ b/drivers/md/dm-table.c
>
> ...
>
> > @@ -1910,8 +1919,13 @@ void dm_table_set_restrictions(struct dm_table *t,
> > struct request_queue *q,
> > }
> > blk_queue_write_cache(q, wc, fua);
> >
> > - if (dm_table_supports_dax(t, PAGE_SIZE))
> > + if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {
> > +
>
> No need for an empty newline here ^
Sure. Will remove this and send official v12 patchset with the updated patch 4.
Thanks,
Pankaj
>
> > blk_queue_flag_set(QUEUE_FLAG_DAX, q);
> > + if (dm_table_supports_dax(t, device_synchronous, NULL))
> > + set_dax_synchronous(t->md->dax_dev);
> > + }
> > else
> > blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
> >
>
> Thanks,
> Mike
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Pankaj Gupta <pagupta@redhat.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: cohuck@redhat.com, jack@suse.cz, kvm@vger.kernel.org,
mst@redhat.com, jasowang@redhat.com, david@fromorbit.com,
qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org,
dm-devel@redhat.com, adilger kernel <adilger.kernel@dilger.ca>,
zwisler@kernel.org, aarcange@redhat.com, jstaron@google.com,
linux-nvdimm@lists.01.org, david@redhat.com, willy@infradead.org,
hch@infradead.org, linux-acpi@vger.kernel.org,
linux-ext4@vger.kernel.org, lenb@kernel.org, kilobyte@angband.pl,
riel@surriel.com, yuval shaia <yuval.shaia@oracle.com>,
stefanha@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com,
kwolf@redhat.com, nilal@redhat.com, tytso@mit.edu,
xiaoguangrong eric <xiaoguangrong.eric@gmail.com>,
rdunlap@infradead.org, rjw@rjwysocki.net,
linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, imammedo@redhat.com,
darrick wong <darrick.wong@oracle.com>
Subject: Re: [Qemu-devel] [PATCH v11 4/7] dm: enable synchronous dax
Date: Tue, 11 Jun 2019 12:04:21 -0400 (EDT) [thread overview]
Message-ID: <1006124881.34430329.1560269061491.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20190611150427.GA29288@redhat.com>
>
> > Hi Mike,
> >
> > Thanks for the review Please find my reply inline.
> >
> > >
> > > dm_table_supports_dax() is called multiple times (from
> > > dm_table_set_restrictions and dm_table_determine_type). It is strange
> > > to have a getter have a side-effect of being a setter too. Overloading
> > > like this could get you in trouble in the future.
> > >
> > > Are you certain this is what you want?
> >
> > I agree with you.
> >
> > >
> > > Or would it be better to refactor dm_table_supports_dax() to take an
> > > iterate_devices_fn arg and have callers pass the appropriate function?
> > > Then have dm_table_set_restrictions() caller do:
> > >
> > > if (dm_table_supports_dax(t, device_synchronous, NULL))
> > > set_dax_synchronous(t->md->dax_dev);
> > >
> > > (NULL arg implies dm_table_supports_dax() refactoring would take a int
> > > *data pointer rather than int type).
> > >
> > > Mike
> > >
> >
> > I am sending below patch as per your suggestion. Does it look
> > near to what you have in mind?
>
> Yes, it does.. just one nit I noticed inlined below.
>
> > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> > index 350cf0451456..8d89acc8b8c2 100644
> > --- a/drivers/md/dm-table.c
> > +++ b/drivers/md/dm-table.c
>
> ...
>
> > @@ -1910,8 +1919,13 @@ void dm_table_set_restrictions(struct dm_table *t,
> > struct request_queue *q,
> > }
> > blk_queue_write_cache(q, wc, fua);
> >
> > - if (dm_table_supports_dax(t, PAGE_SIZE))
> > + if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {
> > +
>
> No need for an empty newline here ^
Sure. Will remove this and send official v12 patchset with the updated patch 4.
Thanks,
Pankaj
>
> > blk_queue_flag_set(QUEUE_FLAG_DAX, q);
> > + if (dm_table_supports_dax(t, device_synchronous, NULL))
> > + set_dax_synchronous(t->md->dax_dev);
> > + }
> > else
> > blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
> >
>
> Thanks,
> Mike
>
>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
WARNING: multiple messages have this Message-ID (diff)
From: Pankaj Gupta <pagupta@redhat.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: cohuck@redhat.com, jack@suse.cz, kvm@vger.kernel.org,
mst@redhat.com, jasowang@redhat.com, david@fromorbit.com,
qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org,
dm-devel@redhat.com, adilger kernel <adilger.kernel@dilger.ca>,
zwisler@kernel.org, aarcange@redhat.com,
dave jiang <dave.jiang@intel.com>,
jstaron@google.com, linux-nvdimm@lists.01.org,
vishal l verma <vishal.l.verma@intel.com>,
david@redhat.com, willy@infradead.org, hch@infradead.org,
linux-acpi@vger.kernel.org, jmoyer@redhat.com,
linux-ext4@vger.kernel.org, lenb@kernel.org, kilobyte@angband.pl,
riel@surriel.com, yuval shaia <yuval.shaia@oracle.com>,
stefanha@redhat.com, pbonzini@redhat.com,
dan j williams <dan.j.williams@intel.com>,
lcapitulino@redhat.com, kwolf@redhat.com, nilal@redhat.com,
tytso@mit.edu, xiaoguangrong eric <xiaoguangrong.eric@gmail.com>,
rdunlap@infradead.org, rjw@rjwysocki.net,
linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, imammedo@redhat.com,
darrick wong <darrick.wong@oracle.com>
Subject: Re: [Qemu-devel] [PATCH v11 4/7] dm: enable synchronous dax
Date: Tue, 11 Jun 2019 12:04:21 -0400 (EDT) [thread overview]
Message-ID: <1006124881.34430329.1560269061491.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20190611150427.GA29288@redhat.com>
>
> > Hi Mike,
> >
> > Thanks for the review Please find my reply inline.
> >
> > >
> > > dm_table_supports_dax() is called multiple times (from
> > > dm_table_set_restrictions and dm_table_determine_type). It is strange
> > > to have a getter have a side-effect of being a setter too. Overloading
> > > like this could get you in trouble in the future.
> > >
> > > Are you certain this is what you want?
> >
> > I agree with you.
> >
> > >
> > > Or would it be better to refactor dm_table_supports_dax() to take an
> > > iterate_devices_fn arg and have callers pass the appropriate function?
> > > Then have dm_table_set_restrictions() caller do:
> > >
> > > if (dm_table_supports_dax(t, device_synchronous, NULL))
> > > set_dax_synchronous(t->md->dax_dev);
> > >
> > > (NULL arg implies dm_table_supports_dax() refactoring would take a int
> > > *data pointer rather than int type).
> > >
> > > Mike
> > >
> >
> > I am sending below patch as per your suggestion. Does it look
> > near to what you have in mind?
>
> Yes, it does.. just one nit I noticed inlined below.
>
> > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> > index 350cf0451456..8d89acc8b8c2 100644
> > --- a/drivers/md/dm-table.c
> > +++ b/drivers/md/dm-table.c
>
> ...
>
> > @@ -1910,8 +1919,13 @@ void dm_table_set_restrictions(struct dm_table *t,
> > struct request_queue *q,
> > }
> > blk_queue_write_cache(q, wc, fua);
> >
> > - if (dm_table_supports_dax(t, PAGE_SIZE))
> > + if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {
> > +
>
> No need for an empty newline here ^
Sure. Will remove this and send official v12 patchset with the updated patch 4.
Thanks,
Pankaj
>
> > blk_queue_flag_set(QUEUE_FLAG_DAX, q);
> > + if (dm_table_supports_dax(t, device_synchronous, NULL))
> > + set_dax_synchronous(t->md->dax_dev);
> > + }
> > else
> > blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
> >
>
> Thanks,
> Mike
>
>
next prev parent reply other threads:[~2019-06-11 16:04 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 9:07 [PATCH v11 0/7] virtio pmem driver Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 1/7] libnvdimm: nd_region flush callback support Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 2/7] virtio-pmem: Add virtio pmem driver Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 3/7] libnvdimm: add dax_dev sync flag Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 4/7] dm: enable synchronous dax Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 19:28 ` Mike Snitzer
2019-06-10 19:28 ` [Qemu-devel] " Mike Snitzer
2019-06-10 19:28 ` Mike Snitzer
2019-06-10 19:28 ` Mike Snitzer
2019-06-11 13:10 ` [Qemu-devel] " Pankaj Gupta
2019-06-11 13:10 ` Pankaj Gupta
2019-06-11 13:10 ` Pankaj Gupta
2019-06-11 13:10 ` Pankaj Gupta
2019-06-11 15:04 ` Mike Snitzer
2019-06-11 15:04 ` Mike Snitzer
2019-06-11 15:04 ` [Qemu-devel] " Mike Snitzer
2019-06-11 15:04 ` Mike Snitzer
2019-06-11 15:04 ` Mike Snitzer
2019-06-11 16:04 ` [Qemu-devel] " Pankaj Gupta
2019-06-11 16:04 ` Pankaj Gupta [this message]
2019-06-11 16:04 ` Pankaj Gupta
2019-06-11 16:04 ` Pankaj Gupta
2019-06-11 16:04 ` Pankaj Gupta
2019-06-11 13:10 ` Pankaj Gupta
2019-06-10 19:28 ` Mike Snitzer
2019-06-10 9:07 ` [PATCH v11 5/7] dax: check synchronous mapping is supported Pankaj Gupta
[not found] ` <20190610090730.8589-1-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-06-10 9:07 ` [PATCH v11 3/7] libnvdimm: add dax_dev sync flag Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 5/7] dax: check synchronous mapping is supported Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 7/7] xfs: disable map_sync for async flush Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 6/7] ext4: " Pankaj Gupta
2019-06-10 9:07 ` [Qemu-devel] " Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` Pankaj Gupta
2019-06-10 9:07 ` [PATCH v11 7/7] xfs: " Pankaj Gupta
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=1006124881.34430329.1560269061491.JavaMail.zimbra@redhat.com \
--to=pagupta@redhat.com \
--cc=aarcange@redhat.com \
--cc=adilger.kernel@dilger.ca \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=david@fromorbit.com \
--cc=david@redhat.com \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=imammedo@redhat.com \
--cc=jack@suse.cz \
--cc=jasowang@redhat.com \
--cc=jmoyer@redhat.com \
--cc=jstaron@google.com \
--cc=kilobyte@angband.pl \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=mst@redhat.com \
--cc=nilal@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rdunlap@infradead.org \
--cc=riel@surriel.com \
--cc=snitzer@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=vishal.l.verma@intel.com \
--cc=willy@infradead.org \
--cc=yuval.shaia@oracle.com \
--cc=zwisler@kernel.org \
/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.