From: Frederic Weisbecker <fweisbec@gmail.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
George Spelvin <linux@horizon.com>,
Peter Zijlstra <peterz@infradead.org>,
Oleg Nesterov <oleg@redhat.com>,
"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
Jason Low <jason.low2@hp.com>, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] posix-cpu-timers: Merge running and checking_timer state in one field
Date: Tue, 20 Oct 2015 02:55:36 +0200 [thread overview]
Message-ID: <20151020005535.GB22807@lerouge> (raw)
In-Reply-To: <20151020004108.GB27292@linux-uzut.site>
On Mon, Oct 19, 2015 at 05:41:08PM -0700, Davidlohr Bueso wrote:
> On Tue, 20 Oct 2015, Frederic Weisbecker wrote:
>
> >- * @checking_timer: true when a thread in the group is in the
> >- * process of checking for thread group timers.
> >- *
> >+ * @state: flags describing the current state of the cputimer.
> >+ * CPUTIMER_STATE_RUNNING bit means the timers is elapsing.
>
> s/timers/timer
>
> >+ * CPUTIMER_STATE_CHECKING bit means that the cputimer has
> >+ * expired and a thread in the group is checking the
> >+ * callback list.
>
> These comments might be better served when defining CPUTIMER_STATE_*
If it was defined as an emum I'd agree but here state is defined as an
int (whose size is more readable in a struct than enum) and it's not obvious
what kind of values it can take if we don't define them here.
>
> [...]
>
> >@@ -606,7 +606,7 @@ bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk)
> > return false;
> >
> > /* Check if cputimer is running. This is accessed without locking. */
> >- if (READ_ONCE(tsk->signal->cputimer.running))
> >+ if (READ_ONCE(tsk->signal->cputimer.state))
> > return false;
>
> Could we have cases, such as the above, where .state is set to CPUTIMER_STATE_CHECKING
> and therefore the check is not equivalent?
Nope we shouldn't. I added a WARN_ONCE somewhere to perform some related sanity
checks. I could add more if needed.
Thanks.
> Thanks,
> Davidlohr
next prev parent reply other threads:[~2015-10-20 0:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 0:18 [PATCH] posix-cpu-timers: Merge running and checking_timer state in one field Frederic Weisbecker
2015-10-20 0:41 ` Davidlohr Bueso
2015-10-20 0:55 ` Frederic Weisbecker [this message]
2015-10-20 18:15 ` Jason Low
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=20151020005535.GB22807@lerouge \
--to=fweisbec@gmail.com \
--cc=dave@stgolabs.net \
--cc=jason.low2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--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