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


Groups > linux.kernel > #1248636

Re: futex timeout not working? (bisected)

From Heiko Carstens <heiko.carstens@de.ibm.com>
Newsgroups linux.kernel
Subject Re: futex timeout not working? (bisected)
Date 2015-10-16 13:00 +0200
Message-ID <qkaTU-3YR-41@gated-at.bofh.it> (permalink)
References <qjOgG-3WB-9@gated-at.bofh.it> <qkaqT-3p4-39@gated-at.bofh.it> <qkaAy-3B7-9@gated-at.bofh.it> <qkaAx-3B7-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Oct 16, 2015 at 12:35:23PM +0200, Thomas Gleixner wrote:
> On Fri, 16 Oct 2015, Heiko Carstens wrote:
> > On Fri, Oct 16, 2015 at 12:21:51PM +0200, Thomas Gleixner wrote:
> > > Heiko,
> > > 
> > > On Thu, 15 Oct 2015, Heiko Carstens wrote:
> > > >   /* We wait for half a second.  */
> > > >   ts.tv_nsec += 500000000;
> > > >   if (ts.tv_nsec >= 1000000000)
> > > >     {
> > > >       ++ts.tv_sec;
> > > >       ts.tv_nsec -= 1000000000;
> > > >     }
> > > > 
> > > >   ret = syscall (__NR_futex, &futex_word, op, expected, ts, NULL, FUTEX_BITSET_MATCH_ANY);
> > > 
> > > If you actually hand in a pointer to 'ts' then the program works as
> > > expected even with the commit in question applied.
> > 
> > Yes, sorry about that! I was just about to write that this should have
> > been &ts on x86. Since x86 seems to pass also structures >8 bytes by
> > value.
> > 
> > However on s390 it is passed by reference. So even it I change ts to &ts,
> > it will hang as I described.
> > 
> > So you are saying this works on x86 and it must be some s390 specific bug?
> 
> Looks like. I have no idea why that would break on s390. Did you try
> to revert the commit on top of tree?

Reverting the patch isn't easy due to all the dependencies the code has in
the meantime. However the following code snippet does logically revert the
patch and it works again:

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 3739ac6aa473..c97dd1cc9bd5 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1953,12 +1953,10 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
 		nsecs = timekeeping_get_ns(&tk->tkr_mono);
 		base = ktime_add_ns(base, nsecs);
 
-		if (*cwsseq != tk->clock_was_set_seq) {
-			*cwsseq = tk->clock_was_set_seq;
-			*offs_real = tk->offs_real;
-			*offs_boot = tk->offs_boot;
-			*offs_tai = tk->offs_tai;
-		}
+		*cwsseq = tk->clock_was_set_seq;
+		*offs_real = tk->offs_real;
+		*offs_boot = tk->offs_boot;
+		*offs_tai = tk->offs_tai;
 
 		/* Handle leapsecond insertion adjustments */
 		if (unlikely(base.tv64 >= tk->next_leap_ktime.tv64))

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

futex timeout not working? (bisected) Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-10-15 12:50 +0200
  Re: futex timeout not working? (bisected) Thomas Gleixner <tglx@linutronix.de> - 2015-10-16 12:30 +0200
    Re: futex timeout not working? (bisected) Thomas Gleixner <tglx@linutronix.de> - 2015-10-16 12:40 +0200
      Re: futex timeout not working? (bisected) Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-10-16 13:00 +0200
        Re: futex timeout not working? (bisected) Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-10-16 14:00 +0200
          Re: futex timeout not working? (bisected) Thomas Gleixner <tglx@linutronix.de> - 2015-10-16 14:30 +0200
            Re: futex timeout not working? (bisected) Thomas Gleixner <tglx@linutronix.de> - 2015-10-16 14:50 +0200
              Re: futex timeout not working? (bisected) Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-10-16 15:50 +0200
    Re: futex timeout not working? (bisected) Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-10-16 12:40 +0200
      Re: futex timeout not working? (bisected) Heiko Carstens <heiko.carstens@de.ibm.com> - 2015-10-16 12:40 +0200
      Re: futex timeout not working? (bisected) Thomas Gleixner <tglx@linutronix.de> - 2015-10-16 12:40 +0200

csiph-web