usage/limit, in usec: e.g. usage == 3*limit means "3 seconds worth * of quota burned in one go." */
| 649 | /* usage/limit, in usec: e.g. usage == 3*limit means "3 seconds worth |
| 650 | * of quota burned in one go." */ |
| 651 | static u64 usec_over_budget(u64 usage, u64 limit) |
| 652 | { |
| 653 | if (limit == 0) |
| 654 | return 0; |
| 655 | return usage * (u64)1000000 / limit; |
| 656 | } |
| 657 | |
| 658 | /* Checks two (usage, limit) pairs (e.g. bytes and CPU usec): if |
| 659 | * neither is over, returns 0. Otherwise logs it (once) and returns |
no outgoing calls
no test coverage detected