mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH resend3 1/2] itimers: merge ITIMER_VIRT and ITIMER_PROF common code
Date: Thu, 21 May 2009 07:53:00 +0200	[thread overview]
Message-ID: <20090521075300.43977873@dhcp-lab-109.englab.brq.redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0905191517080.5983@localhost.localdomain>

Hi.

On Tue, 19 May 2009 15:52:06 +0200 (CEST)
Thomas Gleixner <tglx@linutronix.de> wrote:
> > diff --git a/include/linux/sched.h b/include/linux/sched.h
> > index b4c38bc..0d8367b 100644
> > --- a/include/linux/sched.h
> > +++ b/include/linux/sched.h
> > @@ -454,6 +454,11 @@ struct pacct_struct {
> >  	unsigned long		ac_minflt, ac_majflt;
> >  };
> >  
> > +struct cpu_itimer {
> > +	cputime_t expires;
> > +	cputime_t incr;
> > +};
> > +
> >  /**
> >   * struct task_cputime - collected CPU time counts
> >   * @utime:		time spent in user mode, in &cputime_t units
> > @@ -540,8 +545,7 @@ struct signal_struct {
> >  	ktime_t it_real_incr;
> >  
> >  	/* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */
> > -	cputime_t it_prof_expires, it_virt_expires;
> > -	cputime_t it_prof_incr, it_virt_incr;
> > +	struct cpu_itimer it[2];
> 
> I like the general idea of the patch, but it's not obvious that
> CPUCLOCK_PROF and CPUCLOCK_VIRT happen to be defined as 0 resp 1.
> 
> This needs at least a comment.

Ok. I'll comment that. I though about something better than comment,
but not find nothing appropriate. 

> >  				break;
> >  			case CPUCLOCK_PROF:
> > -				if (!cputime_eq(p->signal->it_prof_expires,
> > +				if (!cputime_eq(sig->it[CPUCLOCK_PROF].expires,
> >  						cputime_zero) &&
> > -				    cputime_lt(p->signal->it_prof_expires,
> > +				    cputime_lt(sig->it[CPUCLOCK_PROF].expires,
> >  					       timer->it.cpu.expires.cpu))
> >  					break;
> 
>   That code could be simplified further by splitting out the
>   comparisons into a separate function and doing
> 
>   	      	      	     	if (fred(&sig->it[CPUCLOCK_PROF], timer))
> 					break;

I'll create a helper inline function, but I do this in separate patch. 

> Looks fine otherwise. Thanks,
> 
>       tglx

Thanks for review, I'll change both my patches and resend soon.
Stanislaw

      reply	other threads:[~2009-05-21  5:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 11:50 Stanislaw Gruszka
2009-05-19 13:52 ` Thomas Gleixner
2009-05-21  5:53   ` Stanislaw Gruszka [this message]

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=20090521075300.43977873@dhcp-lab-109.englab.brq.redhat.com \
    --to=sgruszka@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    /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 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®