Dangerous Hack?

Larry Janik (cyclops@ptw.com)
Mon, 11 Aug 1997 19:39:33 -0700


I needed almost a 1 Meg buffer for a DLT drive (1032192 bytes).

I changed the number of buffers in st_options.h to 1008.

I also changed the tables in kmalloc.c by adding 3 entries:

#if PAGE_SIZE == 4096
static const unsigned int blocksize[] = {
...

262144 - 16,
524288 - 16,
1048576 - 16,
0
};

static struct size_descriptor sizes[] =
{
...

{NULL, NULL, 1, 0, 0, 0, 0, 6},
{NULL, NULL, 1, 0, 0, 0, 0, 7},
{NULL, NULL, 1, 0, 0, 0, 0, 8},
{NULL, NULL, 0, 0, 0, 0, 0, 0}
};

In page_alloc.c I changed NR_MEM_LISTS from a 6 to a 9.

This hack seems to work just fine.

I tested it on 2 systems:

Kernel 2.0.27
486 dx4
24 MB Ram
Adaptec EISA 1740 SCSI interface

Kernel 2.0.27
Pentium- 166
64 MB Ram
2 PCI Adaptec 2940 SCSI Controllers

What are the drawbacks to this hack?

If they are serious, what is a better way?

Thanks!

Larry Janik <cyclops@ptw.com>