linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: "bart.vanassche@sandisk.com" <bart.vanassche@sandisk.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"sreekanth.reddy@broadcom.com" <sreekanth.reddy@broadcom.com>,
	"MPT-FusionLinux.pdl@broadcom.com"
	<MPT-FusionLinux.pdl@broadcom.com>,
	"suganath-prabu.subramani@broadcom.com" 
	<suganath-prabu.subramani@broadcom.com>,
	"hare@suse.de" <hare@suse.de>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: mpt3sas fails to allocate budget_map and detects no devices
Date: Wed, 26 Jan 2022 09:25:46 +0800	[thread overview]
Message-ID: <YfCjGrZFsIfe+m94@T590> (raw)
In-Reply-To: <53cb63b07b187ed608d9c93bbde11d1c8953113c.camel@suse.com>

On Tue, Jan 25, 2022 at 04:29:37PM +0000, Martin Wilck wrote:
> On Wed, 2022-01-12 at 17:59 +0100, Martin Wilck wrote:
> > On Mon, 2022-01-10 at 10:59 +0800, Ming Lei wrote:
> > > 
> > > Hello Martin Wilck,
> > > 
> > > Can you test the following change and report back the result?
> > > 
> > > From 480a61a85e9669d3487ebee8db3d387df79279fc Mon Sep 17 00:00:00
> > > 2001
> > > From: Ming Lei <ming.lei@redhat.com>
> > > Date: Mon, 10 Jan 2022 10:26:59 +0800
> > > Subject: [PATCH] scsi: core: reallocate scsi device's budget map if
> > > default
> > >  queue depth is changed
> > > 
> > > Martin reported that sdev->queue_depth can often be changed in
> > > ->slave_configure(), and now we uses ->cmd_per_lun as initial queue
> > > depth for setting up sdev->budget_map. And some extreme -
> > > >cmd_per_lun
> > > or ->can_queue won't be used at default actually, if we they are
> > > used
> > > to allocate sdev->budget_map, huge memory may be consumed just
> > > because
> > > of bad ->cmd_per_lun.
> > > 
> > > Fix the issue by reallocating sdev->budget_map after -
> > > > slave_configure()
> > > returns, at that time, queue_depth should be much more reasonable.
> > > 
> > > Reported-by: Martin Wilck <martin.wilck@suse.com>
> > > Suggested-by: Martin Wilck <martin.wilck@suse.com>
> > > Signed-off-by: Ming Lei <ming.lei@redhat.com>
> > 
> > This looks good. I added a few pr_infos, and for the strange mpt3sas
> > devices I reported, I get this:
> > 
> > # first allocation with depth=7 (cmds_per_lun)
> > Jan 12 17:05:52 localhost kernel: scsi_realloc_sdev_budget_map: 7 0-
> > >0 
> >    (these numbers are: depth old_shift->new_shift)
> > Jan 12 17:05:52 localhost kernel: scsi_realloc_sdev_budget_map:
> > map_nr = 1024
> > 
> > # after slave_alloc() with depth 254
> > Jan 12 17:05:52 localhost kernel: scsi_realloc_sdev_budget_map: 254
> > 0->5
> > Jan 12 17:05:52 localhost kernel: scsi_realloc_sdev_budget_map:
> > map_nr = 32
> > 
> > So the depth changed from 7 to 254, the shift from 0 to 5, and the
> > memory size of the
> > sbitmap was reduced by a factor of 32. Nice!
> > 
> > Tested-by: Martin Wilck <mwilck@suse.com>
> > Reviewed-by: Martin Wilck <mwilck@suse.com>
> 
> So, how do we proceed with this patch?

Looks 5.18/scsi is open now, I will submit one formal patch on linux-scsi
soon.


Thanks,
Ming


      reply	other threads:[~2022-01-26  1:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 18:00 mpt3sas fails to allocate budget_map and detects no devices Martin Wilck
2022-01-06  3:03 ` Ming Lei
2022-01-06  3:17   ` Martin K. Petersen
2022-01-06 10:26   ` Martin Wilck
2022-01-06 15:00     ` Ming Lei
2022-01-06 15:22       ` Martin Wilck
2022-01-06 15:41         ` Ming Lei
2022-01-06 16:19           ` Martin Wilck
2022-01-06 16:33             ` Ming Lei
2022-01-10  2:59               ` Ming Lei
2022-01-12 16:59                 ` Martin Wilck
2022-01-25 16:29                   ` Martin Wilck
2022-01-26  1:25                     ` Ming Lei [this message]

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=YfCjGrZFsIfe+m94@T590 \
    --to=ming.lei@redhat.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=martin.wilck@suse.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.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).