how to enable hugetlb on mips32

165 views Asked by At

Here is the problem I have:

rx/tx packet in kernel driver. User space program need to access each of these packet. So, there are huge amount of data transfer between kernel and user space. (data stream: kernel rx -> user space process -> kernel tx)

throughput is the KPI.

I decide to use share memory/mmap to avoid data copy. although I haven't test it, others have told me tlb missing will be a problem.

The system I use is a

  • mips32 system (mips74kc, single core)
  • default page size 4KB.
  • kernel 2.6.32

It can only fit in one data packet. During the data transformation, there will be lots of tlb missing that impact throughput.

I found huge page might be a solution. But, it seems like only mips64 support hugetlbfs currently.

https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt https://www.linux-mips.org/archives/linux-mips/2009-05/msg00429.html

So, my question is: how can I use hugetlbfs on mips32. or is there other way to solve the throughput problem.(I must do the data process part in user space)

According to ddaney's patch,

Currently the patch only works for 64-bit kernels because the value of PTRS_PER_PTE in 32-bit kernels is such that it is impossible to have a valid PageMask. It is thought that by adjusting the page allocation scheme, 32-bit kernels could be supported in the future.

It seems possible. Could someone give me a hint, what need to be modify, in order to enable hugetlb.

thank you!

1

There are 1 answers

0
osgx On

Does documentation of your core list support of non 4KB page in its TLB? If it is not supported you should modify your CPU (replace it with some which support larger pages, or redesign your CPU and make new chip).

But most probably you are on wrong track, and tlb missing is not yet proven to be the problem (and the 2MB huge page is wrong solution to 8KB or 15KB packets).

I will tell you "zero-copy" and/or user-space networking (netmap, snabb, PF_RING, DPDK, Network stack in userspace), or user-space network driver; or kernel-based data handler. But many of these tools are only for newer kernels.