Skip to contentSkip to conversation

Maximum size for memory registration (ibv_reg_mr)

DISCUSSION Bharath Ramesh 6 participants 11 messages Sep 24, 2010 – Oct 7, 2010 5 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

Is there any limit on the maximum size of memory that can be registered using ibv_reg_mr. I am using OFED-1.4.2 stack, and when I try to pass a size greater than 16GB ibv_reg_mr returns NULL. The total amount of physical memory on the node is 48GB, max locked memory(ulimit -l) is set to unlimited.

Regards,

Bharath

#1 lore raw
Quoted 5 lines

Is there any limit on the maximum size of memory that can be registered using ibv_reg_mr. I am using OFED-1.4.2 stack, and when I try to pass a size greater than 16GB ibv_reg_mr returns NULL. The total amount of physical memory on the node is 48GB, max locked memory(ulimit -l) is set to unlimited.

The limit depends on the HCA.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 5 lines

-----Original Message-----
From: Roland Dreier [mailto:[email protected]]

Quoted 1 line

Is there any limit on the maximum size of memory that can be

registered

Quoted 8 lines
Quoted 1 line

using ibv_reg_mr. I am using OFED-1.4.2 stack, and when I try to

pass a size

Quoted 1 line

greater than 16GB ibv_reg_mr returns NULL. The total amount of

physical

Quoted 2 lines

memory on the node is 48GB, max locked memory(ulimit -l) is set to unlimited.

The limit depends on the HCA.

max_mr_size returned by calling ibv_devinfo is 0xffffffffffffffff. Does this mean the size is unlimited?

Regards,

Bharath

#4 lore raw
Quoted 2 lines

max_mr_size returned by calling ibv_devinfo is 0xffffffffffffffff. Does this mean the size is unlimited?

It means that the query function might be returning bad data. What adapter is it?

- R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 9 lines

-----Original Message-----
From: Roland Dreier [mailto:[email protected]]

Quoted 1 line

max_mr_size returned by calling ibv_devinfo is 0xffffffffffffffff.

Does this

Quoted 1 line

mean the size is unlimited?

It means that the query function might be returning bad data. What adapter is it?

I don't know the exact adapter it is a QDR ConnectX adapter with board_id:
MT_0C40110009. Is there any documentations where one can find such information if the query function returns bad data.

Regards,

Bharath

#7 lore raw
Quoted 3 lines

I don't know the exact adapter it is a QDR ConnectX adapter with board_id:
MT_0C40110009. Is there any documentations where one can find such information if the query function returns bad data.

All Mellanox adapters have some limit on the amount of memory they can register. You can mess around with module parameters to adjust it. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 4 lines · Roland Dreier

All Mellanox adapters have some limit on the amount of memory they can register. You can mess around with module parameters to adjust it.

You can use mlx4_core module parameter (log_mtts_per_seg) to enlarge number of MTTs per segment. This enable to register more memory with the same number of segments.
In OFED 1.5.2 the max value was enlarged to 7

Tziporet

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw
In reply to a message not in the archive
Quoted 2 lines · Roland Dreier
Quoted 1 line

max_mr_size returned by calling ibv_devinfo is 0xffffffffffffffff. Does this mean the size is unlimited?

It means that the query function might be returning bad data. What adapter is it?

Yep, mlx4_ib_query_device does props->max_mr_size = ~0ull ...

Jack, what would it take to fix that? I took a look and other settings are taken from dev->dev->caps.xxx where caps is of type mlx4_caps which is in turn filled @ drivers/net/mlx4/main.c :: mlx4_dev_cap I wasn't sure what field/computation would exactly account for later setting max_mr_size

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4CAD9572.5060507-hKgKHo2Ms0FWk0Htik3J/[email protected]

#12 lore raw
Quoted 10 lines · Or Gerlitz
Quoted 2 lines · Roland Dreier
Quoted 1 line

max_mr_size returned by calling ibv_devinfo is 0xffffffffffffffff. Does this mean the size is unlimited?

It means that the query function might be returning bad data. What adapter is it?

Yep, mlx4_ib_query_device does props->max_mr_size = ~0ull ...

Jack, what would it take to fix that? I took a look and other settings are taken from dev->dev->caps.xxx where caps is of type mlx4_caps which is in turn filled @ drivers/net/mlx4/main.c :: mlx4_dev_cap I wasn't sure what field/computation would exactly account for later setting max_mr_size

It is not that trivial to calculate this value.
If you create a MR in kernel, it covers the entire address space and the HCA does not pose any limit since you do not consume MTTs. And if you use MTTs then the page size is a parameter in this calculation - huge page, regular page etc.

Do leaving it as is seems to be the most accurate thing...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw
Quoted 1 line · Eli Cohen

If you create a MR in kernel, it covers the entire address space and the HCA does not pose any limit since you do not consume MTTs. And if you use MTTs then the page size is a parameter in this calculation - huge page, regular page etc.

I agree that the kernel case is not of large interest, even though what you wrote only applies for dma mr, when some FMR scheme is used, MTTs are consumed, ofcourse. But, typically, kernel code will not go to the order of giga-bytes, and in other words will not hit the HCA limit.

Quoted 1 line

Do leaving it as is seems to be the most accurate thing...

I would implement it for regular pages and drop a note in the libibverbs man page that if huge pages are used (well, the huge pages patch set isn't fully merged, maybe its about time to make this happen...) then the actual limit is bigger, e.g follows the proportion between the regular to the huge pages used.

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4CADAD40.8080202-smomgflXvOZWk0Htik3J/[email protected]

#15 lore raw
Quoted 6 lines · Or Gerlitz

I would implement it for regular pages and drop a note in the libibverbs man page that if huge pages are used (well, the huge pages patch set isn't fully merged, maybe its about time to make this happen...) then the actual limit is bigger, e.g follows the proportion between the regular to the huge pages used.

What you're proposing is to change something that is not accurate in another not accurate thing. Even when you don't use huge pages, a calculation based on regular pages would be inaccurate too. That's because the allocator allocates MTTs in 2^n quantities while the registered memory need not be sized like that. Moreover, such calculation is less accurate then what we have now.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html