LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Alexey Dobriyan <adobriyan@sw.ru>, Ingo Molnar <mingo@elte.hu>,
	Pavel Emelyanov <xemul@sw.ru>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Toyo Abe <toyoa@mvista.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] hrtimer_nanosleep_restart: don't play with restart_block->fn
Date: Fri, 1 Feb 2008 16:38:05 +0300	[thread overview]
Message-ID: <20080201133805.GA25632@tv-sign.ru> (raw)

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;


             reply	other threads:[~2008-02-01 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01 13:38 Oleg Nesterov [this message]
2008-02-01 17:41 ` Oleg Nesterov

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=20080201133805.GA25632@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=a.p.zijlstra@chello.nl \
    --cc=adobriyan@sw.ru \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=toyoa@mvista.com \
    --cc=xemul@sw.ru \
    --subject='Re: [PATCH 5/5] hrtimer_nanosleep_restart: don'\''t play with restart_block->fn' \
    /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

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).