mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Nigel Cunningham <ncunningham@linuxmail.org>
Cc: Andrew Morton <akpm@digeo.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Patch] Per kthread freezer flags
Date: Thu, 29 Jul 2004 21:04:38 +0200	[thread overview]
Message-ID: <20040729190438.GA468@openzaurus.ucw.cz> (raw)
In-Reply-To: <1090999301.8316.12.camel@laptop.cunninghams>

Hi!

> At the moment, all kthreads have PF_NOFREEZE set, meaning that they're
> not refrigerated during a suspend. This isn't right for some threads.

Looks good, but see comments below.



> --- linux-2.6.8-rc1-mm1/drivers/block/pktcdvd.c	2004-07-28 16:37:46.000000000 +1000
> +++ linux-2.6.8-rc1-mm1-kthread_refrigerator/drivers/block/pktcdvd.c	2004-07-28 16:59:22.000000000 +1000
> @@ -2372,7 +2372,7 @@
>  
>  	pkt_init_queue(pd);
>  
> -	pd->cdrw.thread = kthread_run(kcdrwd, pd, "%s", pd->name);
> +	pd->cdrw.thread = kthread_run(kcdrwd, pd, "%s", 0, pd->name);
>  	if (IS_ERR(pd->cdrw.thread)) {
>  		printk("pktcdvd: can't start kernel thread\n");
>  		ret = -ENOMEM;

What if someone does swapon /dev/pktdvd0?


> +++ linux-2.6.8-rc1-mm1-kthread_refrigerator/drivers/md/dm-raid1.c	2004-07-28 16:48:44.000000000 +1000
> @@ -1238,7 +1238,7 @@
>  	if (r)
>  		return r;
>  
> -	_kmirrord_wq = create_workqueue("kmirrord");
> +	_kmirrord_wq = create_workqueue("kmirrord", PF_NOFREEZE);
>  	if (!_kmirrord_wq) {
>  		DMERR("couldn't start kmirrord");
>  		dm_dirty_log_exit();


I'm not 100% certain what kmirrord does, but we certainly do not
want raid array to be reconstructed while suspending.



linux-2.6.8-rc1-mm1-kthread_refrigerator/fs/aio.c
> --- linux-2.6.8-rc1-mm1/fs/aio.c	2004-07-28 16:36:03.000000000 +1000
> +++ linux-2.6.8-rc1-mm1-kthread_refrigerator/fs/aio.c	2004-07-28 16:43:48.000000000 +1000
> @@ -69,7 +69,7 @@
>  	kioctx_cachep = kmem_cache_create("kioctx", sizeof(struct kioctx),
>  				0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
>  
> -	aio_wq = create_workqueue("aio");
> +	aio_wq = create_workqueue("aio", PF_NOFREEZE);
>  
>  	pr_debug("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page));
>  

Are you sure? Unless swsusp itself uses aio, we want this to freeze.


linux-2.6.8-rc1-mm1-kthread_refrigerator/kernel/sched.c	2004-07-28 16:43:48.000000000 +1000
> @@ -3550,7 +3550,8 @@
>  
>  	switch (action) {
>  	case CPU_UP_PREPARE:
> -		p = kthread_create(migration_thread, hcpu, "migration/%d",cpu);
> +		p = kthread_create(migration_thread, hcpu, 0,
> +				"migration/%d",cpu);
>  		if (IS_ERR(p))
>  			return NOTIFY_BAD;
>  		p->flags |= PF_NOFREEZE;

Ugh, creating thread normally only to add PF_NOFREEZE 2 lines later
looks bad.

> +++ linux-2.6.8-rc1-mm1-kthread_refrigerator/kernel/softirq.c	2004-07-28 16:43:48.000000000 +1000
> @@ -425,7 +425,7 @@
>  	case CPU_UP_PREPARE:
>  		BUG_ON(per_cpu(tasklet_vec, hotcpu).list);
>  		BUG_ON(per_cpu(tasklet_hi_vec, hotcpu).list);
> -		p = kthread_create(ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu);
> +		p = kthread_create(ksoftirqd, hcpu, 0, "ksoftirqd/%d", hotcpu);
>  		if (IS_ERR(p)) {
>  			printk("ksoftirqd for %i failed\n", hotcpu);
>  			return NOTIFY_BAD;

I guess softinterrupts may be neccessary for suspend... Random drivers may use
them, right?


				Pavel
-- 
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms         


  parent reply	other threads:[~2004-07-29 20:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-28  7:22 Nigel Cunningham
2004-07-28 21:20 ` Andrew Morton
2004-07-28 22:25   ` Nigel Cunningham
2004-07-28 22:30   ` Felipe Alfaro Solana
2004-07-28 22:27     ` Nigel Cunningham
2004-07-28 22:36     ` Nigel Cunningham
2004-07-28 23:21       ` Felipe Alfaro Solana
2004-07-29  0:46         ` Nigel Cunningham
2004-07-29 10:02           ` Felipe Alfaro Solana
2004-07-29 12:11             ` Nigel Cunningham
2004-07-29 16:10               ` Felipe Alfaro Solana
2004-07-29 22:39                 ` Nigel Cunningham
2004-07-30  8:12                   ` Felipe Alfaro Solana
2004-07-29 22:57           ` Felipe Alfaro Solana
2004-07-29 23:01             ` Nigel Cunningham
2004-07-29 19:04 ` Pavel Machek [this message]
2004-07-29 22:24   ` Nigel Cunningham
2004-07-29 22:44     ` Pavel Machek
2004-07-29 22:46       ` Nigel Cunningham
2004-07-29 23:25       ` [Patch] Per kthread freezer flags (Version 2) Nigel Cunningham
2004-07-30  9:18         ` Pavel Machek
2004-07-31 16:53         ` Felipe Alfaro Solana
2004-07-30 12:11       ` [Patch] Per kthread freezer flags Peter Osterlund
2004-07-30 22:15         ` 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=20040729190438.GA468@openzaurus.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncunningham@linuxmail.org \
    /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

all inboxes | Powered by JetHome®