[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160621172832.GM3262@mtj.duckdns.org>
Date: Tue, 21 Jun 2016 13:28:32 -0400
From: Tejun Heo <tj@...nel.org>
To: Kenny Yu <kennyyu@...com>
Cc: "lizefan@...wei.com" <lizefan@...wei.com>,
"hannes@...xchg.org" <hannes@...xchg.org>,
"cyphar@...har.com" <cyphar@...har.com>,
"cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kernel Team <Kernel-team@...com>
Subject: Re: [PATCH v3] cgroup: Add pids controller event when fork fails
because of pid limit
Hello,
On Tue, Jun 21, 2016 at 05:23:40PM +0000, Kenny Yu wrote:
> >It'd be better to use atomic64_inc_and_test() instead.
> >
> > if (err) {
> > if (atomic64_inc_and_test()) {
> > pr_xxx...;
> > }
> > cgroup_file_notify(&pids->events_file);
> > }
> >
>
> According to the docs https://www.kernel.org/doc/Documentation/atomic_ops.txt ,
> it looks like atomic_inc_and_test returns "a boolean indicating whether the resulting
> counter value was zero or not", which will only happen when the counter goes from
> negative to 0. I'll keep it as atomic_inc_return and get rid of the temp variable.
Right you're. Sorry about the confusion. Yeah, that sounds good to
me.
Thanks!
--
tejun
Powered by blists - more mailing lists