* [PATCH 5/5] hrtimer_nanosleep_restart: don't play with restart_block->fn
@ 2008-02-01 13:38 Oleg Nesterov
2008-02-01 17:41 ` Oleg Nesterov
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2008-02-01 13:38 UTC (permalink / raw)
To: Andrew Morton, Thomas Gleixner
Cc: Alexey Dobriyan, Ingo Molnar, Pavel Emelyanov, Peter Zijlstra,
Toyo Abe, linux-kernel
hrtimer_nanosleep_restart() clears/restores restart_block->fn. This is
pointless and complicates its usage. Note that if sys_restart_syscall()
doesn't actually happen, we have a bogus "pending" restart->fn anyway,
this is harmless.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- MM/kernel/hrtimer.c~5_RESTART_FN 2008-02-01 13:56:44.000000000 +0300
+++ MM/kernel/hrtimer.c 2008-02-01 15:15:15.000000000 +0300
@@ -1338,8 +1338,6 @@ long __sched hrtimer_nanosleep_restart(s
struct hrtimer_sleeper t;
struct timespec __user *rmtp;
- restart->fn = do_no_restart_syscall;
-
hrtimer_init(&t.timer, restart->arg0, HRTIMER_MODE_ABS);
t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2;
@@ -1353,8 +1351,6 @@ long __sched hrtimer_nanosleep_restart(s
return ret;
}
- restart->fn = hrtimer_nanosleep_restart;
-
/* The other values in restart are already filled in */
return -ERESTART_RESTARTBLOCK;
}
--- MM/kernel/compat.c~5_RESTART_FN 2008-02-01 15:05:28.000000000 +0300
+++ MM/kernel/compat.c 2008-02-01 15:16:01.000000000 +0300
@@ -57,10 +57,8 @@ static long compat_nanosleep_restart(str
if (rmtp && put_compat_timespec(&tu, rmtp))
return -EFAULT;
- if (err == -ERESTART_RESTARTBLOCK) {
- restart->fn = compat_nanosleep_restart;
+ if (err == -ERESTART_RESTARTBLOCK)
restart->arg1 = (unsigned long)rmtp;
- }
}
return err;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 5/5] hrtimer_nanosleep_restart: don't play with restart_block->fn
2008-02-01 13:38 [PATCH 5/5] hrtimer_nanosleep_restart: don't play with restart_block->fn Oleg Nesterov
@ 2008-02-01 17:41 ` Oleg Nesterov
0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2008-02-01 17:41 UTC (permalink / raw)
To: Andrew Morton, Thomas Gleixner
Cc: Alexey Dobriyan, Ingo Molnar, Pavel Emelyanov, Peter Zijlstra,
Toyo Abe, linux-kernel
Re-diff. Once again, my apologies to all for the noise.
[PATCH 5/5] hrtimer_nanosleep_restart: don't play with restart_block->fn
hrtimer_nanosleep_restart() clears/restores restart_block->fn. This is
pointless and complicates its usage. Note that if sys_restart_syscall()
doesn't actually happen, we have a bogus "pending" restart->fn anyway,
this is harmless.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- MM/kernel/hrtimer.c~x5_RESTART_FN 2008-02-01 18:54:30.000000000 +0300
+++ MM/kernel/hrtimer.c 2008-02-01 20:37:28.000000000 +0300
@@ -1338,8 +1338,6 @@ long __sched hrtimer_nanosleep_restart(s
struct hrtimer_sleeper t;
struct timespec __user *rmtp;
- restart->fn = do_no_restart_syscall;
-
hrtimer_init(&t.timer, restart->arg0, HRTIMER_MODE_ABS);
t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2;
@@ -1353,8 +1351,6 @@ long __sched hrtimer_nanosleep_restart(s
return ret;
}
- restart->fn = hrtimer_nanosleep_restart;
-
/* The other values in restart are already filled in */
return -ERESTART_RESTARTBLOCK;
}
--- MM/kernel/compat.c~x5_RESTART_FN 2008-02-01 20:24:52.000000000 +0300
+++ MM/kernel/compat.c 2008-02-01 20:38:20.000000000 +0300
@@ -54,7 +54,6 @@ static long compat_nanosleep_restart(str
set_fs(oldfs);
if (ret) {
- restart->fn = compat_nanosleep_restart;
restart->arg1 = (unsigned long)rmtp;
if (rmtp && put_compat_timespec(&rmt, rmtp))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-01 17:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-01 13:38 [PATCH 5/5] hrtimer_nanosleep_restart: don't play with restart_block->fn Oleg Nesterov
2008-02-01 17:41 ` Oleg Nesterov
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®