Re: PATCH: Export console functions for use by Software Suspend nice display

From: Nigel Cunningham (ncunningham_at_users.sourceforge.net)
Date: 01/23/04

  • Next message: Nick Piggin: "Re: [PATCH] Directed migration: Don't Change cpumask in sched_balance_exec()"
    Date:	Fri, 23 Jan 2004 16:27:22 +1300
    To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    
    
    

    Hi.

    On Fri, 2004-01-23 at 16:12, Benjamin Herrenschmidt wrote:
    > > 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...

    Mmm. But we also adjust the console loglevel depending upon the
    verbosity of debugging info required. (And reset it when we're done).
    When the nice display is on, the loglevel is 0 or 1. If a driver wants
    to printk at KERN_EMERG or KERN_ALERT then, well the display should get
    messed up a little :>

    > > 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 :)

    I did. Didn't find much. I'll look again. Perhaps I'm just blind :>

    > 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 ?

    No. There's a kernel daemon - kswsuspd - that does all the hard work.
    The userland process that initiates the suspend sleeps in
    wait_for_completion until post resume. At boot time, we initiate the
    resume via an init call. Still fine?

    Regards,

    Nigel
    .

    -- 
    My work on Software Suspend is graciously brought to you by
    LinuxFund.org.
    
    

    -
    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/



  • Next message: Nick Piggin: "Re: [PATCH] Directed migration: Don't Change cpumask in sched_balance_exec()"

    Relevant Pages

    • Re: lockups with netconsole on e1000 on media insertion
      ... > have to bail out. ... That's why I think your first patch with this warning as well as a fix ... how bad is it to have a printk in a routine that is registered to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] kernel events layer
      ... > Criteria for adding the event would be that user-space needs to know ... and would normally have to poll to get the information. ... remove the existing printk() and structure them in the process. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] ALPS: fix enabling hardware tapping
      ... IFAIK this code was added by Dmitry as ... > part of the hardware auto-detection changes. ... That printk is deleted anyway by this patch, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] ALPS: fix enabling hardware tapping
      ... IFAIK this code was added by Dmitry as ... > part of the hardware auto-detection changes. ... That printk is deleted anyway by this patch, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [ACPI] PATCH-ACPI based CPU hotplug[2/6]-ACPI Eject interface support
      ... > add a PRINTK saying that BUS_CHECKwas received in the ... > ACPI Processor and in the container driver, and when we hit that printk on a ... CPU without a warning, especially if the CPU is the last one:) I hand in mind ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)