Re: mm/page_alloc.c low_on_memory variable.

Richard B. Johnson (root@chaos.analogic.com)
Tue, 20 Apr 1999 19:27:45 -0400 (EDT)


On Tue, 20 Apr 1999, Stephen C. Tweedie wrote:

> Hi,
>
> On Fri, 16 Apr 1999 19:35:58 -0400 (EDT), "Richard B. Johnson"
> <root@chaos.analogic.com> said:
>
> > Hello mm gurus,
>
> > In page_alloc.c, defined in /include/linux/mm.h, is this wonderful
> > global variable that I'd love to see from a driver module. Unfortunately,
> > even though it is global, it is somehow invisible. It becomes an undefined
> > symbol if I attempt to use it in my module.
>
> That is because it is not an "exported" symbol. Modules cannot access
> it: all modules have to use the exported interface.
>

I have exported the symbol, can access it, and it works.

> > The driver that I am implementing should not have a fixed amount of pages
> > that it can use because it should be able to use more if there is more
> > memory available and less if less.
>
> It really should just allocate a fixed size, selectable by the user. It
> sounds as if your driver allocates these pages on demand but doesn't
> release them on demand, and that's bad behaviour in the Unix environment.
>

No, not at all. This driver must use all available memory. Then it
must release it. This is not a 'multiuser system' this is a control
system that must get a lot of data fast.

> > Presently, if I allocate pages to buffer an incomming data stream, and
> > using failure to obtain a free page as a throttle, it is way too late.
> > The machine will die a horrible death with out-of-memory errors for
> > everything including init. So I have to be able to check something
> > before I attempt to allocate another page.
>
> Trouble is, even if there _is_ lots of memory available at the time the
> driver loads, the user or admin may be wanting to use it for something
> else. You simply can't let a driver gobble up all "available" memory on
> the assumption that nobody else will want to use it. Using a sane
> default buffer size and letting the user specify a larger buffer when
> the driver is loaded makes much more sense.

No, the user is the machine. There is not a sysadmin, there isn't
even 'init' the application owns the entire machine. The driver is
an interface between the application and the hardware using kernel
privs and resources. The driver handles the interface between all
'foreign' hardware and the API, though the kernel.

The application, not 'init' mounts the file-systems, starts the
network(s), etc., it is not a SysV interface. In fact, except to
aid development and debugging, there isn't even a shell.

As Linux replaces Suns and Alphas , you will find more linux machines are
being used to control some pretty sophisticated stuff like real Flight
Simulators, Process controllers, High-Speed data acquisition
systems, CAT Scanners, Bomb Scanners, X-Ray spectrometers, etc.

In a few months Tweenkies will be made using Linux. Trust me, it's
in the works.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.6 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/