mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alan Mikhak <alan.mikhak@sifive.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, martin.petersen@oracle.com,
	alexios.zavras@intel.com, ming.lei@redhat.com,
	gregkh@linuxfoundation.org, tglx@linutronix.de,
	Jason Gunthorpe <jgg@ziepe.ca>,
	christophe.leroy@c-s.fr, Palmer Dabbelt <palmer@sifive.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Logan Gunthorpe <logang@deltatee.com>
Subject: Re: [PATCH] scatterlist: Validate page before calling PageSlab()
Date: Tue, 15 Oct 2019 02:55:22 -0700	[thread overview]
Message-ID: <20191015095522.GA22551@infradead.org> (raw)
In-Reply-To: <CABEDWGxZaJp17jhd-CPqc+n9ZjYzvp63PymfMo0JVd=jzQEizQ@mail.gmail.com>

On Mon, Oct 07, 2019 at 02:13:51PM -0700, Alan Mikhak wrote:
> > My goal is to not modify the Linux NVMe target code at all. The NVMe
> > endpoint function driver currently does the work that is required.

You will have to do some modifications, as for example in PCIe you can
have a n:1 relationship between SQs and CQs.  And you need to handle
the Create/Delete SQ/CQ commands, but not the fabrics commands.  And
modifying subsystems in Linux is perfectly acceptable, that is how they
improve.

Do you have a pointer to your code?

> > In my current platform, there are no page struct backing for the PCIe
> > memory address space.

In Linux there aren't struct pages for physical memory remapped using
ioremap().  But if you want to feed them to the I/O subsystem you have
to use devm_memremap_pages to create a page backing.  Assuming you are
on a RISC-V platform given your affiliation you'll need to ensure your
kernel allows for ZONE_DEVICE pages, which Logan (added to Cc) has been
working on.  I don't remember what the current status is.

> Please consider the following information and cost estimate in
> bytes for requiring page structs for PCI memory if used with
> scatterlists. For example, a 128GB PCI memory address space
> could require as much as 256MB of system memory just for
> page struct backing. In a 1GB 64-bit system with flat memory
> model, that consumes 25% of available memory. However,
> not all of the 128GB PCI memory may be mapped for use at
> a given time depending on the application. The cost of PCI
> page structs is an upfront cost to be paid at system start.

I know the pages are costly.  But once you want to feed them through
subsystems that do expect pages you'll have to do that.  And anything
using scatterlists currently does.  A little hack here and there isn't
going to solve that.

  reply	other threads:[~2019-10-15  9:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 23:22 Alan Mikhak
2019-10-01 12:16 ` Jason Gunthorpe
2019-10-01 17:09   ` Alan Mikhak
2019-10-01 17:12     ` Jason Gunthorpe
2019-10-01 17:26       ` Alan Mikhak
2019-10-01 17:43         ` Jason Gunthorpe
2019-10-01 17:46           ` Alan Mikhak
2019-10-07  6:12   ` Christoph Hellwig
2019-10-07  6:13 ` Christoph Hellwig
2019-10-07 16:44   ` Alan Mikhak
2019-10-07 21:13     ` Alan Mikhak
2019-10-15  9:55       ` Christoph Hellwig [this message]
2019-10-15 16:12         ` Logan Gunthorpe
2019-10-15 19:02           ` Alan Mikhak
2019-10-15 17:40         ` Alan Mikhak
2019-10-15 17:45           ` Logan Gunthorpe
2019-10-15 18:11             ` Alan Mikhak

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=20191015095522.GA22551@infradead.org \
    --to=hch@infradead.org \
    --cc=alan.mikhak@sifive.com \
    --cc=alexios.zavras@intel.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=palmer@sifive.com \
    --cc=paul.walmsley@sifive.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®