Re: PATCH: Export console functions for useby Software Suspend nice display

From: Benjamin Herrenschmidt
Date: Thu Jan 22 2004 - 22:16:32 EST


On Fri, 2004-01-23 at 14:07, Nigel Cunningham wrote:
> Hi.
>
> On Fri, 2004-01-23 at 15:49, Benjamin Herrenschmidt wrote:
> > Also, by using write instead of blasting the low level code,
> > you will not have to worry about locking issues. (The way
> > you tap the low level stuff should require at least the console
> > semaphore held, write to /dev/console don't)
> >
> > Ben
>
> Locking is not an issue. This is suspend-to-disk. Everything else is
> stopped while we're working.

No. You can still get a printk from irq...

> By the way, am I understanding the suggestion correctly? Do you
> (collective) mean getting a fd for /dev/console from within kernel code
> and using that? I've been looking at the way printk works and wondering
> if con->write is equivalent (once I find the right console to write to)?

Yes. get an fd and write to it. grep for write to find other uses :)

You may have to be a bit careful about what context you are in, but I
suppose it's whatever userland process triggered the sleep in the
first place, no ? For load, it's probably whatever process did swapon ?

In both cases, it should be fine.

Ben.


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