[CentOS-devel] Can I do computation with giant integer in kernel?

Mon Feb 21 11:26:31 UTC 2011
Larry Vaden <vaden at texoma.net>

On Mon, Feb 21, 2011 at 12:27 AM, YANG <youngyt at gmail.com> wrote:
> I need compute some polynomials using giant integer with power of numbers
> perhaps. I found GMP library can do this in user mode. How about in kernel?
> Is there any existing codes? Or, I should keep the computation in user mode
> and use netlink to let kernel pass the task to application for computing and
> wait for result asynchronously. But I worry about efficience by using this
> method. Does it cause mode switch frequently, even on multi-core cpu chip?

Perhaps one of the current kernel developers will answer your question
later in the day (read: there are a significant number of heavy
hitters on this list), but as a former developer of yesteryear
(supercomputers, BigOil), I would say no (even NO if you are talking
about an ISR), but the following are offered which might lead to a
more positive view of the matter:

1.  grep the source tree of the current kernel for the data structure
you are considering and see if that data structure is in use.  If no
one has gone before you, no becomes No (which is different than NO).
If the data structure is in use, then study its use to gain more

2. grep the source tree of an open source bios project such as
openbios.org or coreboot.org for the data structure you are

3.  ask your question over at Fedora's list which is specific to
kernels; various Fedora mailing list subjects are at

kind regards/ldv/vaden at texoma.net