Messages in this thread | | | From | Ingo Oeser <> | Subject | Re: [RFC] frandom - fast random generator module | Date | Thu, 16 Oct 2003 12:45:59 +0200 |
| |
On Thursday 16 October 2003 10:22, Eli Billauer wrote: > (3) I agree with both. And I use /dev/zero a lot. I know how to write a > zero-generating application in user space.
There is a good reason for this: You can implement pages containing only zeroes very efficiently in the kernel. You can map pages containing only zeroes to a single physical page in the kernel (the ZERO_PAGE). You can ignore the refcounting on this page and save precious cache flushes and much more by doing this in the kernel.
Compare an application with memset() and mmaping of /dev/zero in multiple processes, writing to only some of these pages later.
> (4) The module is small: 6kB of source code as a standalone module, and > 2.3 kB of kernel memory.
That's a price worth as an "default to off" option. We have much more seldom used stuff in the kernel and maintain it, which is a bigger mess than this.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |