From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
ZiyangZhang <ZiyangZhang@linux.alibaba.com>
Subject: Re: [PATCH 1/2] ublk_drv: store device parameters
Date: Tue, 26 Jul 2022 19:47:21 +0200 [thread overview]
Message-ID: <20220726174721.GA14002@lst.de> (raw)
In-Reply-To: <Yt/4UBGtFDqr2SfA@T590>
On Tue, Jul 26, 2022 at 10:21:04PM +0800, Ming Lei wrote:
> But most of fields in ublk_params aren't required for one device,
> sending them all isn't friendly from both userspace and kernel side.
I think it actually is easier for both. For the kernel the benefit
is pretty clear seen by this patch, and for userspae there also is
a lot less boilerplate code.
> Especially inside kernel, a big chunk buffer is allocated for
> the structure, but only few fields are useful for one device. There can
> be lots of ublk device, and total wasted memory can't be ignored.
I think even right now the memory usage is less. If a lot (and I mean
a lot) new paramters are added, it might be slightly higher than the
minimal config with an xarray, but not to the point where it matters.
> If we group parameters, it is easier to extend by adding new parameter
> type. One ublk device usually just uses several parameter types.
> And the xarray implementation is simple enough too, which is just one
> array, but really sparsed.
Well, it isn't exactly simple. And the apprach of a struct that just
grows additional members has worked perfectly fine all over the kernel.
next prev parent reply other threads:[~2022-07-26 17:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-23 15:07 [PATCH 0/2] ublk_drv: add generic mechanism to get/set parameters Ming Lei
2022-07-23 15:07 ` [PATCH 1/2] ublk_drv: store device parameters Ming Lei
2022-07-25 6:42 ` Christoph Hellwig
2022-07-25 7:06 ` Ming Lei
2022-07-26 12:32 ` Christoph Hellwig
2022-07-26 14:21 ` Ming Lei
2022-07-26 17:47 ` Christoph Hellwig [this message]
2022-07-27 0:12 ` Ming Lei
2022-07-23 15:07 ` [PATCH 2/2] ublk_drv: add SET_PARA/GET_PARA control command Ming Lei
2022-07-25 6:45 ` Christoph Hellwig
2022-07-25 7:07 ` Ming Lei
2022-07-25 6:47 ` [PATCH 0/2] ublk_drv: add generic mechanism to get/set parameters Christoph Hellwig
2022-07-25 7:10 ` Ming Lei
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=20220726174721.GA14002@lst.de \
--to=hch@lst.de \
--cc=ZiyangZhang@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).