From: Pankaj Gupta <pagupta@redhat.com>
To: "Jakub Staroń" <jstaron@google.com>
Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-acpi@vger.kernel.org,
qemu-devel@nongnu.org, linux-ext4@vger.kernel.org,
linux-xfs@vger.kernel.org, jack@suse.cz, mst@redhat.com,
jasowang@redhat.com, david@fromorbit.com, lcapitulino@redhat.com,
adilger kernel <adilger.kernel@dilger.ca>,
zwisler@kernel.org, aarcange@redhat.com,
dave jiang <dave.jiang@intel.com>,
darrick wong <darrick.wong@oracle.com>,
vishal l verma <vishal.l.verma@intel.com>,
david@redhat.com, willy@infradead.org, hch@infradead.org,
jmoyer@redhat.com, nilal@redhat.com, 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>,
kwolf@redhat.com, tytso@mit.edu,
xiaoguangrong eric <xiaoguangrong.eric@gmail.com>,
cohuck@redhat.com, rjw@rjwysocki.net, imammedo@redhat.com,
smbarber@google.com
Subject: Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
Date: Wed, 8 May 2019 11:23:32 -0400 (EDT) [thread overview]
Message-ID: <1482604497.27348783.1557329012320.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1555943483.27247564.1557313967518.JavaMail.zimbra@redhat.com>
> >
> > > +int virtio_pmem_flush(struct nd_region *nd_region)
> > > +{
> > > + int err;
> > > + unsigned long flags;
> > > + struct scatterlist *sgs[2], sg, ret;
> > > + struct virtio_device *vdev = nd_region->provider_data;
> > > + struct virtio_pmem *vpmem = vdev->priv;
> > > + struct virtio_pmem_request *req;
> > > +
> > > + might_sleep();
> > > + req = kmalloc(sizeof(*req), GFP_KERNEL);
> > > + if (!req)
> > > + return -ENOMEM;
> > > +
> > > + req->done = req->wq_buf_avail = false;
> > > + strcpy(req->name, "FLUSH");
> > > + init_waitqueue_head(&req->host_acked);
> > > + init_waitqueue_head(&req->wq_buf);
> > > + sg_init_one(&sg, req->name, strlen(req->name));
> > > + sgs[0] = &sg;
> > > + sg_init_one(&ret, &req->ret, sizeof(req->ret));
> > > + sgs[1] = &ret;
> > > +
> > > + spin_lock_irqsave(&vpmem->pmem_lock, flags);
> > > + err = virtqueue_add_sgs(vpmem->req_vq, sgs, 1, 1, req, GFP_ATOMIC);
> > > + if (err) {
> > > + dev_err(&vdev->dev, "failed to send command to virtio pmem device\n");
> > > +
> > > + list_add_tail(&vpmem->req_list, &req->list);
> > > + spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
> > > +
> > > + /* When host has read buffer, this completes via host_ack */
> > > + wait_event(req->wq_buf, req->wq_buf_avail);
> > > + spin_lock_irqsave(&vpmem->pmem_lock, flags);
> > > + }
> >
> > Aren't the arguments in `list_add_tail` swapped? The element we are adding
>
Yes, arguments for 'list_add_tail' should be swapped.
list_add_tail(&req->list, &vpmem->req_list);
Thank you,
Pankaj
WARNING: multiple messages have this Message-ID (diff)
From: Pankaj Gupta <pagupta@redhat.com>
To: "Jakub Staroń" <jstaron@google.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,
adilger kernel <adilger.kernel@dilger.ca>,
smbarber@google.com, zwisler@kernel.org, aarcange@redhat.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, imammedo@redhat.com, lcapitulino@redhat.com,
kwolf@redhat.com, nilal@redhat.com, tytso@mit.edu,
xiaoguangrong eric <xiaoguangrong.eric@gmail.com>,
darrick wong <darrick.wong@oracle.com>,
rjw@rjwysocki.net, linux-kernel@vger.kernel.org,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
Date: Wed, 8 May 2019 11:23:32 -0400 (EDT) [thread overview]
Message-ID: <1482604497.27348783.1557329012320.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1555943483.27247564.1557313967518.JavaMail.zimbra@redhat.com>
> >
> > > +int virtio_pmem_flush(struct nd_region *nd_region)
> > > +{
> > > + int err;
> > > + unsigned long flags;
> > > + struct scatterlist *sgs[2], sg, ret;
> > > + struct virtio_device *vdev = nd_region->provider_data;
> > > + struct virtio_pmem *vpmem = vdev->priv;
> > > + struct virtio_pmem_request *req;
> > > +
> > > + might_sleep();
> > > + req = kmalloc(sizeof(*req), GFP_KERNEL);
> > > + if (!req)
> > > + return -ENOMEM;
> > > +
> > > + req->done = req->wq_buf_avail = false;
> > > + strcpy(req->name, "FLUSH");
> > > + init_waitqueue_head(&req->host_acked);
> > > + init_waitqueue_head(&req->wq_buf);
> > > + sg_init_one(&sg, req->name, strlen(req->name));
> > > + sgs[0] = &sg;
> > > + sg_init_one(&ret, &req->ret, sizeof(req->ret));
> > > + sgs[1] = &ret;
> > > +
> > > + spin_lock_irqsave(&vpmem->pmem_lock, flags);
> > > + err = virtqueue_add_sgs(vpmem->req_vq, sgs, 1, 1, req, GFP_ATOMIC);
> > > + if (err) {
> > > + dev_err(&vdev->dev, "failed to send command to virtio pmem device\n");
> > > +
> > > + list_add_tail(&vpmem->req_list, &req->list);
> > > + spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
> > > +
> > > + /* When host has read buffer, this completes via host_ack */
> > > + wait_event(req->wq_buf, req->wq_buf_avail);
> > > + spin_lock_irqsave(&vpmem->pmem_lock, flags);
> > > + }
> >
> > Aren't the arguments in `list_add_tail` swapped? The element we are adding
>
Yes, arguments for 'list_add_tail' should be swapped.
list_add_tail(&req->list, &vpmem->req_list);
Thank you,
Pankaj
_______________________________________________
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: "Jakub Staroń" <jstaron@google.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,
adilger kernel <adilger.kernel@dilger.ca>,
smbarber@google.com, zwisler@kernel.org, aarcange@redhat.com,
dave jiang <dave.jiang@intel.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>,
darrick wong <darrick.wong@oracle.com>,
rjw@rjwysocki.net, linux-kernel@vger.kernel.org,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
Date: Wed, 8 May 2019 11:23:32 -0400 (EDT) [thread overview]
Message-ID: <1482604497.27348783.1557329012320.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1555943483.27247564.1557313967518.JavaMail.zimbra@redhat.com>
> >
> > > +int virtio_pmem_flush(struct nd_region *nd_region)
> > > +{
> > > + int err;
> > > + unsigned long flags;
> > > + struct scatterlist *sgs[2], sg, ret;
> > > + struct virtio_device *vdev = nd_region->provider_data;
> > > + struct virtio_pmem *vpmem = vdev->priv;
> > > + struct virtio_pmem_request *req;
> > > +
> > > + might_sleep();
> > > + req = kmalloc(sizeof(*req), GFP_KERNEL);
> > > + if (!req)
> > > + return -ENOMEM;
> > > +
> > > + req->done = req->wq_buf_avail = false;
> > > + strcpy(req->name, "FLUSH");
> > > + init_waitqueue_head(&req->host_acked);
> > > + init_waitqueue_head(&req->wq_buf);
> > > + sg_init_one(&sg, req->name, strlen(req->name));
> > > + sgs[0] = &sg;
> > > + sg_init_one(&ret, &req->ret, sizeof(req->ret));
> > > + sgs[1] = &ret;
> > > +
> > > + spin_lock_irqsave(&vpmem->pmem_lock, flags);
> > > + err = virtqueue_add_sgs(vpmem->req_vq, sgs, 1, 1, req, GFP_ATOMIC);
> > > + if (err) {
> > > + dev_err(&vdev->dev, "failed to send command to virtio pmem device\n");
> > > +
> > > + list_add_tail(&vpmem->req_list, &req->list);
> > > + spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
> > > +
> > > + /* When host has read buffer, this completes via host_ack */
> > > + wait_event(req->wq_buf, req->wq_buf_avail);
> > > + spin_lock_irqsave(&vpmem->pmem_lock, flags);
> > > + }
> >
> > Aren't the arguments in `list_add_tail` swapped? The element we are adding
>
Yes, arguments for 'list_add_tail' should be swapped.
list_add_tail(&req->list, &vpmem->req_list);
Thank you,
Pankaj
next prev parent reply other threads:[~2019-05-08 15:24 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 5:00 [PATCH v7 0/6] virtio pmem driver Pankaj Gupta
2019-04-26 5:00 ` [Qemu-devel] " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` [PATCH v7 1/6] libnvdimm: nd_region flush callback support Pankaj Gupta
2019-04-26 5:00 ` [Qemu-devel] " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver Pankaj Gupta
2019-04-26 5:00 ` [Qemu-devel] " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
[not found] ` <20190426050039.17460-3-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-04-30 5:53 ` [Qemu-devel] " Yuval Shaia
2019-04-30 5:53 ` Yuval Shaia
2019-04-30 5:53 ` Yuval Shaia
2019-04-30 6:06 ` Pankaj Gupta
2019-04-30 6:06 ` Pankaj Gupta
2019-04-30 6:06 ` Pankaj Gupta
2019-04-30 6:06 ` Pankaj Gupta
2019-04-30 5:53 ` Yuval Shaia
2019-05-07 15:35 ` Dan Williams
2019-05-07 15:35 ` Dan Williams
2019-05-07 15:35 ` [Qemu-devel] " Dan Williams
2019-05-07 15:35 ` Dan Williams
2019-05-07 15:35 ` Dan Williams
2019-05-08 11:19 ` [Qemu-devel] " Pankaj Gupta
2019-05-08 11:19 ` Pankaj Gupta
2019-05-08 11:19 ` Pankaj Gupta
2019-05-10 23:33 ` Dan Williams
2019-05-10 23:33 ` Dan Williams
2019-05-10 23:33 ` Dan Williams
2019-05-10 23:33 ` Dan Williams
2019-05-11 1:26 ` Pankaj Gupta
2019-05-11 1:26 ` Pankaj Gupta
2019-05-11 1:26 ` Pankaj Gupta
2019-05-11 1:26 ` Pankaj Gupta
2019-05-08 11:19 ` Pankaj Gupta
2019-05-07 20:25 ` Jakub Staroń via Virtualization
2019-05-07 20:25 ` Jakub Staroń
2019-05-07 20:25 ` Jakub Staroń via Qemu-devel
2019-05-08 11:12 ` Pankaj Gupta
2019-05-08 11:12 ` Pankaj Gupta
2019-05-08 11:12 ` Pankaj Gupta
2019-05-08 11:12 ` Pankaj Gupta
2019-05-08 15:23 ` Pankaj Gupta
2019-05-08 15:23 ` Pankaj Gupta [this message]
2019-05-08 15:23 ` Pankaj Gupta
2019-05-08 15:23 ` Pankaj Gupta
2019-05-08 19:05 ` Jakub Staroń
2019-05-08 19:05 ` Jakub Staroń via Qemu-devel
2019-05-08 19:05 ` Jakub Staroń
2019-05-08 19:05 ` Jakub Staroń via Virtualization
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` [PATCH v7 3/6] libnvdimm: add dax_dev sync flag Pankaj Gupta
2019-04-26 5:00 ` [Qemu-devel] " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-05-07 15:40 ` Dan Williams
2019-05-07 15:40 ` Dan Williams
2019-05-07 15:40 ` [Qemu-devel] " Dan Williams
2019-05-07 15:40 ` Dan Williams
2019-05-07 15:40 ` Dan Williams
2019-05-09 12:24 ` Pankaj Gupta
2019-05-09 12:24 ` [Qemu-devel] " Pankaj Gupta
2019-05-09 12:24 ` Pankaj Gupta
2019-05-09 12:24 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
[not found] ` <20190426050039.17460-1-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-04-26 5:00 ` [PATCH v7 4/6] dax: check synchronous mapping is supported Pankaj Gupta
2019-04-26 5:00 ` [Qemu-devel] " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-05-07 19:24 ` [Qemu-devel] " Jakub Staroń via Virtualization
2019-05-07 19:24 ` Jakub Staroń
2019-05-07 19:24 ` Jakub Staroń via Qemu-devel
2019-05-07 19:24 ` Jakub Staroń
2019-05-08 5:31 ` Pankaj Gupta
2019-05-08 5:31 ` Pankaj Gupta
2019-05-08 5:31 ` Pankaj Gupta
2019-05-08 5:31 ` Pankaj Gupta
2019-05-08 5:31 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` [PATCH v7 5/6] ext4: disable map_sync for async flush Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` [Qemu-devel] " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` [PATCH v7 6/6] xfs: " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` [Qemu-devel] " Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-04-26 5:00 ` Pankaj Gupta
2019-05-07 15:37 ` Dan Williams
[not found] ` <20190426050039.17460-7-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-05-07 15:37 ` Dan Williams
2019-05-07 15:37 ` [Qemu-devel] " Dan Williams
2019-05-07 15:37 ` Dan Williams
2019-05-07 15:37 ` Dan Williams
2019-05-07 16:17 ` Darrick J. Wong
2019-05-07 16:17 ` [Qemu-devel] " Darrick J. Wong
2019-05-07 16:17 ` Darrick J. Wong
2019-05-07 16:17 ` Darrick J. Wong
2019-05-08 5:49 ` [Qemu-devel] " Pankaj Gupta
2019-05-08 5:49 ` Pankaj Gupta
2019-05-08 5:49 ` Pankaj Gupta
2019-05-08 5:49 ` Pankaj Gupta
2019-05-08 5:49 ` 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=1482604497.27348783.1557329012320.JavaMail.zimbra@redhat.com \
--to=pagupta@redhat.com \
--cc=aarcange@redhat.com \
--cc=adilger.kernel@dilger.ca \
--cc=cohuck@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=darrick.wong@oracle.com \
--cc=dave.jiang@intel.com \
--cc=david@fromorbit.com \
--cc=david@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-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mst@redhat.com \
--cc=nilal@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=riel@surriel.com \
--cc=rjw@rjwysocki.net \
--cc=smbarber@google.com \
--cc=stefanha@redhat.com \
--cc=tytso@mit.edu \
--cc=virtualization@lists.linux-foundation.org \
--cc=vishal.l.verma@intel.com \
--cc=willy@infradead.org \
--cc=xiaoguangrong.eric@gmail.com \
--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.