Re: [PATCH v3] cgroup: Add pids controller event when fork fails because of pid limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux