Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382843

Re: [PATCH] bcache: bch_writeback_thread() is not freezable

Path csiph.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!border2.nntp.ams1.giganews.com!nntp.giganews.com!news.panservice.it!bofh.it!news.nic.it!robomod
From Eric Wheeler <bcache@lists.ewheeler.net>
Newsgroups linux.kernel
Subject Re: [PATCH] bcache: bch_writeback_thread() is not freezable
Date Tue, 19 Apr 2016 23:10:02 +0200
Message-ID <rpL4e-4MC-25@gated-at.bofh.it> (permalink)
References <rpD6G-6Tc-33@gated-at.bofh.it>
X-Greylist delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Apr 2016 17:01:59 EDT
X-X-Sender lists@mail.ewheeler.net
User-Agent Alpine 2.11 (LRH 23 2013-08-11)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 67
Organization linux.* mail to news gateway
X-Original-Cc Kent Overstreet <kent.overstreet@gmail.com>, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, Maciej Piechotka <uzytkownik2@gmail.com>
X-Original-Date Tue, 19 Apr 2016 20:55:01 +0000 (UTC)
X-Original-Message-ID <alpine.LRH.2.11.1604192050290.16630@mail.ewheeler.net>
X-Original-References <alpine.LNX.2.00.1604191421130.27368@cbobk.fhfr.pm>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1382843

Show key headers only | View raw


On Tue, 19 Apr 2016, Jiri Kosina wrote:

> From: Jiri Kosina <jkosina@suse.cz>
> 
> bch_writeback_thread() is calling try_to_freeze(), but that's just an 
> expensive no-op given the fact that the thread is not marked freezable.
> 
> I/O helper kthreads, exactly such as the bcache writeback thread, actually 
> shouldn't be freezable, because they are potentially necessary for 
> finalizing the image write-out.

This is good timing, as Maciej Piechotka just reported a hang when 
suspending his system.

What is the proper way to safely support suspend?  Assuming the 
try_to_freeze() calls are in the right place, should we simply 
set_freezable() on these kthreads?


--
Eric Wheeler


> 
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> ---
>  drivers/md/bcache/writeback.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
> index b9346cd..6012367 100644
> --- a/drivers/md/bcache/writeback.c
> +++ b/drivers/md/bcache/writeback.c
> @@ -12,7 +12,6 @@
>  #include "writeback.h"
>  
>  #include <linux/delay.h>
> -#include <linux/freezer.h>
>  #include <linux/kthread.h>
>  #include <trace/events/bcache.h>
>  
> @@ -228,7 +227,6 @@ static void read_dirty(struct cached_dev *dc)
>  	 */
>  
>  	while (!kthread_should_stop()) {
> -		try_to_freeze();
>  
>  		w = bch_keybuf_next(&dc->writeback_keys);
>  		if (!w)
> @@ -433,7 +431,6 @@ static int bch_writeback_thread(void *arg)
>  			if (kthread_should_stop())
>  				return 0;
>  
> -			try_to_freeze();
>  			schedule();
>  			continue;
>  		}
> -- 
> Jiri Kosina
> SUSE Labs
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] bcache: bch_writeback_thread() is not freezable Jiri Kosina <jikos@kernel.org> - 2016-04-19 14:40 +0200
  [PATCH] bcache: bch_allocator_thread() is not freezable Jiri Kosina <jikos@kernel.org> - 2016-04-19 14:40 +0200
  Re: [PATCH] bcache: bch_writeback_thread() is not freezable Eric Wheeler <bcache@lists.ewheeler.net> - 2016-04-19 23:10 +0200
    Re: [PATCH] bcache: bch_writeback_thread() is not freezable Jiri Kosina <jikos@kernel.org> - 2016-04-20 00:30 +0200
      Re: [PATCH] bcache: bch_writeback_thread() is not freezable Eric Wheeler <bcache@lists.ewheeler.net> - 2016-04-22 03:30 +0200
        Re: [PATCH] bcache: bch_writeback_thread() is not freezable Jiri Kosina <jikos@kernel.org> - 2016-04-25 10:30 +0200

csiph-web