diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/acct.h | 4 | ||||
-rw-r--r-- | include/linux/aio.h | 7 | ||||
-rw-r--r-- | include/linux/cpumask.h | 16 | ||||
-rw-r--r-- | include/linux/list.h | 39 | ||||
-rw-r--r-- | include/linux/rcupdate.h | 1 |
5 files changed, 38 insertions, 29 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index 1993a3691768..19f70462b3be 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
@@ -162,13 +162,13 @@ typedef struct acct acct_t; | |||
162 | #ifdef __KERNEL__ | 162 | #ifdef __KERNEL__ |
163 | /* | 163 | /* |
164 | * Yet another set of HZ to *HZ helper functions. | 164 | * Yet another set of HZ to *HZ helper functions. |
165 | * See <linux/times.h> for the original. | 165 | * See <linux/jiffies.h> for the original. |
166 | */ | 166 | */ |
167 | 167 | ||
168 | static inline u32 jiffies_to_AHZ(unsigned long x) | 168 | static inline u32 jiffies_to_AHZ(unsigned long x) |
169 | { | 169 | { |
170 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 | 170 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 |
171 | return x / (HZ / USER_HZ); | 171 | return x / (HZ / AHZ); |
172 | #else | 172 | #else |
173 | u64 tmp = (u64)x * TICK_NSEC; | 173 | u64 tmp = (u64)x * TICK_NSEC; |
174 | do_div(tmp, (NSEC_PER_SEC / AHZ)); | 174 | do_div(tmp, (NSEC_PER_SEC / AHZ)); |
diff --git a/include/linux/aio.h b/include/linux/aio.h index 60def658b246..0decf66117c1 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -24,7 +24,12 @@ struct kioctx; | |||
24 | #define KIOCB_SYNC_KEY (~0U) | 24 | #define KIOCB_SYNC_KEY (~0U) |
25 | 25 | ||
26 | /* ki_flags bits */ | 26 | /* ki_flags bits */ |
27 | #define KIF_LOCKED 0 | 27 | /* |
28 | * This may be used for cancel/retry serialization in the future, but | ||
29 | * for now it's unused and we probably don't want modules to even | ||
30 | * think they can use it. | ||
31 | */ | ||
32 | /* #define KIF_LOCKED 0 */ | ||
28 | #define KIF_KICKED 1 | 33 | #define KIF_KICKED 1 |
29 | #define KIF_CANCELLED 2 | 34 | #define KIF_CANCELLED 2 |
30 | 35 | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index fe9778301d07..9bdba8169b41 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -393,15 +393,13 @@ extern cpumask_t cpu_present_map; | |||
393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | 393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) |
394 | 394 | ||
395 | /* Find the highest possible smp_processor_id() */ | 395 | /* Find the highest possible smp_processor_id() */ |
396 | static inline unsigned int highest_possible_processor_id(void) | 396 | #define highest_possible_processor_id() \ |
397 | { | 397 | ({ \ |
398 | unsigned int cpu, highest = 0; | 398 | unsigned int cpu, highest = 0; \ |
399 | 399 | for_each_cpu_mask(cpu, cpu_possible_map) \ | |
400 | for_each_cpu_mask(cpu, cpu_possible_map) | 400 | highest = cpu; \ |
401 | highest = cpu; | 401 | highest; \ |
402 | 402 | }) | |
403 | return highest; | ||
404 | } | ||
405 | 403 | ||
406 | 404 | ||
407 | #endif /* __LINUX_CPUMASK_H */ | 405 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/list.h b/include/linux/list.h index e6ec59682274..084971f333fe 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -442,12 +442,14 @@ static inline void list_splice_init(struct list_head *list, | |||
442 | * as long as the traversal is guarded by rcu_read_lock(). | 442 | * as long as the traversal is guarded by rcu_read_lock(). |
443 | */ | 443 | */ |
444 | #define list_for_each_rcu(pos, head) \ | 444 | #define list_for_each_rcu(pos, head) \ |
445 | for (pos = (head)->next; prefetch(pos->next), pos != (head); \ | 445 | for (pos = (head)->next; \ |
446 | pos = rcu_dereference(pos->next)) | 446 | prefetch(rcu_dereference(pos)->next), pos != (head); \ |
447 | pos = pos->next) | ||
447 | 448 | ||
448 | #define __list_for_each_rcu(pos, head) \ | 449 | #define __list_for_each_rcu(pos, head) \ |
449 | for (pos = (head)->next; pos != (head); \ | 450 | for (pos = (head)->next; \ |
450 | pos = rcu_dereference(pos->next)) | 451 | rcu_dereference(pos) != (head); \ |
452 | pos = pos->next) | ||
451 | 453 | ||
452 | /** | 454 | /** |
453 | * list_for_each_safe_rcu - iterate over an rcu-protected list safe | 455 | * list_for_each_safe_rcu - iterate over an rcu-protected list safe |
@@ -461,8 +463,9 @@ static inline void list_splice_init(struct list_head *list, | |||
461 | * as long as the traversal is guarded by rcu_read_lock(). | 463 | * as long as the traversal is guarded by rcu_read_lock(). |
462 | */ | 464 | */ |
463 | #define list_for_each_safe_rcu(pos, n, head) \ | 465 | #define list_for_each_safe_rcu(pos, n, head) \ |
464 | for (pos = (head)->next, n = pos->next; pos != (head); \ | 466 | for (pos = (head)->next; \ |
465 | pos = rcu_dereference(n), n = pos->next) | 467 | n = rcu_dereference(pos)->next, pos != (head); \ |
468 | pos = n) | ||
466 | 469 | ||
467 | /** | 470 | /** |
468 | * list_for_each_entry_rcu - iterate over rcu list of given type | 471 | * list_for_each_entry_rcu - iterate over rcu list of given type |
@@ -474,11 +477,11 @@ static inline void list_splice_init(struct list_head *list, | |||
474 | * the _rcu list-mutation primitives such as list_add_rcu() | 477 | * the _rcu list-mutation primitives such as list_add_rcu() |
475 | * as long as the traversal is guarded by rcu_read_lock(). | 478 | * as long as the traversal is guarded by rcu_read_lock(). |
476 | */ | 479 | */ |
477 | #define list_for_each_entry_rcu(pos, head, member) \ | 480 | #define list_for_each_entry_rcu(pos, head, member) \ |
478 | for (pos = list_entry((head)->next, typeof(*pos), member); \ | 481 | for (pos = list_entry((head)->next, typeof(*pos), member); \ |
479 | prefetch(pos->member.next), &pos->member != (head); \ | 482 | prefetch(rcu_dereference(pos)->member.next), \ |
480 | pos = rcu_dereference(list_entry(pos->member.next, \ | 483 | &pos->member != (head); \ |
481 | typeof(*pos), member))) | 484 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
482 | 485 | ||
483 | 486 | ||
484 | /** | 487 | /** |
@@ -492,8 +495,9 @@ static inline void list_splice_init(struct list_head *list, | |||
492 | * as long as the traversal is guarded by rcu_read_lock(). | 495 | * as long as the traversal is guarded by rcu_read_lock(). |
493 | */ | 496 | */ |
494 | #define list_for_each_continue_rcu(pos, head) \ | 497 | #define list_for_each_continue_rcu(pos, head) \ |
495 | for ((pos) = (pos)->next; prefetch((pos)->next), (pos) != (head); \ | 498 | for ((pos) = (pos)->next; \ |
496 | (pos) = rcu_dereference((pos)->next)) | 499 | prefetch(rcu_dereference((pos))->next), (pos) != (head); \ |
500 | (pos) = (pos)->next) | ||
497 | 501 | ||
498 | /* | 502 | /* |
499 | * Double linked lists with a single pointer list head. | 503 | * Double linked lists with a single pointer list head. |
@@ -696,8 +700,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
696 | pos = n) | 700 | pos = n) |
697 | 701 | ||
698 | #define hlist_for_each_rcu(pos, head) \ | 702 | #define hlist_for_each_rcu(pos, head) \ |
699 | for ((pos) = (head)->first; pos && ({ prefetch((pos)->next); 1; }); \ | 703 | for ((pos) = (head)->first; \ |
700 | (pos) = rcu_dereference((pos)->next)) | 704 | rcu_dereference((pos)) && ({ prefetch((pos)->next); 1; }); \ |
705 | (pos) = (pos)->next) | ||
701 | 706 | ||
702 | /** | 707 | /** |
703 | * hlist_for_each_entry - iterate over list of given type | 708 | * hlist_for_each_entry - iterate over list of given type |
@@ -762,9 +767,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
762 | */ | 767 | */ |
763 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 768 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ |
764 | for (pos = (head)->first; \ | 769 | for (pos = (head)->first; \ |
765 | pos && ({ prefetch(pos->next); 1;}) && \ | 770 | rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \ |
766 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 771 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ |
767 | pos = rcu_dereference(pos->next)) | 772 | pos = pos->next) |
768 | 773 | ||
769 | #else | 774 | #else |
770 | #warning "don't include kernel headers in userspace" | 775 | #warning "don't include kernel headers in userspace" |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 4e65eb44adfd..70191a5a148f 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -94,6 +94,7 @@ struct rcu_data { | |||
94 | long batch; /* Batch # for current RCU batch */ | 94 | long batch; /* Batch # for current RCU batch */ |
95 | struct rcu_head *nxtlist; | 95 | struct rcu_head *nxtlist; |
96 | struct rcu_head **nxttail; | 96 | struct rcu_head **nxttail; |
97 | long count; /* # of queued items */ | ||
97 | struct rcu_head *curlist; | 98 | struct rcu_head *curlist; |
98 | struct rcu_head **curtail; | 99 | struct rcu_head **curtail; |
99 | struct rcu_head *donelist; | 100 | struct rcu_head *donelist; |