Skip to content

Commit aa93ec6

Browse files
committed
Merge branches 'doc.2020.02.27a', 'fixes.2020.03.21a', 'kfree_rcu.2020.02.20a', 'locktorture.2020.02.20a', 'ovld.2020.02.20a', 'rcu-tasks.2020.02.20a', 'srcu.2020.02.20a' and 'torture.2020.02.20a' into HEAD
doc.2020.02.27a: Documentation updates. fixes.2020.03.21a: Miscellaneous fixes. kfree_rcu.2020.02.20a: Updates to kfree_rcu(). locktorture.2020.02.20a: Lock torture-test updates. ovld.2020.02.20a: Updates to callback-overload handling. rcu-tasks.2020.02.20a: RCU-tasks updates. srcu.2020.02.20a: SRCU updates. torture.2020.02.20a: Torture-test updates.
8 parents 8149b5c + 127e298 + 6137079 + 28e09a2 + b692dc4 + 90ba11b + 7104260 + a144935 commit aa93ec6

File tree

29 files changed

+644
-203
lines changed

29 files changed

+644
-203
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3980,6 +3980,15 @@
39803980
Set threshold of queued RCU callbacks below which
39813981
batch limiting is re-enabled.
39823982

3983+
rcutree.qovld= [KNL]
3984+
Set threshold of queued RCU callbacks beyond which
3985+
RCU's force-quiescent-state scan will aggressively
3986+
enlist help from cond_resched() and sched IPIs to
3987+
help CPUs more quickly reach quiescent states.
3988+
Set to less than zero to make this be set based
3989+
on rcutree.qhimark at boot time and to zero to
3990+
disable more aggressive help enlistment.
3991+
39833992
rcutree.rcu_idle_gp_delay= [KNL]
39843993
Set wakeup interval for idle CPUs that have
39853994
RCU callbacks (RCU_FAST_NO_HZ=y).
@@ -4195,6 +4204,12 @@
41954204
rcupdate.rcu_cpu_stall_suppress= [KNL]
41964205
Suppress RCU CPU stall warning messages.
41974206

4207+
rcupdate.rcu_cpu_stall_suppress_at_boot= [KNL]
4208+
Suppress RCU CPU stall warning messages and
4209+
rcutorture writer stall warnings that occur
4210+
during early boot, that is, during the time
4211+
before the init task is spawned.
4212+
41984213
rcupdate.rcu_cpu_stall_timeout= [KNL]
41994214
Set timeout for RCU CPU stall warning messages.
42004215

@@ -4867,6 +4882,10 @@
48674882
topology updates sent by the hypervisor to this
48684883
LPAR.
48694884

4885+
torture.disable_onoff_at_boot= [KNL]
4886+
Prevent the CPU-hotplug component of torturing
4887+
until after init has spawned.
4888+
48704889
tp720= [HW,PS2]
48714890

48724891
tpm_suspend_pcr=[HW,TPM]

fs/nfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cre
23832383
rcu_read_lock();
23842384
if (nfsi->cache_validity & NFS_INO_INVALID_ACCESS)
23852385
goto out;
2386-
lh = rcu_dereference(nfsi->access_cache_entry_lru.prev);
2386+
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
23872387
cache = list_entry(lh, struct nfs_access_entry, lru);
23882388
if (lh == &nfsi->access_cache_entry_lru ||
23892389
cred_fscmp(cred, cache->cred) != 0)

include/linux/rculist.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
6060
#define __list_check_rcu(dummy, cond, extra...) \
6161
({ \
6262
check_arg_count_one(extra); \
63-
RCU_LOCKDEP_WARN(!cond && !rcu_read_lock_any_held(), \
63+
RCU_LOCKDEP_WARN(!(cond) && !rcu_read_lock_any_held(), \
6464
"RCU-list traversed in non-reader section!"); \
65-
})
65+
})
6666
#else
6767
#define __list_check_rcu(dummy, cond, extra...) \
6868
({ check_arg_count_one(extra); })

include/linux/rcutiny.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void rcu_scheduler_starting(void);
8383
static inline void rcu_scheduler_starting(void) { }
8484
#endif /* #else #ifndef CONFIG_SRCU */
8585
static inline void rcu_end_inkernel_boot(void) { }
86+
static inline bool rcu_inkernel_boot_has_ended(void) { return true; }
8687
static inline bool rcu_is_watching(void) { return true; }
8788
static inline void rcu_momentary_dyntick_idle(void) { }
8889
static inline void kfree_rcu_scheduler_running(void) { }

include/linux/rcutree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void exit_rcu(void);
5454
void rcu_scheduler_starting(void);
5555
extern int rcu_scheduler_active __read_mostly;
5656
void rcu_end_inkernel_boot(void);
57+
bool rcu_inkernel_boot_has_ended(void);
5758
bool rcu_is_watching(void);
5859
#ifndef CONFIG_PREEMPTION
5960
void rcu_all_qs(void);

include/linux/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static inline void destroy_timer_on_stack(struct timer_list *timer) { }
164164
*/
165165
static inline int timer_pending(const struct timer_list * timer)
166166
{
167-
return timer->entry.pprev != NULL;
167+
return !hlist_unhashed_lockless(&timer->entry);
168168
}
169169

