Thread (30 messages) 30 messages, 6 authors, 2026-02-03

Re: [PATCH net-next 3/3] net/smc: optimize MTTE consumption for SMC-R buffers

From: "D. Wythe" <alibuda@linux.alibaba.com >
Date: 2026-01-24 09:25:40
Also in: linux-mm, linux-rdma, linux-s390, lkml

On Fri, Jan 23, 2026 at 06:52:55AM -0800, Christoph Hellwig wrote:
On Fri, Jan 23, 2026 at 04:23:49PM +0800, D. Wythe wrote:
quoted
+static inline int smc_buf_get_vm_page_order(struct smc_buf_desc *buf_slot)
+{
+#ifdef CONFIG_HAVE_ARCH_HUGE_VMALLOC
+	struct vm_struct *vm;
+
+	vm = find_vm_area(buf_slot->cpu_addr);
+	return vm ? vm->page_order : 0;
+#else
+	return 0;
+#endif
You might want to encapsulate this logic in a vmalloc_order or similar
helper in vmalloc.c.
Hi Christoph,

That's a great suggestion. Encapsulating this logic into a helper like
vmalloc_page_order() (or similar) within vmalloc.c is indeed much
cleaner than exporting find_vm_area().

I'll implement this helper in V2 and use it in the SMC code. Thanks for
pointing this out!

Thanks,
D. Wythe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help