Files
erofs-linux/lib
Hugh Dickins 1431996bf9 percpu_counter: extend _limited_add() to negative amounts
Though tmpfs does not need it, percpu_counter_limited_add() can be twice
as useful if it works sensibly with negative amounts (subs) - typically
decrements towards a limit of 0 or nearby: as suggested by Dave Chinner.

And in the course of that reworking, skip the percpu counter sum if it is
already obvious that the limit would be passed: as suggested by Tim Chen.

Extend the comment above __percpu_counter_limited_add(), defining the
behaviour with positive and negative amounts, allowing negative limits,
but not bothering about overflow beyond S64_MAX.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Hugh Dickins <[email protected]>
Cc: Axel Rasmussen <[email protected]>
Cc: Carlos Maiolino <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Darrick J. Wong <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Tim Chen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2023-10-18 14:34:14 -07:00
..
…
…
…
…
2023-06-09 17:44:13 -07:00
…
…
…
…
…
…
…
…
2023-04-08 13:45:37 -07:00
…
…
…
…
…
…
…
…
…
…
2023-02-02 22:50:01 -08:00
2023-02-02 22:50:01 -08:00
…
2023-02-15 15:44:43 +01:00
…
…
…
…
…
…
…
2023-03-19 10:02:04 -07:00
…
…
…
…
…
…
…
2023-08-21 13:46:25 -07:00
…
2023-04-17 18:01:23 +02:00
…
…
2023-08-24 16:20:18 -07:00
…
…
…
…
…
…
2023-07-21 11:40:20 -06:00
…
…
…
…
…
…
…
…
…