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

D. Wythe
2026-01-24T09:25:40Z

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:
> > +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