All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Grover <agrover@redhat.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	Christoph Hellwig <hch@lst.de>
Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCHv3 0/8] target: Save memory on unused se_dev_entrys and se_luns
Date: Thu, 18 Sep 2014 15:54:19 -0700	[thread overview]
Message-ID: <541B629B.6090406@redhat.com> (raw)
In-Reply-To: <1411025936.13381.183.camel@haakon3.risingtidesystems.com>

On 09/18/2014 12:38 AM, Nicholas A. Bellinger wrote:
> On Sat, 2014-09-13 at 21:55 +0200, Christoph Hellwig wrote:
>> ping again.  We're getting closer to the end of the 3.18 merge window
>> and there still hasn't been a response.  Should Andy just send the patches
>> directly to Linus once 3.18 opens given that they have been out on the list
>> since Jun 23? (with a positive review from me and no negative one)

> Removing unused per WWPN endpoint LUN + per NodeACL MappedLUN memory is
> a nice optimization to have, but I'm not yet convinced that extending
> existing control path spinlocks to support an array of pointers is
> ultimately worth the complexity it adds here.

9 files changed, 250 insertions(+), 367 deletions(-).

This patchset removes 100+ lines of code. Furthermore, I wouldn't 
characterize it as extending locks, so much as putting locks where they 
should've always been. The fact that device_list[foo] is never null 
means we've avoided crashes but not potentially incorrect accesses.

> Another concern is how these changes effect active session + device I/O
> shutdown, which is an area of regressions I'd rather avoid

I assume this set would spend time in your tree, followed by Linus' tree 
before making it into a release. Also, any logic errors are likely to 
result in a fault, so they should not remain hidden for long.

> if the
> primary benefit of this series is only reducing memory footprint for
> unused LUNs + MappedLUNs.

Yes it does reduce wasted memory, that should be reason enough I'd say. 
But this patchset is also a building block for further improvements that 
are more significant. This set transitions all lun and mappedlun checks 
from checking a flag to checking for NULL. This is necessary before we 
can improve from a fixed-size array to more size-scalable data 
structures like a radix tree, or lockless, with RCU.

>  Lowering the TRANSPORT_MAX_LUNS_PER_TPG value
> at compile time today is the simple way for reducing overall memory
> footprint for folks who need to scale up the number of targets using
> smaller individual LUN mappings.

This is only an option for embedded. We should scale the amount of 
memory we use with the number of allocated LUNs and mapped LUNs.

> As for something smarter, given the mostly read-only nature of LUN +
> MappedLUN pointers to individual TPGT + NodeACLs context, I'd rather see
> something based on RCU arrays + percpu_ref counting to avoid this type
> of complexity to existing code, and move in the direction of dropping
> fast-path I_T ->device_list_lock access all together.

See above about pointers vs flags, this is a first step toward more 
performant *and* space-efficient data structures.

> Beyond these objections, there are some useful fixes + cleanups from
> this series that I'm OK with merging soon..

I've pushed this patchset to

git://git.kernel.org/pub/scm/linux/kernel/git/grover/linux.git

on two branches against your and Linus' repos:
against-linus
against-target-pending-for-next

(looked-over and compile-tested)

For your convenience.

Regards -- Andy

  reply	other threads:[~2014-09-18 22:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 23:39 [PATCHv3 0/8] target: Save memory on unused se_dev_entrys and se_luns Andy Grover
2014-06-30 23:39 ` [PATCHv3 1/8] target: Add locking to some accesses to nacl.device_list Andy Grover
2014-07-01  8:48   ` Maurizio Lombardi
2014-07-01 16:15     ` [PATCHv3 9/8] target: Fix return with spinlock held in scsi3_ua_check() Andy Grover
2014-06-30 23:39 ` [PATCHv3 2/8] target: Don't unlock/relock tpg_lun_lock in loop in add_node_to_devs Andy Grover
2014-06-30 23:39 ` [PATCHv3 3/8] target: Allocate se_dev_entrys in device list only when used Andy Grover
2014-06-30 23:39 ` [PATCHv3 4/8] target: core_tpg_post_dellun can return void Andy Grover
2014-06-30 23:39 ` [PATCHv3 5/8] target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun Andy Grover
2014-06-30 23:39 ` [PATCHv3 6/8] target: Allocate se_luns only when used Andy Grover
2014-06-30 23:39 ` [PATCHv3 7/8] target: Remove core_tpg_release_virtual_lun0 function Andy Grover
2014-06-30 23:39 ` [PATCHv3 8/8] target: Refactor core_enable_device_list_for_node Andy Grover
2014-07-29 13:15 ` [PATCHv3 0/8] target: Save memory on unused se_dev_entrys and se_luns Christoph Hellwig
2014-08-22 22:13   ` Andy Grover
2014-09-13 19:55   ` Christoph Hellwig
2014-09-18  7:38     ` Nicholas A. Bellinger
2014-09-18 22:54       ` Andy Grover [this message]
2014-09-18 23:17         ` Nicholas A. Bellinger
2014-09-23 17:02           ` Andy Grover

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=541B629B.6090406@redhat.com \
    --to=agrover@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.