public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: "sreekanth.reddy@broadcom.com" <sreekanth.reddy@broadcom.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"suganath-prabu.subramani@broadcom.com" 
	<suganath-prabu.subramani@broadcom.com>,
	"MPT-FusionLinux.pdl@broadcom.com"
	<MPT-FusionLinux.pdl@broadcom.com>, "hare@suse.de" <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: mpt3sas fails to allocate budget_map and detects no devices
Date: Thu, 6 Jan 2022 11:03:28 +0800	[thread overview]
Message-ID: <YdZcABq/pxMMh3X0@T590> (raw)
In-Reply-To: <be78dc2cfeecaafd171060fbebda2d268d2a94e5.camel@suse.com>

On Wed, Jan 05, 2022 at 06:00:41PM +0000, Martin Wilck wrote:
> Hello Ming, Sreekanth,
> 
> I'm observing a problem where mpt3sas fails to allocate the budget_map
> for any SCSI device, because attempted allocation is larger than the
> maximum possible. The issue is caused by the logic used in 020b0f0a3192
> ("scsi: core: Replace sdev->device_busy with sbitmap") 
> to calculate the bitmap size. This is observed with 5.16-rc8.
> 
> The controller at hand has properties can_queue=29865 and
> cmd_per_lun=7. The way these parameters are used in scsi_alloc_sdev()->

That two parameter looks bad, can_queue is too big, however cmd_per_lun
is so small.

> sbitmap_init_node(), this results in an sbitmap with 29865 maps, where
> only a single bit is used per map. On x86_64, this results in an
> attempt to allocate 29865 * 192 =  5734080 bytes for the sbitmap, which
> is larger than  PAGE_SIZE * (1 << (MAX_ORDER - 1)), and fails.

Bart has posted one patch for fixing the issue:

https://lore.kernel.org/linux-scsi/20211203231950.193369-2-bvanassche@acm.org/

but it isn't merged yet.

Martin, can we merge the above patch for fixing this issue?


Thanks,
Ming


  reply	other threads:[~2022-01-06  3:03 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 [this message]
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

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=YdZcABq/pxMMh3X0@T590 \
    --to=ming.lei@redhat.com \
    --cc=MPT-FusionLinux.pdl@broadcom.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