From: Jason Low <jason.low@hpe.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
George Spelvin <linux@horizon.com>,
Peter Zijlstra <peterz@infradead.org>,
Davidlohr Bueso <dave@stgolabs.net>,
Oleg Nesterov <oleg@redhat.com>,
"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
Jason Low <jason.low2@hp.com>, Ingo Molnar <mingo@kernel.org>,
jason.low2@hp.com
Subject: Re: [PATCH] posix-cpu-timers: Merge running and checking_timer state in one field
Date: Tue, 20 Oct 2015 11:15:45 -0700 [thread overview]
Message-ID: <1445364945.7547.6.camel@j-VirtualBox> (raw)
In-Reply-To: <1445300334-25977-1-git-send-email-fweisbec@gmail.com>
On Tue, 2015-10-20 at 02:18 +0200, Frederic Weisbecker wrote:
> This way we might consume less space in the signal struct (well,
> depending on bool size or padding) and we don't need to worry about
> ordering between the running and checking_timers fields.
This looks fine to me. I ended up going with booleans since I thought
that makes the code more readable, but this method would be okay too.
I do have 1 question below.
> +/* struct thread_group_cputimer::state bits */
> +#define CPUTIMER_STATE_RUNNING 1
> +#define CPUTIMER_STATE_CHECKING 2
> +
> /**
> * struct thread_group_cputimer - thread group interval timer counts
> * @cputime_atomic: atomic thread group interval timers.
> - * @running: true when there are timers running and
> - * @cputime_atomic receives updates.
> - * @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.
> + * CPUTIMER_STATE_CHECKING bit means that the cputimer has
> + * expired and a thread in the group is checking the
> + * callback list.
> * This structure contains the version of task_cputime, above, that is
> * used for thread group CPU timer calculations.
> */
> struct thread_group_cputimer {
> - struct task_cputime_atomic cputime_atomic;
> - bool running;
> - bool checking_timer;
> + struct task_cputime_atomic cputime_atomic;
> + unsigned int state;
Here are we actually increasing the overhead from 2 bytes -> 4 bytes? If
we want to use less space, I was thinking 'unsigned char'.
prev parent reply other threads:[~2015-10-20 18:15 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
2015-10-20 18:15 ` Jason Low [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=1445364945.7547.6.camel@j-VirtualBox \
--to=jason.low@hpe.com \
--cc=dave@stgolabs.net \
--cc=fweisbec@gmail.com \
--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 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.