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)
37 - No shared variables, all the data are CPU local.
38 - If a softirq needs serialization, let it serialize itself
40 - Even if softirq is serialized, only local cpu is marked for
46 - NET RX softirq. It is multithreaded and does not require
48 - NET TX softirq. It kicks software netdevice queues, hence
51 - Tasklets: serialized wrt itself.
70 * but we also don't want to introduce a worst case 1/HZ latency
96 * - count is changed by SOFTIRQ_OFFSET on entering or leaving softirq
99 * - count is changed by SOFTIRQ_DISABLE_OFFSET (= 2 * SOFTIRQ_OFFSET)
129 * local_bh_blocked() - Check for idle whether BH processing is blocked
151 if (!current->softirq_disable_cnt) { in __local_bh_disable_ip()
170 current->softirq_disable_cnt = newcnt; in __local_bh_disable_ip()
185 DEBUG_LOCKS_WARN_ON(current->softirq_disable_cnt != in __local_bh_enable()
195 current->softirq_disable_cnt = newcnt; in __local_bh_enable()
286 * get raised which haven't been raised before the flush, warn so it can be
298 * This one is for softirq.c-internal use, where hardirqs are disabled
312 * is set and before current->softirq_enabled is cleared. in __local_bh_disable_ip()
326 current->preempt_disable_ip = get_lock_parent_ip(); in __local_bh_disable_ip()
348 * Special-case - softirqs can safely be enabled by __do_softirq(),
349 * without processing still-pending softirqs:
374 __preempt_count_sub(cnt - 1); in __local_bh_enable_ip()
470 * The two things to balance is latency against fairness -
481 * not miss-qualify lock contexts and miss possible deadlocks.
513 unsigned long old_flags = current->flags; in __do_softirq()
525 current->flags &= ~PF_MEMALLOC; in __do_softirq()
545 h += softirq_bit - 1; in __do_softirq()
547 vec_nr = h - softirq_vec; in __do_softirq()
553 h->action(h); in __do_softirq()
557 vec_nr, softirq_to_name[vec_nr], h->action, in __do_softirq()
574 --max_restart) in __do_softirq()
587 * irq_enter_rcu - Enter an interrupt context with RCU watching
601 * irq_enter - Enter an interrupt context including RCU update
638 * irq_exit_rcu() - Exit an interrupt context without updating RCU
650 * irq_exit - Exit an interrupt context, update RCU and lockdep
671 * (this also catches softirq-disabled code). We will in raise_softirq_irqoff()
707 struct tasklet_struct *head; member
714 static void __tasklet_schedule_common(struct tasklet_struct *t, in __tasklet_schedule_common() argument
718 struct tasklet_head *head; in __tasklet_schedule_common() local
722 head = this_cpu_ptr(headp); in __tasklet_schedule_common()
723 t->next = NULL; in __tasklet_schedule_common()
724 *head->tail = t; in __tasklet_schedule_common()
725 head->tail = &(t->next); in __tasklet_schedule_common()
730 void __tasklet_schedule(struct tasklet_struct *t) in __tasklet_schedule() argument
732 __tasklet_schedule_common(t, &tasklet_vec, in __tasklet_schedule()
737 void __tasklet_hi_schedule(struct tasklet_struct *t) in __tasklet_hi_schedule() argument
739 __tasklet_schedule_common(t, &tasklet_hi_vec, in __tasklet_hi_schedule()
744 static bool tasklet_clear_sched(struct tasklet_struct *t) in tasklet_clear_sched() argument
746 if (test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) { in tasklet_clear_sched()
747 wake_up_var(&t->state); in tasklet_clear_sched()
752 t->use_callback ? "callback" : "func", in tasklet_clear_sched()
753 t->use_callback ? (void *)t->callback : (void *)t->func); in tasklet_clear_sched()
765 list = tl_head->head; in tasklet_action_common()
766 tl_head->head = NULL; in tasklet_action_common()
767 tl_head->tail = &tl_head->head; in tasklet_action_common()
771 struct tasklet_struct *t = list; in tasklet_action_common() local
773 list = list->next; in tasklet_action_common()
775 if (tasklet_trylock(t)) { in tasklet_action_common()
776 if (!atomic_read(&t->count)) { in tasklet_action_common()
777 if (tasklet_clear_sched(t)) { in tasklet_action_common()
778 if (t->use_callback) { in tasklet_action_common()
779 trace_tasklet_entry(t, t->callback); in tasklet_action_common()
780 t->callback(t); in tasklet_action_common()
781 trace_tasklet_exit(t, t->callback); in tasklet_action_common()
783 trace_tasklet_entry(t, t->func); in tasklet_action_common()
784 t->func(t->data); in tasklet_action_common()
785 trace_tasklet_exit(t, t->func); in tasklet_action_common()
788 tasklet_unlock(t); in tasklet_action_common()
791 tasklet_unlock(t); in tasklet_action_common()
795 t->next = NULL; in tasklet_action_common()
796 *tl_head->tail = t; in tasklet_action_common()
797 tl_head->tail = &t->next; in tasklet_action_common()
813 void tasklet_setup(struct tasklet_struct *t, in tasklet_setup() argument
816 t->next = NULL; in tasklet_setup()
817 t->state = 0; in tasklet_setup()
818 atomic_set(&t->count, 0); in tasklet_setup()
819 t->callback = callback; in tasklet_setup()
820 t->use_callback = true; in tasklet_setup()
821 t->data = 0; in tasklet_setup()
825 void tasklet_init(struct tasklet_struct *t, in tasklet_init() argument
828 t->next = NULL; in tasklet_init()
829 t->state = 0; in tasklet_init()
830 atomic_set(&t->count, 0); in tasklet_init()
831 t->func = func; in tasklet_init()
832 t->use_callback = false; in tasklet_init()
833 t->data = data; in tasklet_init()
842 void tasklet_unlock_spin_wait(struct tasklet_struct *t) in tasklet_unlock_spin_wait() argument
844 while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { in tasklet_unlock_spin_wait()
863 void tasklet_kill(struct tasklet_struct *t) in tasklet_kill() argument
868 while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) in tasklet_kill()
869 wait_var_event(&t->state, !test_bit(TASKLET_STATE_SCHED, &t->state)); in tasklet_kill()
871 tasklet_unlock_wait(t); in tasklet_kill()
872 tasklet_clear_sched(t); in tasklet_kill()
877 void tasklet_unlock(struct tasklet_struct *t) in tasklet_unlock() argument
880 clear_bit(TASKLET_STATE_RUN, &t->state); in tasklet_unlock()
882 wake_up_var(&t->state); in tasklet_unlock()
886 void tasklet_unlock_wait(struct tasklet_struct *t) in tasklet_unlock_wait() argument
888 wait_var_event(&t->state, !test_bit(TASKLET_STATE_RUN, &t->state)); in tasklet_unlock_wait()
899 &per_cpu(tasklet_vec, cpu).head; in softirq_init()
901 &per_cpu(tasklet_hi_vec, cpu).head; in softirq_init()
936 if (&per_cpu(tasklet_vec, cpu).head != per_cpu(tasklet_vec, cpu).tail) { in takeover_tasklets()
937 *__this_cpu_read(tasklet_vec.tail) = per_cpu(tasklet_vec, cpu).head; in takeover_tasklets()
939 per_cpu(tasklet_vec, cpu).head = NULL; in takeover_tasklets()
940 per_cpu(tasklet_vec, cpu).tail = &per_cpu(tasklet_vec, cpu).head; in takeover_tasklets()
944 if (&per_cpu(tasklet_hi_vec, cpu).head != per_cpu(tasklet_hi_vec, cpu).tail) { in takeover_tasklets()
945 *__this_cpu_read(tasklet_hi_vec.tail) = per_cpu(tasklet_hi_vec, cpu).head; in takeover_tasklets()
947 per_cpu(tasklet_hi_vec, cpu).head = NULL; in takeover_tasklets()
948 per_cpu(tasklet_hi_vec, cpu).tail = &per_cpu(tasklet_hi_vec, cpu).head; in takeover_tasklets()