linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] fsfreeze: moving from uniterruptible to killable
@ 2013-03-24  9:10 Marco Stornelli
  2013-03-26 21:15 ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Stornelli @ 2013-03-24  9:10 UTC (permalink / raw)
  To: Linux FS Devel; +Cc: Linux Kernel, Jan Kara

When a fs is frozen, a process can hang because we wait in
uniterruptible state. We give the user the possibility to kill the process.

Not-signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
---

--- fs/super.c.orig	2013-03-24 09:56:33.000000000 +0100
+++ fs/super.c	2013-03-24 09:58:41.000000000 +0100
@@ -1198,7 +1198,7 @@ retry:
 	if (unlikely(sb->s_writers.frozen >= level)) {
 		if (!wait)
 			return 0;
-		wait_event(sb->s_writers.wait_unfrozen,
+		wait_event_killable(sb->s_writers.wait_unfrozen,
 			   sb->s_writers.frozen < level);
 	}
 
@@ -1248,7 +1248,7 @@ static void sb_wait_write(struct super_b
 		 * of frozen and checking of the counter
 		 */
 		prepare_to_wait(&sb->s_writers.wait, &wait,
-				TASK_UNINTERRUPTIBLE);
+				 TASK_KILLABLE);
 
 		writers = percpu_counter_sum(&sb->s_writers.counter[level-1]);
 		if (writers)

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

* Re: [RFC] fsfreeze: moving from uniterruptible to killable
  2013-03-24  9:10 [RFC] fsfreeze: moving from uniterruptible to killable Marco Stornelli
@ 2013-03-26 21:15 ` Jan Kara
  2013-03-27 11:39   ` Marco Stornelli
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2013-03-26 21:15 UTC (permalink / raw)
  To: Marco Stornelli; +Cc: Linux FS Devel, Linux Kernel, Jan Kara

On Sun 24-03-13 10:10:59, Marco Stornelli wrote:
> When a fs is frozen, a process can hang because we wait in
> uniterruptible state. We give the user the possibility to kill the process.
  Yes, but it needs slightly more work as you probably know... (bailing out
properly when the signal arrives).

								Honza

> 
> Not-signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
> ---
> 
> --- fs/super.c.orig	2013-03-24 09:56:33.000000000 +0100
> +++ fs/super.c	2013-03-24 09:58:41.000000000 +0100
> @@ -1198,7 +1198,7 @@ retry:
>  	if (unlikely(sb->s_writers.frozen >= level)) {
>  		if (!wait)
>  			return 0;
> -		wait_event(sb->s_writers.wait_unfrozen,
> +		wait_event_killable(sb->s_writers.wait_unfrozen,
>  			   sb->s_writers.frozen < level);
>  	}
>  
> @@ -1248,7 +1248,7 @@ static void sb_wait_write(struct super_b
>  		 * of frozen and checking of the counter
>  		 */
>  		prepare_to_wait(&sb->s_writers.wait, &wait,
> -				TASK_UNINTERRUPTIBLE);
> +				 TASK_KILLABLE);
>  
>  		writers = percpu_counter_sum(&sb->s_writers.counter[level-1]);
>  		if (writers)
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

* Re: [RFC] fsfreeze: moving from uniterruptible to killable
  2013-03-26 21:15 ` Jan Kara
@ 2013-03-27 11:39   ` Marco Stornelli
  2013-03-27 14:34     ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Stornelli @ 2013-03-27 11:39 UTC (permalink / raw)
  To: Jan Kara; +Cc: Linux FS Devel, Linux Kernel

2013/3/26 Jan Kara <jack@suse.cz>:
> On Sun 24-03-13 10:10:59, Marco Stornelli wrote:
>> When a fs is frozen, a process can hang because we wait in
>> uniterruptible state. We give the user the possibility to kill the process.
>   Yes, but it needs slightly more work as you probably know... (bailing out
> properly when the signal arrives).
>
>                                                                 Honza
>

Of course, indeed, it was only an RFC to start a discussion, not a
patch :) The point was: is this kind of change a behaviour that can
break user-space in some way? IMHO no, but I'd like to have a
discussion about that before to start coding. What do you think?

Marco

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

* Re: [RFC] fsfreeze: moving from uniterruptible to killable
  2013-03-27 11:39   ` Marco Stornelli
@ 2013-03-27 14:34     ` Jan Kara
  2013-03-27 15:41       ` Marco Stornelli
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2013-03-27 14:34 UTC (permalink / raw)
  To: Marco Stornelli; +Cc: Jan Kara, Linux FS Devel, Linux Kernel

On Wed 27-03-13 12:39:10, Marco Stornelli wrote:
> 2013/3/26 Jan Kara <jack@suse.cz>:
> > On Sun 24-03-13 10:10:59, Marco Stornelli wrote:
> >> When a fs is frozen, a process can hang because we wait in
> >> uniterruptible state. We give the user the possibility to kill the process.
> >   Yes, but it needs slightly more work as you probably know... (bailing out
> > properly when the signal arrives).
> >
> >                                                                 Honza
> >
> 
> Of course, indeed, it was only an RFC to start a discussion, not a
> patch :) The point was: is this kind of change a behaviour that can
> break user-space in some way? IMHO no, but I'd like to have a
> discussion about that before to start coding. What do you think?
  Killable wait is almost always safe WRT to userspace breakage. In this
case I cannot see how it could matter. That's why I agree it's a good thing
to do.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

* Re: [RFC] fsfreeze: moving from uniterruptible to killable
  2013-03-27 14:34     ` Jan Kara
@ 2013-03-27 15:41       ` Marco Stornelli
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Stornelli @ 2013-03-27 15:41 UTC (permalink / raw)
  To: Jan Kara; +Cc: Linux FS Devel, Linux Kernel

2013/3/27 Jan Kara <jack@suse.cz>:
> On Wed 27-03-13 12:39:10, Marco Stornelli wrote:
>> 2013/3/26 Jan Kara <jack@suse.cz>:
>> > On Sun 24-03-13 10:10:59, Marco Stornelli wrote:
>> >> When a fs is frozen, a process can hang because we wait in
>> >> uniterruptible state. We give the user the possibility to kill the process.
>> >   Yes, but it needs slightly more work as you probably know... (bailing out
>> > properly when the signal arrives).
>> >
>> >                                                                 Honza
>> >
>>
>> Of course, indeed, it was only an RFC to start a discussion, not a
>> patch :) The point was: is this kind of change a behaviour that can
>> break user-space in some way? IMHO no, but I'd like to have a
>> discussion about that before to start coding. What do you think?
>   Killable wait is almost always safe WRT to userspace breakage. In this
> case I cannot see how it could matter. That's why I agree it's a good thing
> to do.
>
>                                                                 Honza

Yes, I quite agree. I'll try to look at it in a deeply way.

Regards,

Marco

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

end of thread, other threads:[~2013-03-27 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-24  9:10 [RFC] fsfreeze: moving from uniterruptible to killable Marco Stornelli
2013-03-26 21:15 ` Jan Kara
2013-03-27 11:39   ` Marco Stornelli
2013-03-27 14:34     ` Jan Kara
2013-03-27 15:41       ` Marco Stornelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).