All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] PM: Making bdi threads non-freezable
@ 2009-11-02 11:03 ` Dasgupta, Romit
  0 siblings, 0 replies; 12+ messages in thread
From: Dasgupta, Romit @ 2009-11-02 11:03 UTC (permalink / raw)
  To: viro, rjw; +Cc: linux-fsdevel, linux-kernel, linux-pm, linux-omap

Fixes the case when bdi threads are in the refrigerator but file system sync
can happen after this. This is possible in MMC when CONFIG_MMC_UNSAFE_RESUME is
not set.

Signed-off-by: Romit Dasgupta <romit@ti.com>
---
 
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 9d5360c..661229d 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -956,7 +956,6 @@ int bdi_writeback_task(struct bdi_writeback *wb)
 
 		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
 		schedule_timeout_interruptible(wait_jiffies);
-		try_to_freeze();
 	}
 
 	return 0;
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 5a37e20..9383271 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -273,7 +273,6 @@ static void bdi_task_init(struct backing_dev_info *bdi,
 	spin_unlock(&bdi->wb_lock);
 
 	tsk->flags |= PF_FLUSHER | PF_SWAPWRITE;
-	set_freezable();
 
 	/*
 	 * Our parent may run at a different priority, just set us to normal
@@ -419,7 +418,6 @@ static int bdi_forker_task(void *ptr)
 			spin_unlock_bh(&bdi_lock);
 			wait = msecs_to_jiffies(dirty_writeback_interval * 10);
 			schedule_timeout(wait);
-			try_to_freeze();
 			continue;
 		}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 1/1] PM: Making bdi threads non-freezable
@ 2009-11-02 11:03 ` Dasgupta, Romit
  0 siblings, 0 replies; 12+ messages in thread
From: Dasgupta, Romit @ 2009-11-02 11:03 UTC (permalink / raw)
  To: viro, rjw; +Cc: linux-fsdevel, linux-kernel, linux-pm, linux-omap

Fixes the case when bdi threads are in the refrigerator but file system sync
can happen after this. This is possible in MMC when CONFIG_MMC_UNSAFE_RESUME is
not set.

Signed-off-by: Romit Dasgupta <romit@ti.com>
---
 
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 9d5360c..661229d 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -956,7 +956,6 @@ int bdi_writeback_task(struct bdi_writeback *wb)
 
 		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
 		schedule_timeout_interruptible(wait_jiffies);
