Skip to content

Commit 4defe68

Browse files
Steven Rostedtrostedt
authored andcommitted
tracing/filter: Remove synchronize_sched() from __alloc_preds()
Because the filters are processed first and then activated (added to the call), we no longer need to worry about the preds of the filter in __alloc_preds() being used. As the filter that is allocating preds is not activated yet. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 75b8e98 commit 4defe68

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

kernel/trace/trace_events_filter.c

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -795,33 +795,17 @@ static int __alloc_preds(struct event_filter *filter, int n_preds)
795795
struct filter_pred *pred;
796796
int i;
797797

798-
if (filter->preds) {
799-
if (filter->a_preds < n_preds) {
800-
/*
801-
* We need to reallocate.
802-
* We should have already have zeroed out
803-
* the pred count and called synchronized_sched()
804-
* to make sure no one is using the preds.
805-
*/
806-
if (WARN_ON_ONCE(filter->n_preds)) {
807-
/* We need to reset it now */
808-
filter->n_preds = 0;
809-
synchronize_sched();
810-
}
811-
__free_preds(filter);
812-
}
813-
}
798+
if (filter->preds)
799+
__free_preds(filter);
800+
801+
filter->preds =
802+
kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL);
814803

815-
if (!filter->preds) {
816-
filter->preds =
817-
kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL);
818-
filter->a_preds = n_preds;
819-
}
820804
if (!filter->preds)
821805
return -ENOMEM;
822806

823-
if (WARN_ON(filter->a_preds < n_preds))
824-
return -EINVAL;
807+
filter->a_preds = n_preds;
808+
filter->n_preds = 0;
825809

826810
for (i = 0; i < n_preds; i++) {
827811
pred = &filter->preds[i];

0 commit comments

Comments
 (0)