public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Shaohua Li <shaohua.li@intel.com>
Cc: Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>,
	linux-kernel@vger.kernel.org, acpi-devel@lists.sourceforge.net
Subject: Re: [ACPI] S3 and sigwait (was Re: 2.6.13-rc3: swsusp works (TP 600X))
Date: Mon, 1 Aug 2005 09:09:26 +0200	[thread overview]
Message-ID: <20050801070926.GI27580@elf.ucw.cz> (raw)
In-Reply-To: <1122879094.3285.2.camel@linux-hp.sh.intel.com>

Hi!

> > If you think it is a linux bug, can you produce small test case doing 
> > just the sigwait, and post it on l-k with big title "sigwait() breaks 
> > when straced, and on suspend"?
> > 
> > That way it is going to get some attetion, and you'll get either 
> > documentation or kernel fixed. 
> Looks like a linux bug to me. The refrigerator fake signal waked the
> task up and without restart for the sigwait case. How about below
> patch:

Is there chance to fix strace case, too? sigwait() is broken in more
than one way it seems...
								Pavel


>  linux-2.6.13-rc4-root/kernel/signal.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff -puN kernel/signal.c~sigwait-suspend-resume kernel/signal.c
> --- linux-2.6.13-rc4/kernel/signal.c~sigwait-suspend-resume	2005-08-01 14:00:39.089460688 +0800
> +++ linux-2.6.13-rc4-root/kernel/signal.c	2005-08-01 14:30:13.821660384 +0800
> @@ -2188,6 +2188,7 @@ sys_rt_sigtimedwait(const sigset_t __use
>  	struct timespec ts;
>  	siginfo_t info;
>  	long timeout = 0;
> +	int recover = 0;
>  
>  	/* XXX: Don't preclude handling different sized sigset_t's.  */
>  	if (sigsetsize != sizeof(sigset_t))
> @@ -2225,15 +2226,23 @@ sys_rt_sigtimedwait(const sigset_t __use
>  			 * be awakened when they arrive.  */
>  			current->real_blocked = current->blocked;
>  			sigandsets(&current->blocked, &current->blocked, &these);
> +do_recover:
>  			recalc_sigpending();
>  			spin_unlock_irq(&current->sighand->siglock);
>  
>  			current->state = TASK_INTERRUPTIBLE;
>  			timeout = schedule_timeout(timeout);
>  
> -			try_to_freeze();
> +			if (try_to_freeze())
> +				recover = 1;

Can't you just goto do_recover here?

>  			spin_lock_irq(&current->sighand->siglock);
>  			sig = dequeue_signal(current, &these, &info);
> +			if (!sig && recover) {
> +				if (timeout == 0)
> +					timeout = MAX_SCHEDULE_TIMEOUT;
> +				recover = 0;
> +				goto do_recover;
> +			}
>  			current->blocked = current->real_blocked;
>  			siginitset(&current->real_blocked, 0);
>  			recalc_sigpending();
> _
> 

-- 
if you have sharp zaurus hardware you don't need... you know my address

  reply	other threads:[~2005-08-01  7:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-23  0:19 2.6.13-rc3: swsusp works (TP 600X) Sanjoy Mahajan
2005-07-23  0:35 ` Pavel Machek
2005-07-28 20:17   ` Sanjoy Mahajan
2005-07-28 21:36     ` Pavel Machek
2005-07-28 21:55       ` Rafael J. Wysocki
2005-07-29  3:48         ` Sanjoy Mahajan
2005-07-29  4:33         ` Sanjoy Mahajan
2005-07-30  0:50   ` S3 and sigwait (was Re: 2.6.13-rc3: swsusp works (TP 600X)) Sanjoy Mahajan
2005-07-30 10:30     ` [ACPI] " Pavel Machek
2005-08-01  6:51       ` Shaohua Li
2005-08-01  7:09         ` Pavel Machek [this message]
2005-08-02  5:16           ` Shaohua Li
  -- strict thread matches above, loose matches on Subject: below --
2005-08-01 12:36 Li, Shaohua

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=20050801070926.GI27580@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sanjoy@mrao.cam.ac.uk \
    --cc=shaohua.li@intel.com \
    /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