170170
extern void add_timer_on(struct timer_list *timer, int cpu);

include/trace/events/rcu.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,34 @@ TRACE_EVENT_RCU(rcu_invoke_kfree_callback,
623623
__entry->rcuname, __entry->rhp, __entry->offset)
624624
);
625625

626+
/*
627+
* Tracepoint for the invocation of a single RCU callback of the special
628+
* kfree_bulk() form. The first argument is the RCU flavor, the second
629+
* argument is a number of elements in array to free, the third is an
630+
* address of the array holding nr_records entries.
631+
*/
632+
TRACE_EVENT_RCU(rcu_invoke_kfree_bulk_callback,
633+
634+
TP_PROTO(const char *rcuname, unsigned long nr_records, void **p),
635+
636+
TP_ARGS(rcuname, nr_records, p),
637+
638+
TP_STRUCT__entry(
639+
__field(const char *, rcuname)
640+
__field(unsigned long, nr_records)
641+
__field(void **, p)
642+
),
643+
644+
TP_fast_assign(
645+
__entry->rcuname = rcuname;
646+
__entry->nr_records = nr_records;
647+
__entry->p = p;
648+
),
649+
650+
TP_printk("%s bulk=0x%p nr_records=%lu",
651+
__entry->rcuname, __entry->p, __entry->nr_records)
652+
);
653+
626654
/*
627655
* Tracepoint for exiting rcu_do_batch after RCU callbacks have been
628656
* invoked. The first argument is the name of the RCU flavor,
@@ -712,6 +740,7 @@ TRACE_EVENT_RCU(rcu_torture_read,
712740
* "Begin": rcu_barrier() started.
713741
* "EarlyExit": rcu_barrier() piggybacked, thus early exit.
714742
* "Inc1": rcu_barrier() piggyback check counter incremented.
743+
* "OfflineNoCBQ": rcu_barrier() found offline no-CBs CPU with callbacks.
715744
* "OnlineQ": rcu_barrier() found online CPU with callbacks.
716745
* "OnlineNQ": rcu_barrier() found online CPU, no callbacks.
717746
* "IRQ": An rcu_barrier_callback() callback posted on remote CPU.

kernel/locking/locktorture.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ static struct lock_torture_ops percpu_rwsem_lock_ops = {
618618
static int lock_torture_writer(void *arg)
619619
{
620620
struct lock_stress_stats *lwsp = arg;
621-
static DEFINE_TORTURE_RANDOM(rand);
621+
DEFINE_TORTURE_RANDOM(rand);
622622

623623
VERBOSE_TOROUT_STRING("lock_torture_writer task started");
624624
set_user_nice(current, MAX_NICE);
@@ -655,7 +655,7 @@ static int lock_torture_writer(void *arg)
655655
static int lock_torture_reader(void *arg)
656656
{
657657
struct lock_stress_stats *lrsp = arg;
658-
static DEFINE_TORTURE_RANDOM(rand);
658+
DEFINE_TORTURE_RANDOM(rand);
659659

660660
VERBOSE_TOROUT_STRING("lock_torture_reader task started");
661661
set_user_nice(current, MAX_NICE);
@@ -696,15 +696,16 @@ static void __torture_print_stats(char *page,
696696
if (statp[i].n_lock_fail)
697697
fail = true;
698698
sum += statp[i].n_lock_acquired;
699-
if (max < statp[i].n_lock_fail)
700-
max = statp[i].n_lock_fail;
701-
if (min > statp[i].n_lock_fail)
702-
min = statp[i].n_lock_fail;
699+
if (max < statp[i].n_lock_acquired)
700+
max = statp[i].n_lock_acquired;
701+
if (min > statp[i].n_lock_acquired)
702+
min = statp[i].n_lock_acquired;
703703
}
704704
page += sprintf(page,
705705
"%s: Total: %lld Max/Min: %ld/%ld %s Fail: %d %s\n",
706706
write ? "Writes" : "Reads ",
707-
sum, max, min, max / 2 > min ? "???" : "",
707+
sum, max, min,
708+
!onoff_interval && max / 2 > min ? "???" : "",
708709
fail, fail ? "!!!" : "");
709710
if (fail)
710711
atomic_inc(&cxt.n_lock_torture_errors);

kernel/locking/rtmutex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ rt_mutex_set_owner(struct rt_mutex *lock, struct task_struct *owner)
5757
if (rt_mutex_has_waiters(lock))
5858
val |= RT_MUTEX_HAS_WAITERS;
5959

60-
lock->owner = (struct task_struct *)val;
60+
WRITE_ONCE(lock->owner, (struct task_struct *)val);
6161
}
6262

6363
static inline void clear_rt_mutex_waiters(struct rt_mutex *lock)

kernel/rcu/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# and is generally not a function of system call inputs.
44
KCOV_INSTRUMENT := n
55

6+
ifeq ($(CONFIG_KCSAN),y)
7+
KBUILD_CFLAGS += -g -fno-omit-frame-pointer
8+
endif
9+
610
obj-y += update.o sync.o
711
obj-$(CONFIG_TREE_SRCU) += srcutree.o
812
obj-$(CONFIG_TINY_SRCU) += srcutiny.o

0 commit comments

Comments
 (0)