Lines Matching +full:t +full:- +full:head

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903)
38 - No shared variables, all the data are CPU local.
39 - If a softirq needs serialization, let it serialize itself
41 - Even if softirq is serialized, only local cpu is marked for
47 - NET RX softirq. It is multithreaded and does not require
49 - NET TX softirq. It kicks software netdevice queues, hence
52 - Tasklets: serialized wrt itself.
71 * but we also don't want to introduce a worst case 1/HZ latency
97 * - count is changed by SOFTIRQ_OFFSET on entering or leaving softirq
100 * - count is changed by SOFTIRQ_DISABLE_OFFSET (= 2 * SOFTIRQ_OFFSET)
130 * local_bh_blocked() - Check for idle whether BH processing is blocked
152 if (!current->softirq_disable_cnt) { in __local_bh_disable_ip()
171 current->softirq_disable_cnt = newcnt; in __local_bh_disable_ip()
186 DEBUG_LOCKS_WARN_ON(current->softirq_disable_cnt != in __local_bh_enable()
196 current->softirq_disable_cnt = newcnt; in __local_bh_enable()
289 * idle load balancing. If soft interrupts get raised which haven't been
306 * This one is for softirq.c-internal use, where hardirqs are disabled
320 * is set and before current->softirq_enabled is cleared. in __local_bh_disable_ip()
334 current->preempt_disable_ip = get_lock_parent_ip(); in __local_bh_disable_ip()
356 * Special-case - softirqs can safely be enabled by __do_softirq(),
357 * without processing still-pending softirqs:
382 __preempt_count_sub(cnt - 1); in __local_bh_enable_ip()
478 * The two things to balance is latency against fairness -
489 * not miss-qualify lock contexts and miss possible deadlocks.
521 unsigned long old_flags = current->flags; in handle_softirqs()
533 current->flags &= ~PF_MEMALLOC; in handle_softirqs()
553 h += softirq_bit - 1; in handle_softirqs()
555 vec_nr = h - softirq_vec; in handle_softirqs()
561 h->action(); in handle_softirqs()
565 vec_nr, softirq_to_name[vec_nr], h->action, in handle_softirqs()
581 --max_restart) in handle_softirqs()
599 * irq_enter_rcu - Enter an interrupt context with RCU watching
613 * irq_enter - Enter an interrupt context including RCU update
672 * irq_exit_rcu() - Exit an interrupt context without updating RCU
684 * irq_exit - Exit an interrupt context, update RCU and lockdep
705 * (this also catches softirq-disabled code). We will in raise_softirq_irqoff()
741 struct tasklet_struct *head; member
748 static void __tasklet_schedule_common(struct tasklet_struct *t, in __tasklet_schedule_common() argument
752 struct tasklet_head *head; in __tasklet_schedule_common() local
756 head = this_cpu_ptr(headp); in __tasklet_schedule_common()
757 t->next = NULL; in __tasklet_schedule_common()
758 *head->tail = t; in __tasklet_schedule_common()
759 head->tail = &(t->next); in __tasklet_schedule_common()
764 void __tasklet_schedule(struct tasklet_struct *t) in __tasklet_schedule() argument
766 __tasklet_schedule_common(t, &tasklet_vec, in __tasklet_schedule()
771 void __tasklet_hi_schedule(struct tasklet_struct *t) in __tasklet_hi_schedule() argument
773 __tasklet_schedule_common(t, &tasklet_hi_vec, in __tasklet_hi_schedule()
778 static bool tasklet_clear_sched(struct tasklet_struct *t) in tasklet_clear_sched() argument
780 if (test_and_clear_wake_up_bit(TASKLET_STATE_SCHED, &t->state)) in tasklet_clear_sched()
784 t->use_callback ? "callback" : "func", in tasklet_clear_sched()
785 t->use_callback ? (void *)t->callback : (void *)t->func); in tasklet_clear_sched()
796 list = tl_head->head; in tasklet_action_common()
797 tl_head->head = NULL; in tasklet_action_common()
798 tl_head->tail = &tl_head->head; in tasklet_action_common()
802 struct tasklet_struct *t = list; in tasklet_action_common() local
804 list = list->next; in tasklet_action_common()
806 if (tasklet_trylock(t)) { in tasklet_action_common()
807 if (!atomic_read(&t->count)) { in tasklet_action_common()
808 if (tasklet_clear_sched(t)) { in tasklet_action_common()
809 if (t->use_callback) { in tasklet_action_common()
810 trace_tasklet_entry(t, t->callback); in tasklet_action_common()
811 t->callback(t); in tasklet_action_common()
812 trace_tasklet_exit(t, t->callback); in tasklet_action_common()
814 trace_tasklet_entry(t, t->func); in tasklet_action_common()
815 t->func(t->data); in tasklet_action_common()
816 trace_tasklet_exit(t, t->func); in tasklet_action_common()
819 tasklet_unlock(t); in tasklet_action_common()
822 tasklet_unlock(t); in tasklet_action_common()
826 t->next = NULL; in tasklet_action_common()
827 *tl_head->tail = t; in tasklet_action_common()
828 tl_head->tail = &t->next; in tasklet_action_common()
846 void tasklet_setup(struct tasklet_struct *t, in tasklet_setup() argument
849 t->next = NULL; in tasklet_setup()
850 t->state = 0; in tasklet_setup()
851 atomic_set(&t->count, 0); in tasklet_setup()
852 t->callback = callback; in tasklet_setup()
853 t->use_callback = true; in tasklet_setup()
854 t->data = 0; in tasklet_setup()
858 void tasklet_init(struct tasklet_struct *t, in tasklet_init() argument
861 t->next = NULL; in tasklet_init()
862 t->state = 0; in tasklet_init()
863 atomic_set(&t->count, 0); in tasklet_init()
864 t->func = func; in tasklet_init()
865 t->use_callback = false; in tasklet_init()
866 t->data = data; in tasklet_init()
875 void tasklet_unlock_spin_wait(struct tasklet_struct *t) in tasklet_unlock_spin_wait() argument
877 while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { in tasklet_unlock_spin_wait()
896 void tasklet_kill(struct tasklet_struct *t) in tasklet_kill() argument
901 wait_on_bit_lock(&t->state, TASKLET_STATE_SCHED, TASK_UNINTERRUPTIBLE); in tasklet_kill()
903 tasklet_unlock_wait(t); in tasklet_kill()
904 tasklet_clear_sched(t); in tasklet_kill()
909 void tasklet_unlock(struct tasklet_struct *t) in tasklet_unlock() argument
911 clear_and_wake_up_bit(TASKLET_STATE_RUN, &t->state); in tasklet_unlock()
915 void tasklet_unlock_wait(struct tasklet_struct *t) in tasklet_unlock_wait() argument
917 wait_on_bit(&t->state, TASKLET_STATE_RUN, TASK_UNINTERRUPTIBLE); in tasklet_unlock_wait()
928 &per_cpu(tasklet_vec, cpu).head; in softirq_init()
930 &per_cpu(tasklet_hi_vec, cpu).head; in softirq_init()
967 if (&per_cpu(tasklet_vec, cpu).head != per_cpu(tasklet_vec, cpu).tail) { in takeover_tasklets()
968 *__this_cpu_read(tasklet_vec.tail) = per_cpu(tasklet_vec, cpu).head; in takeover_tasklets()
970 per_cpu(tasklet_vec, cpu).head = NULL; in takeover_tasklets()
971 per_cpu(tasklet_vec, cpu).tail = &per_cpu(tasklet_vec, cpu).head; in takeover_tasklets()
975 if (&per_cpu(tasklet_hi_vec, cpu).head != per_cpu(tasklet_hi_vec, cpu).tail) { in takeover_tasklets()
976 *__this_cpu_read(tasklet_hi_vec.tail) = per_cpu(tasklet_hi_vec, cpu).head; in takeover_tasklets()
978 per_cpu(tasklet_hi_vec, cpu).head = NULL; in takeover_tasklets()
979 per_cpu(tasklet_hi_vec, cpu).tail = &per_cpu(tasklet_hi_vec, cpu).head; in takeover_tasklets()