lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69cd8aab-b94e-98f5-5397-48bb875e8280@deltatee.com>
Date:   Mon, 1 Oct 2018 15:55:16 -0600
From:   Logan Gunthorpe <logang@...tatee.com>
To:     Sagi Grimberg <sagi@...mberg.me>, linux-kernel@...r.kernel.org,
        linux-pci@...r.kernel.org, linux-nvme@...ts.infradead.org,
        linux-rdma@...r.kernel.org, linux-nvdimm@...ts.01.org,
        linux-block@...r.kernel.org
Cc:     Stephen Bates <sbates@...thlin.com>,
        Christoph Hellwig <hch@....de>,
        Keith Busch <keith.busch@...el.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Jason Gunthorpe <jgg@...lanox.com>,
        Max Gurtovoy <maxg@...lanox.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Jérôme Glisse <jglisse@...hat.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Alex Williamson <alex.williamson@...hat.com>,
        Christian König <christian.koenig@....com>,
        Jens Axboe <axboe@...nel.dk>,
        Steve Wise <swise@...ngridcomputing.com>
Subject: Re: [PATCH v8 13/13] nvmet: Optionally use PCI P2P memory



On 2018-10-01 3:34 p.m., Sagi Grimberg wrote:
>> +
>> +	list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) {
>> +		pci_p2pdma_remove_client(&ctrl->p2p_clients, nvmet_ns_dev(ns));
>> +		nvmet_add_async_event(ctrl, NVME_AER_TYPE_NOTICE, 0, 0);
> 
> Hi Logan, what is this event here?

Oops, that must have been from a bad rebase.... Will Fix.

>> +		if (sq->qid && p2p_dev) {
>> +			req->sg = pci_p2pmem_alloc_sgl(p2p_dev, &req->sg_cnt,
>> +						       req->transfer_len);
>> +			if (req->sg) {
>> +				req->p2p_dev = p2p_dev;
>> +				return 0;
>> +			}
> 
> Would be useful to comment that we fall to normal sgl allocation.

Ok.

>> +/*
>> + * If allow_p2pmem is set, we will try to use P2P memory for the SGL lists for
>> + * Ι/O commands. This requires the PCI p2p device to be compatible with the
>> + * backing device for every namespace on this controller.
>> + */
>> +static void nvmet_setup_p2pmem(struct nvmet_ctrl *ctrl, struct nvmet_req *req)
>> +{
>> +	struct nvmet_ns *ns;
>> +	int ret;
>> +
>> +	if (!req->port->use_p2pmem || !req->p2p_client)
>> +		return;
> 
> Nit, IMO would be better to check at the call-site, but not a hard
> must...

I'd rather keep the logic for whether to enable p2pmem in it's own
function. nvme_alloc_ctrl() is already very long and complicated.

> I still do not fully understand why p2p_dev has to be ctrl-wide and not
> per namespace. Sorry to keep bringing this up (again). But if people are
> OK with it then I guess I can stop asking about this...

Because you never answered my question back in March[1] (which I think
you've answered below)....

> I think that at some point we said that this looks like it should fall
> back to host memory for those namespaces.. when we allocate the sgl we
> already assigned a namespace to the request (nvmet_req_init).

I did not realize the namespace would be available at this time. I guess
I can give this a try, but it's going to be a fairly big change from
what's presented here... Though, I agree it'll probably be an improvement.

Logan

[1]
https://lore.kernel.org/lkml/7163af93-2f37-a8b6-986a-3cb2e62bee29@deltatee.com/T/#u

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