Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674643 > unrolled thread

Re: [PATCH v3 2/4] kmod: reduce atomic operations on kmod_concurrent and simplify

Started byPetr Mladek <pmladek@suse.com>
First post2017-06-26 13:40 +0200
Last post2017-06-26 13:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v3 2/4] kmod: reduce atomic operations on kmod_concurrent  and simplify Petr Mladek <pmladek@suse.com> - 2017-06-26 13:40 +0200

#1674643 — Re: [PATCH v3 2/4] kmod: reduce atomic operations on kmod_concurrent and simplify

FromPetr Mladek <pmladek@suse.com>
Date2017-06-26 13:40 +0200
SubjectRe: [PATCH v3 2/4] kmod: reduce atomic operations on kmod_concurrent and simplify
Message-ID<tWAx4-1L4-7@gated-at.bofh.it>
On Fri 2017-05-26 14:12:26, Luis R. Rodriguez wrote:
> atomic operations. We do this by inverting the logic of of the enabler,
> instead of incrementing kmod_concurrent as we get new kmod users, define the
> variable kmod_concurrent_max as the max number of currently allowed kmod
> users and as we get new kmod users just decrement it if its still positive.
> This combines the dec and read in one atomic operation.
> 
> In this case we no longer get the same false failure:
> 
> CPU1			CPU2
> atomic_dec_if_positive()
> 			atomic_dec_if_positive()
> atomic_inc()
> 			atomic_inc()
> 
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>

The change looks fine to me. The code is much easier and less hacky.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web