-		try_to_freeze();
 	}
 
 	return 0;
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 5a37e20..9383271 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -273,7 +273,6 @@ static void bdi_task_init(struct backing_dev_info *bdi,
 	spin_unlock(&bdi->wb_lock);
 
 	tsk->flags |= PF_FLUSHER | PF_SWAPWRITE;
-	set_freezable();
 
 	/*
 	 * Our parent may run at a different priority, just set us to normal
@@ -419,7 +418,6 @@ static int bdi_forker_task(void *ptr)
 			spin_unlock_bh(&bdi_lock);
 			wait = msecs_to_jiffies(dirty_writeback_interval * 10);
 			schedule_timeout(wait);
-			try_to_freeze();
 			continue;
 		}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] PM: Making bdi threads non-freezable
  2009-11-02 11:03 ` Dasgupta, Romit
@ 2009-11-02 18:43   ` Rafael J. Wysocki
  -1 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-11-02 18:43 UTC (permalink / raw)
  To: Dasgupta, Romit; +Cc: viro, linux-fsdevel, linux-kernel, linux-pm, linux-omap

On Monday 02 November 2009, Dasgupta, Romit wrote:
> Fixes the case when bdi threads are in the refrigerator but file system sync
> can happen after this. This is possible in MMC when CONFIG_MMC_UNSAFE_RESUME is
> not set.

What's going to happen if we attemt to suspend the underlying block device(s)
when the bdi thread are doing their job?  Is there any synchronisation
mechanism for that?

Rafael


> Signed-off-by: Romit Dasgupta <romit@ti.com>
> ---
>  
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 9d5360c..661229d 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -956,7 +956,6 @@ int bdi_writeback_task(struct bdi_writeback *wb)
>  
>  		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
>  		schedule_timeout_interruptible(wait_jiffies);
> -		try_to_freeze();
>  	}
>  
>  	return 0;
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 5a37e20..9383271 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -273,7 +273,6 @@ static void bdi_task_init(struct backing_dev_info *bdi,
>  	spin_unlock(&bdi->wb_lock);
>  
>  	tsk->flags |= PF_FLUSHER | PF_SWAPWRITE;
> -	set_freezable();
>  
>  	/*
>  	 * Our parent may run at a different priority, just set us to normal
> @@ -419,7 +418,6 @@ static int bdi_forker_task(void *ptr)
>  			spin_unlock_bh(&bdi_lock);
>  			wait = msecs_to_jiffies(dirty_writeback_interval * 10);
>  			schedule_timeout(wait);
> -			try_to_freeze();
>  			continue;
>  		}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] PM: Making bdi threads non-freezable
@ 2009-11-02 18:43   ` Rafael J. Wysocki
  0 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-11-02 18:43 UTC (permalink / raw)
  To: Dasgupta, Romit; +Cc: viro, linux-fsdevel, linux-kernel, linux-pm, linux-omap

On Monday 02 November 2009, Dasgupta, Romit wrote:
> Fixes the case when bdi threads are in the refrigerator but file system sync
> can happen after this. This is possible in MMC when CONFIG_MMC_UNSAFE_RESUME is
> not set.

What's going to happen if we attemt to suspend the underlying block device(s)
when the bdi thread are doing their job?  Is there any synchronisation
mechanism for that?

Rafael


> Signed-off-by: Romit Dasgupta <romit@ti.com>
> ---
>  
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 9d5360c..661229d 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -956,7 +956,6 @@ int bdi_writeback_task(struct bdi_writeback *wb)
>  
>  		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
>  		schedule_timeout_interruptible(wait_jiffies);
> -		try_to_freeze();
>  	}
>  
>  	return 0;
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 5a37e20..9383271 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -273,7 +273,6 @@ static void bdi_task_init(struct backing_dev_info *bdi,
>  	spin_unlock(&bdi->wb_lock);
>  
>  	tsk->flags |= PF_FLUSHER | PF_SWAPWRITE;
> -	set_freezable();
>  
>  	/*
>  	 * Our parent may run at a different priority, just set us to normal
> @@ -419,7 +418,6 @@ static int bdi_forker_task(void *ptr)
>  			spin_unlock_bh(&bdi_lock);
>  			wait = msecs_to_jiffies(dirty_writeback_interval * 10);
>  			schedule_timeout(wait);
> -			try_to_freeze();
>  			continue;
>  		}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] PM: Making bdi threads non-freezable
  2009-11-02 11:03 ` Dasgupta, Romit
  (?)
@ 2009-11-02 18:43 ` Rafael J. Wysocki
  -1 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-11-02 18:43 UTC (permalink / raw)
  To: Dasgupta, Romit; +Cc: linux-fsdevel, linux-pm, linux-omap, viro, linux-kernel

On Monday 02 November 2009, Dasgupta, Romit wrote:
> Fixes the case when bdi threads are in the refrigerator but file system sync
> can happen after this. This is possible in MMC when CONFIG_MMC_UNSAFE_RESUME is
> not set.

What's going to happen if we attemt to suspend the underlying block device(s)
when the bdi thread are doing their job?  Is there any synchronisation
mechanism for that?

Rafael


> Signed-off-by: Romit Dasgupta <romit@ti.com>
> ---
>  
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 9d5360c..661229d 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -956,7 +956,6 @@ int bdi_writeback_task(struct bdi_writeback *wb)
>  
>  		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
>  		schedule_timeout_interruptible(wait_jiffies);
> -		try_to_freeze();
>  	}
>  
>  	return 0;
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 5a37e20..9383271 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -273,7 +273,6 @@ static void bdi_task_init(struct backing_dev_info *bdi,
>  	spin_unlock(&bdi->wb_lock);
>  
>  	tsk->flags |= PF_FLUSHER | PF_SWAPWRITE;
> -	set_freezable();
>  
>  	/*
>  	 * Our parent may run at a different priority, just set us to normal
> @@ -419,7 +418,6 @@ static int bdi_forker_task(void *ptr)
>  			spin_unlock_bh(&bdi_lock);
>  			wait = msecs_to_jiffies(dirty_writeback_interval * 10);
>  			schedule_timeout(wait);
> -			try_to_freeze();
>  			continue;
>  		}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/1] PM: Making bdi threads non-freezable
  2009-11-02 18:43   ` Rafael J. Wysocki
@ 2009-11-03  6:42     ` Dasgupta, Romit
  -1 siblings, 0 replies; 12+ messages in thread
From: Dasgupta, Romit @ 2009-11-03  6:42 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: viro, linux-fsdevel, linux-kernel, linux-pm, linux-omap


> Subject: Re: [PATCH 1/1] PM: Making bdi threads non-freezable
> 
> On Monday 02 November 2009, Dasgupta, Romit wrote:
> > Fixes the case when bdi threads are in the refrigerator but file system sync
> > can happen after this. This is possible in MMC when
> CONFIG_MMC_UNSAFE_RESUME is
> > not set.
> 
> What's going to happen if we attemt to suspend the underlying block device(s)
> when the bdi thread are doing their job?  Is there any synchronisation
> mechanism for that?
> 
There is no explicit synchronization AFAICT. However, it looks like the call to 'del_gendisk' would invoke 'sync_filesystem' down the line. 'sync_filesystem' would end with synchronous writes of inodes followed by a call to '__sync_blockddev'. 
After this call I believe there should not be any activity pending for the blockdevice. So this should not lead to any race. My tests on the development board did not show any issues. But some FS experts may comment.

Regards,
-Romit


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/1] PM: Making bdi threads non-freezable
@ 2009-11-03  6:42     ` Dasgupta, Romit
  0 siblings, 0 replies; 12+ messages in thread
From: Dasgupta, Romit @ 2009-11-03  6:42 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: viro, linux-fsdevel, linux-kernel, linux-pm, linux-omap


> Subject: Re: [PATCH 1/1] PM: Making bdi threads non-freezable
> 
> On Monday 02 November 2009, Dasgupta, Romit wrote:
> > Fixes the case when bdi threads are in the refrigerator but file system sync
> > can happen after this. This is possible in MMC when
> CONFIG_MMC_UNSAFE_RESUME is
> > not set.
> 
> What's going to happen if we attemt to suspend the underlying block device(s)
> when the bdi thread are doing their job?  Is there any synchronisation
> mechanism for that?
> 
There is no explicit synchronization AFAICT. However, it looks like the call to 'del_gendisk' would invoke 'sync_filesystem' down the line. 'sync_filesystem' would end with synchronous writes of inodes followed by a call to '__sync_blockddev'. 
After this call I believe there should not be any activity pending for the blockdevice. So this should not lead to any race. My tests on the development board did not show any issues. But some FS experts may comment.

Regards,
-Romit


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] PM: Making bdi threads non-freezable
  2009-11-02 18:43   ` Rafael J. Wysocki
  (?)
  (?)
@ 2009-11-03  6:42   ` Dasgupta, Romit
  -1 siblings, 0 replies; 12+ messages in thread
From: Dasgupta, Romit @ 2009-11-03  6:42 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-fsdevel, linux-pm, linux-omap, viro, linux-kernel


> Subject: Re: [PATCH 1/1] PM: Making bdi threads non-freezable
> 
> On Monday 02 November 2009, Dasgupta, Romit wrote:
> > Fixes the case when bdi threads are in the refrigerator but file system sync
> > can happen after this. This is possible in MMC when
> CONFIG_MMC_UNSAFE_RESUME is
> > not set.
> 
> What's going to happen if we attemt to suspend the underlying block device(s)
> when the bdi thread are doing their job?  Is there any synchronisation
> mechanism for that?
> 
There is no explicit synchronization AFAICT. However, it looks like the call to 'del_gendisk' would invoke 'sync_filesystem' down the line. 'sync_filesystem' would end with synchronous writes of inodes followed by a call to '__sync_blockddev'. 
After this call I believe there should not be any activity pending for the blockdevice. So this should not lead to any race. My tests on the development board did not show any issues. But some FS experts may comment.

Regards,
-Romit

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] PM: Making bdi threads non-freezable
  2009-11-03  6:42     ` Dasgupta, Romit
@ 2009-11-03 21:03       ` Rafael J. Wysocki
  -1 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-11-03 21:03 UTC (permalink / raw)
  To: Dasgupta, Romit; +Cc: viro, linux-fsdevel, linux-kernel, linux-pm, linux-omap

On Tuesday 03 November 2009, Dasgupta, Romit wrote:
> 
> > Subject: Re: [PATCH 1/1] PM: Making bdi threads non-freezable
> > 
> > On Monday 02 November 2009, Dasgupta, Romit wrote:
> > > Fixes the case when bdi threads are in the refrigerator but file system sync
> > > can happen after this. This is possible in MMC when
> > CONFIG_MMC_UNSAFE_RESUME is
> > > not set.
> > 
> > What's going to happen if we attemt to suspend the underlying block device(s)
> > when the bdi thread are doing their job?  Is there any synchronisation
> > mechanism for that?
> > 
> There is no explicit synchronization AFAICT. However, it looks like the call
> to 'del_gendisk' would invoke 'sync_filesystem' down the line.
> 'sync_filesystem' would end with synchronous writes of inodes followed by a
> call to '__sync_blockddev'.

However, that runs concurrently with respect to the suspend thread, AFAICS, so
I wonder if there's anything to make the suspend thread wait for these
operations to complete.  If there's nothing like that, we can't really allow
the bdi threads to run in parallel with the suspend thread.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] PM: Making bdi threads non-freezable
@ 2009-11-03 21:03       ` Rafael J. Wysocki
  0 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-11-03 21:03 UTC (permalink / raw)
  To: Dasgupta, Romit; +Cc: viro, linux-fsdevel, linux-kernel, linux-pm, linux-omap

On Tuesday 03 November 2009, Dasgupta, Romit wrote:
> 
> > Subject: Re: [PATCH 1/1] PM: Making bdi threads non-freezable
> > 
> > On Monday 02 November 2009, Dasgupta, Romit wrote:
> > > Fixes the case when bdi threads are in the refrigerator but file system sync
> > > can happen after this. This is possible in MMC when
> > CONFIG_MMC_UNSAFE_RESUME is
> > > not set.
> > 
> > What's going to happen if we attemt to suspend the underlying block device(s)
> > when the bdi thread are doing their job?  Is there any synchronisation
> > mechanism for that?
> > 
> There is no explicit synchronization AFAICT. However, it looks like the call
> to 'del_gendisk' would invoke 'sync_filesystem' down the line.
> 'sync_filesystem' would end with synchronous writes of inodes followed by a
> call to '__sync_blockddev'.

However, that runs concurrently with respect to the suspend thread, AFAICS, so
I wonder if there's anything to make the suspend thread wait for these
operations to complete.  If there's nothing like that, we can't really allow
the bdi threads to run in parallel with the suspend thread.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] PM: Making bdi threads non-freezable
  2009-11-03  6:42     ` Dasgupta, Romit
  (?)
  (?)
@ 2009-11-03 21:03     ` Rafael J. Wysocki
  -1 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-11-03 21:03 UTC (permalink / raw)
  To: Dasgupta, Romit; +Cc: linux-fsdevel, linux-pm, linux-omap, viro, linux-kernel

On Tuesday 03 November 2009, Dasgupta, Romit wrote:
> 
> > Subject: Re: [PATCH 1/1] PM: Making bdi threads non-freezable
> > 
> > On Monday 02 November 2009, Dasgupta, Romit wrote:
> > > Fixes the case when bdi threads are in the refrigerator but file system sync
> > > can happen after this. This is possible in MMC when
> > CONFIG_MMC_UNSAFE_RESUME is
> > > not set.
> > 
> > What's going to happen if we attemt to suspend the underlying block device(s)
> > when the bdi thread are doing their job?  Is there any synchronisation
> > mechanism for that?
> > 
> There is no explicit synchronization AFAICT. However, it looks like the call
> to 'del_gendisk' would invoke 'sync_filesystem' down the line.
> 'sync_filesystem' would end with synchronous writes of inodes followed by a
> call to '__sync_blockddev'.

However, that runs concurrently with respect to the suspend thread, AFAICS, so
I wonder if there's anything to make the suspend thread wait for these
operations to complete.  If there's nothing like that, we can't really allow
the bdi threads to run in parallel with the suspend thread.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/1] PM: Making bdi threads non-freezable
@ 2009-11-02 11:03 Dasgupta, Romit
  0 siblings, 0 replies; 12+ messages in thread
From: Dasgupta, Romit @ 2009-11-02 11:03 UTC (permalink / raw)
  To: viro, rjw; +Cc: linux-fsdevel, linux-pm, linux-omap, linux-kernel

Fixes the case when bdi threads are in the refrigerator but file system sync
can happen after this. This is possible in MMC when CONFIG_MMC_UNSAFE_RESUME is
not set.

Signed-off-by: Romit Dasgupta <romit@ti.com>
---
 
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 9d5360c..661229d 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -956,7 +956,6 @@ int bdi_writeback_task(struct bdi_writeback *wb)
 
 		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
 		schedule_timeout_interruptible(wait_jiffies);
-		try_to_freeze();
 	}
 
 	return 0;
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 5a37e20..9383271 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -273,7 +273,6 @@ static void bdi_task_init(struct backing_dev_info *bdi,
 	spin_unlock(&bdi->wb_lock);
 
 	tsk->flags |= PF_FLUSHER | PF_SWAPWRITE;
-	set_freezable();
 
 	/*
 	 * Our parent may run at a different priority, just set us to normal
@@ -419,7 +418,6 @@ static int bdi_forker_task(void *ptr)
 			spin_unlock_bh(&bdi_lock);
 			wait = msecs_to_jiffies(dirty_writeback_interval * 10);
 			schedule_timeout(wait);
-			try_to_freeze();
 			continue;
 		}

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-11-03 21:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02 11:03 [PATCH 1/1] PM: Making bdi threads non-freezable Dasgupta, Romit
2009-11-02 11:03 ` Dasgupta, Romit
2009-11-02 18:43 ` Rafael J. Wysocki
2009-11-02 18:43 ` Rafael J. Wysocki
2009-11-02 18:43   ` Rafael J. Wysocki
2009-11-03  6:42   ` Dasgupta, Romit
2009-11-03  6:42     ` Dasgupta, Romit
2009-11-03 21:03     ` Rafael J. Wysocki
2009-11-03 21:03       ` Rafael J. Wysocki
2009-11-03 21:03     ` Rafael J. Wysocki
2009-11-03  6:42   ` Dasgupta, Romit
  -- strict thread matches above, loose matches on Subject: below --
2009-11-02 11:03 Dasgupta, Romit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.