Repository navigation
Commit 2bbdbda
committed
posix-cpu-timers: Get rid of zero checks
Deactivation of the expiry cache is done by setting all clock caches to
0. That requires to have a check for zero in all places which update the
expiry cache:
if (cache == 0 || new < cache)
cache = new;
Use U64_MAX as the deactivated value, which allows to remove the zero
checks when updating the cache and reduces it to the obvious check:
if (new < cache)
cache = new;
This also removes the weird workaround in do_prlimit() which was required
to convert a RLIMIT_CPU value of 0 (immediate expiry) to 1 because handing
in 0 to the posix CPU timer code would have effectively disarmed it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190821192922.275086128@linutronix.de1 parent 24db4dd commit 2bbdbda
3 files changed
Lines changed: 20 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | | - | |
| 107 | + | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1557 | 1557 | | |
1558 | 1558 | | |
1559 | 1559 | | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | 1560 | | |
1570 | 1561 | | |
1571 | 1562 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | | - | |
128 | | - | |
129 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | 446 | | |
451 | 447 | | |
452 | 448 | | |
| |||
483 | 479 | | |
484 | 480 | | |
485 | 481 | | |
486 | | - | |
| 482 | + | |
487 | 483 | | |
488 | 484 | | |
489 | 485 | | |
| |||
753 | 749 | | |
754 | 750 | | |
755 | 751 | | |
756 | | - | |
| 752 | + | |
757 | 753 | | |
758 | 754 | | |
759 | 755 | | |
| |||
779 | 775 | | |
780 | 776 | | |
781 | 777 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
| 778 | + | |
787 | 779 | | |
788 | 780 | | |
789 | 781 | | |
| |||
833 | 825 | | |
834 | 826 | | |
835 | 827 | | |
836 | | - | |
| 828 | + | |
837 | 829 | | |
838 | 830 | | |
839 | 831 | | |
| |||
864 | 856 | | |
865 | 857 | | |
866 | 858 | | |
867 | | - | |
| 859 | + | |
868 | 860 | | |
869 | 861 | | |
870 | 862 | | |
| |||
948 | 940 | | |
949 | 941 | | |
950 | 942 | | |
951 | | - | |
| 943 | + | |
952 | 944 | | |
953 | 945 | | |
954 | 946 | | |
955 | 947 | | |
956 | 948 | | |
957 | 949 | | |
958 | 950 | | |
959 | | - | |
| 951 | + | |
960 | 952 | | |
961 | 953 | | |
962 | 954 | | |
| |||
1035 | 1027 | | |
1036 | 1028 | | |
1037 | 1029 | | |
1038 | | - | |
| 1030 | + | |
1039 | 1031 | | |
1040 | 1032 | | |
1041 | 1033 | | |
| |||
1055 | 1047 | | |
1056 | 1048 | | |
1057 | 1049 | | |
1058 | | - | |
| 1050 | + | |
1059 | 1051 | | |
1060 | 1052 | | |
1061 | 1053 | | |
| |||
1200 | 1192 | | |
1201 | 1193 | | |
1202 | 1194 | | |
1203 | | - | |
| 1195 | + | |
1204 | 1196 | | |
1205 | 1197 | | |
1206 | 1198 | | |
| |||
0 commit comments