Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634725

Re: [PATCH] tcmu: Recalculate the tcmu_cmd size to save cmd area memories

From "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Newsgroups linux.kernel
Subject Re: [PATCH] tcmu: Recalculate the tcmu_cmd size to save cmd area memories
Date 2017-05-03 05:50 +0200
Message-ID <tCTsC-7yN-3@gated-at.bofh.it> (permalink)
References <tCAT1-3Gp-25@gated-at.bofh.it> <tCRTP-6vM-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2017-05-02 at 21:06 -0500, Mike Christie wrote:
> On 05/02/2017 02:54 AM, lixiubo@cmss.chinamobile.com wrote:
> > From: Xiubo Li <lixiubo@cmss.chinamobile.com>
> > 
> > For the "struct tcmu_cmd_entry" in cmd area, the minimum size
> > will be sizeof(struct tcmu_cmd_entry) == 112 Bytes. And it could
> > fill about (sizeof(struct rsp) - sizeof(struct req)) /
> > sizeof(struct iovec) == 68 / 16 ~= 4 data regions(iov[4]) by
> > default.
> > 
> > For most tcmu_cmds, the data block indexes allocated from the
> > data area will be continuous. And for the continuous blocks they
> > will be merged into the same region using only one iovec. For
> > the current code, it will always allocates the same number of
> > iovecs with blocks for each tcmu_cmd, and it will wastes much
> > memories.
> > 
> > For example, when the block size is 4K and the DATA_OUT buffer
> > size is 64K, and the regions needed is less than 5(on my
> > environment is almost 99.7%). The current code will allocate
> > about 16 iovecs, and there will be (16 - 4) * sizeof(struct
> > iovec) = 192 Bytes cmd area memories wasted.
> > 
> > Here adds two helpers to calculate the base size and full size
> > of the tcmu_cmd. And will recalculate them again when it make sure
> > how many iovs is needed before insert it to cmd area.
> > 
> > Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
> 
> Looks ok to me. Thanks.
> 
> Acked-by: Mike Christie <mchristi@redhat.com>

Applied.  Thanks Xiubo + MNC.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] tcmu: Recalculate the tcmu_cmd size to save cmd area memories lixiubo@cmss.chinamobile.com - 2017-05-02 10:00 +0200
  Re: [PATCH] tcmu: Recalculate the tcmu_cmd size to save cmd area  memories Mike Christie <mchristi@redhat.com> - 2017-05-03 04:10 +0200
    Re: [PATCH] tcmu: Recalculate the tcmu_cmd size to save cmd area  memories "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2017-05-03 05:50 +0200

csiph-web