Skip to contentSkip to conversation

Can't create large Malloc bdev

SPDK Luis Navarro 2 participants 3 messages Apr 10, 2023 – Apr 20, 2023

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm new to SPDK and testing out the SPDK NVMe-oF target with the latest ESXi 7.x initiator.

I've got an Ubuntu 22.04 LTS server with 512 GB RAM and seem to be unable to create a Malloc bdev that's larger than 14 GB.

Here's what I am seeing:

$ sudo HUGEMEM=102400 scripts/setup.sh
$ sudo scripts/rpc.py bdev_malloc_create -b malloc0 16384 512

request:

{

"num_blocks": 33554432,

"block_size": 512,

"name": "malloc0",

"method": "bdev_malloc_create",

"req_id": 1

}

Got JSON-RPC error response

response:

{

"code": -12,

"message": "Cannot allocate memory"

}

What am I doing wrong?

Thanks!

Luis

#1 lore raw

Hi Luis,

DPDK has a default limit of 8192 memsegs per list (you probably see some kind of error about this on the target console).

A couple of ways I’m aware of that should work:

1. Patch dpdk/config/rte_config.h locally, increasing RTE_MAX_MEMSEG_PER_LIST to something larger. The current 8192 default should enable malloc bdevs slightly smaller than 16GiB.
2. Use 1GB hugepages.

-Jim

From: SPDK <[email protected]> on behalf of Luis Navarro <[email protected]>
Date: Monday, April 10, 2023 at 3:39 PM
To: [email protected] <[email protected]>
Subject: [SPDK] Can't create large Malloc bdev
Hi all,

I'm new to SPDK and testing out the SPDK NVMe-oF target with the latest ESXi 7.x initiator.

I've got an Ubuntu 22.04 LTS server with 512 GB RAM and seem to be unable to create a Malloc bdev that's larger than 14 GB.

Here’s what I am seeing:

$ sudo HUGEMEM=102400 scripts/setup.sh
$ sudo scripts/rpc.py bdev_malloc_create -b malloc0 16384 512
request:
{
  "num_blocks": 33554432,
  "block_size": 512,
  "name": "malloc0",
  "method": "bdev_malloc_create",
  "req_id": 1
}
Got JSON-RPC error response
response:
{
  "code": -12,
  "message": "Cannot allocate memory"
}

What am I doing wrong?

Thanks!
Luis

#2 lore raw

Hi Jim,

My apologies for the delay in responding. I tried both approaches and they both worked perfectly!

Thanks!

Luis

From: Harris, James R [mailto:[email protected]]
Sent: Monday, April 10, 2023 4:09 PM
To: Luis Navarro <[email protected]>; [email protected]
Subject: Re: [SPDK] Can't create large Malloc bdev

Hi Luis,

DPDK has a default limit of 8192 memsegs per list (you probably see some kind of error about this on the target console).

A couple of ways I'm aware of that should work:

1) Patch dpdk/config/rte_config.h locally, increasing
RTE_MAX_MEMSEG_PER_LIST to something larger. The current 8192 default should enable malloc bdevs slightly smaller than 16GiB.

2) Use 1GB hugepages.

-Jim

From: SPDK <[email protected]> on behalf of Luis Navarro <[email protected] <mailto:[email protected]> >
Date: Monday, April 10, 2023 at 3:39 PM
To: [email protected] <mailto:[email protected]> <[email protected] <mailto:[email protected]> >
Subject: [SPDK] Can't create large Malloc bdev

Hi all,

I'm new to SPDK and testing out the SPDK NVMe-oF target with the latest ESXi 7.x initiator.

I've got an Ubuntu 22.04 LTS server with 512 GB RAM and seem to be unable to create a Malloc bdev that's larger than 14 GB.

Here's what I am seeing:

$ sudo HUGEMEM=102400 scripts/setup.sh
$ sudo scripts/rpc.py bdev_malloc_create -b malloc0 16384 512

request:

{

"num_blocks": 33554432,

"block_size": 512,

"name": "malloc0",

"method": "bdev_malloc_create",

"req_id": 1

}

Got JSON-RPC error response

response:

{

"code": -12,

"message": "Cannot allocate memory"

}

What am I doing wrong?

Thanks!

Luis