All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Michael Kerrisk <mtk-manpages@gmx.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [patch 1/3] new timerfd API - new timerfd API
Date: Mon, 24 Sep 2007 08:42:47 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0709240838250.23830@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <1190622364.4035.182.camel@chaos>

On Mon, 24 Sep 2007, Thomas Gleixner wrote:

> >  struct timerfd_ctx {
> >  	struct hrtimer tmr;
> > +	int clockid;
> >  	ktime_t tintv;
> >  	wait_queue_head_t wqh;
> >  	int expired;
> > +	u64 ticks;
> >  };
> 
> Can you please restructure the struct in a way which does not result in
> padding by the compiler ?
> 
> struct timerfd_ctx {
> 	struct hrtimer tmr;
> 	ktime_t tintv;
> 	wait_queue_head_t wqh;
> 	u64 ticks;
> 	int expired;
> 	int clockid;
> };

Sure.



> > +			ticks += (u64)
> >  				hrtimer_forward(&ctx->tmr,
> >  						hrtimer_cb_get_time(&ctx->tmr),
> 
> You need to use ctx->tmr.base->get_time() here, otherwise you might read
> a stale time value (in case that CONFIG_HIGH_RES_TIMERS is off).

Is the particular position of hrtimer_cb_get_time() in the code that would 
break here? Because function was added by your patch ;)
Did something change later?



> > +err_kfree_ctx:
> > +	kfree(ctx);
> > +	return error;
> 
> You really can avoid the goto here.

Ack.



- Davide



  reply	other threads:[~2007-09-24 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-23 22:49 [patch 1/3] new timerfd API - new timerfd API Davide Libenzi
2007-09-24  8:26 ` Thomas Gleixner
2007-09-24 15:42   ` Davide Libenzi [this message]
2007-09-24 15:53     ` Thomas Gleixner

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=Pine.LNX.4.64.0709240838250.23830@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk-manpages@gmx.net \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.