lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200611022153.57406.rjw@sisk.pl>
Date:	Thu, 2 Nov 2006 21:53:56 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Andrew Morton <akpm@...l.org>
Cc:	Pavel Machek <pavel@....cz>, LKML <linux-kernel@...r.kernel.org>,
	Nigel Cunningham <ncunningham@...uxmail.org>,
	Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH -mm] swsusp: Freeze filesystems during suspend (rev. 2)

On Wednesday, 1 November 2006 22:21, Andrew Morton wrote:
> On Wed, 1 Nov 2006 21:27:17 +0100
> "Rafael J. Wysocki" <rjw@...k.pl> wrote:
> 
> > On Wednesday, 1 November 2006 20:45, Andrew Morton wrote:
> > > On Wed, 1 Nov 2006 18:53:07 +0100
> > > "Rafael J. Wysocki" <rjw@...k.pl> wrote:
> > > 
> > > > +void thaw_processes(void)
> > > > +{
> > > > +	printk("Restarting tasks ... ");
> > > > +	__thaw_tasks(FREEZER_KERNEL_THREADS);
> > > > +	thaw_filesystems();
> > > > +	__thaw_tasks(FREEZER_USER_SPACE);
> > > > +	schedule();
> > > > +	printk("done.\n");
> > > > +}
> > > >  
> > > > -	read_unlock(&tasklist_lock);
> > > > +void thaw_kernel_threads(void)
> > > > +{
> > > > +	printk("Restarting kernel threads ... ");
> > > > +	__thaw_tasks(FREEZER_KERNEL_THREADS);
> > > >  	schedule();
> > > >  	printk("done.\n");
> > > >  }
> > > 
> > > what do these random-looking schedule()s do??
> > 
> > My understanding is that they allow the thawed tasks to actually exit
> > the refrigerator, because __thaw_tasks() only changes their states.
> 
> I'd be surprised if this is doing what we thing it's doing.  Calling
> schedule() in state TASK_RUNNING is usually a no-op.  It'll only actually
> switch to another task if the scheduler decides that this task has expired
> its timeslice, or another higher-priority task has become runnable, etc.

This actually can happen, it seems, because __thaw_tasks() calls
wake_up_process() for each frozen task which may call resched_task() for
current.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