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

Christoph Hellwig
2026-01-23T14:52:58Z

On Fri, Jan 23, 2026 at 04:23:49PM +0800, D. Wythe wrote:
> +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.