public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: ncunningham@users.sourceforge.net
Cc: Daniel Jacobowitz <dan@debian.org>,
	viro@parcelfarce.linux.theplanet.co.uk,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: PATCH: Export console functions for use by	Software	Suspend	nice display
Date: Fri, 23 Jan 2004 14:12:51 +1100	[thread overview]
Message-ID: <1074827571.974.191.camel@gaston> (raw)
In-Reply-To: <1074827229.12773.198.camel@laptop-linux>

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.



  reply	other threads:[~2004-01-23  3:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22  8:12 PATCH: Export console functions for use by Software Suspend nice display Nigel Cunningham
2004-01-22  8:24 ` viro
2004-01-22 18:38   ` Nigel Cunningham
2004-01-22 20:35     ` Daniel Jacobowitz
2004-01-23  2:49       ` Benjamin Herrenschmidt
2004-01-23  3:07         ` Nigel Cunningham
2004-01-23  3:12           ` Benjamin Herrenschmidt [this message]
2004-01-23  3:27             ` Nigel Cunningham
2004-01-23  3:18           ` Nigel Cunningham
2004-01-22  8:28 ` Christoph Hellwig
2004-01-22  9:02   ` Nigel Cunningham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1074827571.974.191.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=dan@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncunningham@users.sourceforge.net \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox