lkml.org 
[lkml]   [1999]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: kupdate & laptop's
On Sat, 14 Aug 1999, Andrea Arcangeli wrote:

>mistake. If you think it's better to allow kupdate to be stopped simply
>via a SIGSTOP I can change the code.

I written the code to allow kupdate to be stopped also via SIGSTOP. Patch
against 2.2.11:

--- 2.2.11/fs/buffer.c Thu Aug 12 02:32:33 1999
+++ 2.2.11-kupdate/fs/buffer.c Sat Aug 14 15:31:24 1999
@@ -1841,13 +1841,18 @@
tsk->session = 1;
tsk->pgrp = 1;
strcpy(tsk->comm, "kupdate");
+
+ /* sigstop and sigcont will stop and wakeup kupdate */
+ spin_lock_irq(&tsk->sigmask_lock);
sigfillset(&tsk->blocked);
- /* sigcont will wakeup kupdate after setting interval to 0 */
sigdelset(&tsk->blocked, SIGCONT);
+ sigdelset(&tsk->blocked, SIGSTOP);
+ spin_unlock_irq(&tsk->sigmask_lock);

lock_kernel();

for (;;) {
+ /* update interval */
interval = bdf_prm.b_un.interval;
if (interval)
{
@@ -1856,8 +1861,24 @@
}
else
{
+ stop_kupdate:
tsk->state = TASK_STOPPED;
schedule(); /* wait for SIGCONT */
+ }
+ /* check for sigstop */
+ if (signal_pending(tsk))
+ {
+ int stopped = 0;
+ spin_lock_irq(&tsk->sigmask_lock);
+ if (sigismember(&tsk->signal, SIGSTOP))
+ {
+ sigdelset(&tsk->signal, SIGSTOP);
+ stopped = 1;
+ }
+ recalc_sigpending(tsk);
+ spin_unlock_irq(&tsk->sigmask_lock);
+ if (stopped)
+ goto stop_kupdate;
}
#ifdef DEBUG
printk("kupdate() activated...\n");

Andrea


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

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.090 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site