{ "results": [ { "index": 0, "function": "__queue_work", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff818d5d2a", "address_formatted": "0xffffffff818d5d2a (0xffffffff818d4fe0 + 0xd4a)", "addr2line_address": "0xffffffff818d5d2a", "source": { "primary": { "function": "__queue_work", "file": "kernel/workqueue.c", "line": 0 }, "inlined_frames": [] }, "function_source": null, "note": "addr2line returned line 0 for kernel/workqueue.c \u2014 DWARF may be incomplete at this address", "disasm": "ffffffff818d5cec:\tmov 0x18(%rsp),%r15\nffffffff818d5cf1:\tjmp ffffffff818d5cf8 <__queue_work+0xd18>\nffffffff818d5cf3:\tcall ffffffff81c5e0f0 <__sanitizer_cov_trace_pc>\nffffffff818d5cf8:\tlea 0xea93071(%rip),%r14 # ffffffff90368d70 <__start___bug_table+0xd530>\nffffffff818d5cff:\tadd $0x18,%r13\nffffffff818d5d03:\tmov %r13,%rax\nffffffff818d5d06:\tshr $0x3,%rax\nffffffff818d5d0a:\tcmpb $0x0,(%rax,%r12,1)\nffffffff818d5d0f:\tje ffffffff818d5d19 <__queue_work+0xd39>\nffffffff818d5d11:\tmov %r13,%rdi\nffffffff818d5d14:\tcall ffffffff8232aa30 <__asan_report_load8_noabort>\nffffffff818d5d19:\tmov 0x0(%r13),%rsi\nffffffff818d5d1d:\tadd $0x170,%r15\nffffffff818d5d24:\tmov %r14,%rdi\nffffffff818d5d27:\tmov %r15,%rdx\nffffffff818d5d2a:\tcall ffffffff8bbd4e98 <__SCT__WARN_trap> <<< crash\nffffffff818d5d2f:\tadd $0x58,%rsp\nffffffff818d5d33:\tpop %rbx\nffffffff818d5d34:\tpop %r12\nffffffff818d5d36:\tpop %r13\nffffffff818d5d38:\tpop %r14" }, { "index": 1, "function": "queue_work_on", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff818d4f06", "address_formatted": "0xffffffff818d4f06 (0xffffffff818d4e00 + 0x106)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff818d4f05", "source": { "primary": { "function": "queue_work_on", "file": "kernel/workqueue.c", "line": 2432 }, "inlined_frames": [] }, "function_source": { "file": "kernel/workqueue.c", "start_line": 2414, "end_line": 2438, "code": " * We queue the work to a specific CPU, the caller must ensure it\n * can't go away. Callers that fail to ensure that the specified\n * CPU cannot go away will execute on a randomly chosen CPU.\n * But note well that callers specifying a CPU that never has been\n * online will get a splat.\n *\n * Return: %false if @work was already on a queue, %true otherwise.\n */\nbool queue_work_on(int cpu, struct workqueue_struct *wq,\n struct work_struct *work)\n{\n bool ret = false;\n unsigned long irq_flags;\n\n local_irq_save(irq_flags);\n\n if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)) &&\n !clear_pending_if_disabled(work)) {\n __queue_work(cpu, wq, work);\n ret = true;\n }\n\n local_irq_restore(irq_flags);\n return ret;\n}\n" }, "git_blame_hashes": [ "443378f0664a78756c3e3aeaab92750fe1e05735", "4690c4ab56c71919893ca25252f2dd65b58188c7", "854f5cc5b7355ceebf2bdfed97ea8f3c5d47a0c3", "86898fa6b8cd942505860556f3a0bf52eae57fe8", "8930caba3dbdd8b86dd6934a5920bf61b53a931e", "c1a220e7acf8ad2c03504891f4a70cd9c32c904b", "c26e2f2e2fcfb73996fa025a0d3b5695017d65b5", "d185af300fe43c130083851ca918ea2bb9600f0f", "d4283e9378619c14dc3826a6b0527eb5d967ffde" ], "blame_details": [ { "hash": "86898fa6b8cd942505860556f3a0bf52eae57fe8", "subject": "workqueue: Implement disable/enable for (delayed) work items" }, { "hash": "c26e2f2e2fcfb73996fa025a0d3b5695017d65b5", "subject": "workqueue: Use variable name irq_flags for saving local irq flags" }, { "hash": "854f5cc5b7355ceebf2bdfed97ea8f3c5d47a0c3", "subject": "Further upgrade queue_work_on() comment" }, { "hash": "443378f0664a78756c3e3aeaab92750fe1e05735", "subject": "workqueue: Upgrade queue_work_on() comment" }, { "hash": "d185af300fe43c130083851ca918ea2bb9600f0f", "subject": "workqueue: fix some scripts/kernel-doc warnings" }, { "hash": "8930caba3dbdd8b86dd6934a5920bf61b53a931e", "subject": "workqueue: disable irq while manipulating PENDING" }, { "hash": "d4283e9378619c14dc3826a6b0527eb5d967ffde", "subject": "workqueue: make queueing functions return bool" }, { "hash": "4690c4ab56c71919893ca25252f2dd65b58188c7", "subject": "workqueue: misc/cosmetic updates" }, { "hash": "c1a220e7acf8ad2c03504891f4a70cd9c32c904b", "subject": "pm: introduce new interfaces schedule_work_on() and queue_work_on()" } ], "recent_commits": [ { "hash": "86898fa6b8cd", "subject": "workqueue: Implement disable/enable for (delayed) work items" }, { "hash": "c26e2f2e2fcf", "subject": "workqueue: Use variable name irq_flags for saving local irq flags" }, { "hash": "854f5cc5b735", "subject": "Further upgrade queue_work_on() comment" }, { "hash": "443378f0664a", "subject": "workqueue: Upgrade queue_work_on() comment" }, { "hash": "d185af300fe4", "subject": "workqueue: fix some scripts/kernel-doc warnings" }, { "hash": "8930caba3dbd", "subject": "workqueue: disable irq while manipulating PENDING" }, { "hash": "d4283e937861", "subject": "workqueue: make queueing functions return bool" }, { "hash": "22df02bb3fab", "subject": "workqueue: define masks for work flags and conditionalize STATIC flags" }, { "hash": "4690c4ab56c7", "subject": "workqueue: misc/cosmetic updates" }, { "hash": "c1a220e7acf8", "subject": "pm: introduce new interfaces schedule_work_on() and queue_work_on()" } ] }, { "index": 2, "function": "hci_send_cmd", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8aaa3767", "address_formatted": "0xffffffff8aaa3767 (0xffffffff8aaa36b0 + 0xb7)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8aaa3766", "source": { "primary": { "function": "queue_work", "file": "include/linux/workqueue.h", "line": 696 }, "inlined_frames": [ { "function": "hci_send_cmd", "file": "net/bluetooth/hci_core.c", "line": 3111 } ] }, "function_source": { "file": "include/linux/workqueue.h", "start_line": 685, "end_line": 697, "code": " *\n * CPU0 CPU1\n *\n * WRITE_ONCE(x, 1); [ @work is being executed ]\n * r0 = queue_work(wq, work); r1 = READ_ONCE(x);\n *\n * Forbids: r0 == true && r1 == 0\n */\nstatic inline bool queue_work(struct workqueue_struct *wq,\n struct work_struct *work)\n{\n return queue_work_on(WORK_CPU_UNBOUND, wq, work);\n}\n" }, "git_blame_hashes": [ "8425e3d5bdbe8e741d2c73cf3189ed59b4038b84", "dbb92f88648d6206bf22fcb764fb9fe2939d401a" ], "recent_commits": [ { "hash": "dbb92f88648d", "subject": "workqueue: Document (some) memory-ordering properties of {queue,schedule}_work()" }, { "hash": "8425e3d5bdbe", "subject": "workqueue: inline trivial wrappers" } ] }, { "index": 3, "function": "hci_conn_security", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8aabbac9", "address_formatted": "0xffffffff8aabbac9 (0xffffffff8aabb530 + 0x599)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8aabbac8", "source": { "primary": { "function": "hci_conn_auth", "file": "net/bluetooth/hci_conn.c", "line": 0 }, "inlined_frames": [ { "function": "hci_conn_security", "file": "net/bluetooth/hci_conn.c", "line": 0 } ] }, "function_source": null, "note": "addr2line returned line 0 for net/bluetooth/hci_conn.c \u2014 DWARF may be incomplete at this address" }, { "index": 4, "function": "l2cap_conn_start", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8ab70f0c", "address_formatted": "0xffffffff8ab70f0c (0xffffffff8ab70b50 + 0x3bc)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8ab70f0b", "source": { "primary": { "function": "l2cap_conn_start", "file": "net/bluetooth/l2cap_core.c", "line": 1534 }, "inlined_frames": [] }, "function_source": { "file": "net/bluetooth/l2cap_core.c", "start_line": 1516, "end_line": 1592, "code": "\n/* ---- L2CAP connections ---- */\nstatic void l2cap_conn_start(struct l2cap_conn *conn)\n{\n struct l2cap_chan *chan, *tmp;\n\n BT_DBG(\"conn %p\", conn);\n\n list_for_each_entry_safe(chan, tmp, &conn->chan_l, list) {\n l2cap_chan_lock(chan);\n\n if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {\n l2cap_chan_ready(chan);\n l2cap_chan_unlock(chan);\n continue;\n }\n\n if (chan->state == BT_CONNECT) {\n if (!l2cap_chan_check_security(chan, true) ||\n !__l2cap_no_conn_pending(chan)) {\n l2cap_chan_unlock(chan);\n continue;\n }\n\n if (!l2cap_mode_supported(chan->mode, conn->feat_mask)\n && test_bit(CONF_STATE2_DEVICE,\n &chan->conf_state)) {\n l2cap_chan_close(chan, ECONNRESET);\n l2cap_chan_unlock(chan);\n continue;\n }\n\n if (l2cap_check_enc_key_size(conn->hcon, chan))\n l2cap_start_connection(chan);\n else\n l2cap_chan_close(chan, ECONNREFUSED);\n\n } else if (chan->state == BT_CONNECT2) {\n struct l2cap_conn_rsp rsp;\n char buf[128];\n rsp.scid = cpu_to_le16(chan->dcid);\n rsp.dcid = cpu_to_le16(chan->scid);\n\n if (l2cap_chan_check_security(chan, false)) {\n if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) {\n rsp.result = cpu_to_le16(L2CAP_CR_PEND);\n rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND);\n chan->ops->defer(chan);\n\n } else {\n l2cap_state_change(chan, BT_CONFIG);\n rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS);\n rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO);\n }\n } else {\n rsp.result = cpu_to_le16(L2CAP_CR_PEND);\n rsp.status = cpu_to_le16(L2CAP_CS_AUTHEN_PEND);\n }\n\n l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP,\n sizeof(rsp), &rsp);\n\n if (test_bit(CONF_REQ_SENT, &chan->conf_state) ||\n rsp.result != L2CAP_CR_SUCCESS) {\n l2cap_chan_unlock(chan);\n continue;\n }\n\n set_bit(CONF_REQ_SENT, &chan->conf_state);\n l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ,\n l2cap_build_conf_req(chan, buf, sizeof(buf)), buf);\n chan->num_conf_req++;\n }\n\n l2cap_chan_unlock(chan);\n }\n}\n" }, "git_blame_hashes": [ "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "22121fc9152ca8f25a2d790860832ccb6a414c4d", "2d7928184c3d8724064de282be4e3c3d70f39d32", "2dc4e5105f012bda7eef2f459ed3d5299ded9672", "3df91ea20e744344100b10ae69a17211fcf5b207", "47731de789749c9ed3c54751db28fd9c9eeaf019", "4e8402a3f884427f9233ba436459c158d1f2e114", "693cd8ce3f882524a5d06f7800dd8492411877b3", "6be3655552ee49aa2b5fd20fa1b08f28d0feac86", "715ec005cd10c5d53109ffe513e4d403644e3e48", "73ffa904b78287f6acf8797e040150aa26a4af4a", "79d554a6976a295aa9212172b218f29ca71c3b3d", "7af8479d9eb4319b4ba7b47a8c4d2c55af1c31e1", "89bc500e41fc5b48e0573e6b0d927fc97b8951dc", "acdcabf532908fbefbea294fcad2e3989d1dc036", "aeaeb4bbca520b862d3b3e7cd74c23042815a160", "b1235d79611e78a07629b4cbe53291c9cffd1834", "bdc257830760a784370ae4ab2d682b252b983e77", "c1360a1cf35117d6f3898cb5183ce4349d06714c", "dcf4adbfdc7ad14ca50c1133f93f998c78493c2d", "e7cafc45258c852c5176cd421615846e79a3d307", "e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3", "e9aeb2ddd441f0c8699ff04c499d7213730a0f04", "f66dc81f44d918ee1aa1a9d821bb2f25c7592bc0", "fc7f8a7ed4543853a99852ca405ea71fabe78946", "fe4128e0aabc3c748786c00da21e6eff9d3aeddb" ], "recent_commits": [ { "hash": "7af8479d9eb4", "subject": "Bluetooth: L2CAP: Fix not checking l2cap_chan security level" }, { "hash": "ab4eedb790ca", "subject": "Bluetooth: L2CAP: Fix corrupted list in hci_chan_del" }, { "hash": "693cd8ce3f88", "subject": "Bluetooth: Fix regression with minimum encryption key size alignment" }, { "hash": "e860d2c904d1", "subject": "Bluetooth: Properly check L2CAP config option output buffer length" }, { "hash": "aeaeb4bbca52", "subject": "Bluetooth: Fix L2CAP information request handling for fixed channels" }, { "hash": "e7cafc45258c", "subject": "Bluetooth: Pass initiator/acceptor information to hci_conn_security()" }, { "hash": "dcf4adbfdc7a", "subject": "Bluetooth: Convert uses of __constant_ to " }, { "hash": "acdcabf53290", "subject": "Bluetooth: Hold socket in defer callback in L2CAP socket" }, { "hash": "bdc257830760", "subject": "Bluetooth: Introduce L2CAP channel flag for defer setup" }, { "hash": "7eafc59e2f54", "subject": "Bluetooth: Store address information in L2CAP channel structure" } ] }, { "index": 5, "function": "l2cap_info_timeout", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8ab707c8", "address_formatted": "0xffffffff8ab707c8 (0xffffffff8ab70760 + 0x68)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8ab707c7", "source": { "primary": { "function": "l2cap_info_timeout", "file": "net/bluetooth/l2cap_core.c", "line": 1685 }, "inlined_frames": [] }, "function_source": { "file": "net/bluetooth/l2cap_core.c", "start_line": 1675, "end_line": 1687, "code": "\nstatic void l2cap_info_timeout(struct work_struct *work)\n{\n struct l2cap_conn *conn = container_of(work, struct l2cap_conn,\n info_timer.work);\n\n conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE;\n conn->info_ident = 0;\n\n mutex_lock(&conn->lock);\n l2cap_conn_start(conn);\n mutex_unlock(&conn->lock);\n}\n" }, "git_blame_hashes": [ "2d7928184c3d8724064de282be4e3c3d70f39d32", "4e8402a3f884427f9233ba436459c158d1f2e114", "984947dc64f82bc6cafa4d84ba1a139718f634a8", "ab4eedb790cae44313759b50fe47da285e2519d5", "e1027a7c69700301d14db03d2e049ee60c4f92df", "f878fcad1760247c054a9c80964d0b7450d2379b" ], "recent_commits": [ { "hash": "ab4eedb790ca", "subject": "Bluetooth: L2CAP: Fix corrupted list in hci_chan_del" }, { "hash": "2d7928184c3d", "subject": "Bluetooth: Fix L2CAP coding style" }, { "hash": "030013d8585b", "subject": "Bluetooth: Rename info_work to info_timer" }, { "hash": "f878fcad1760", "subject": "Bluetooth: convert info timer to delayed_work" }, { "hash": "e1027a7c6970", "subject": "Bluetooth: Request L2CAP fixed channel list if available" }, { "hash": "984947dc64f8", "subject": "Bluetooth: Fix race condition with L2CAP information request" }, { "hash": "4e8402a3f884", "subject": "[Bluetooth] Retrieve L2CAP features mask on connection setup" } ] }, { "index": 6, "function": "process_scheduled_works", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff818eb2ed", "address_formatted": "0xffffffff818eb2ed (0xffffffff818ea790 + 0xb5d)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff818eb2ec", "source": { "primary": { "function": "process_one_work", "file": "kernel/workqueue.c", "line": 0 }, "inlined_frames": [ { "function": "process_scheduled_works", "file": "kernel/workqueue.c", "line": 0 } ] }, "function_source": null, "note": "addr2line returned line 0 for kernel/workqueue.c \u2014 DWARF may be incomplete at this address" }, { "index": 7, "function": "worker_thread", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff818f3353", "address_formatted": "0xffffffff818f3353 (0xffffffff818f2900 + 0xa53)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff818f3352", "source": { "primary": { "function": "worker_thread", "file": "kernel/workqueue.c", "line": 3466 }, "inlined_frames": [] }, "function_source": { "file": "kernel/workqueue.c", "start_line": 3402, "end_line": 3483, "code": " *\n * The worker thread function. All workers belong to a worker_pool -\n * either a per-cpu one or dynamic unbound one. These workers process all\n * work items regardless of their specific target workqueue. The only\n * exception is work items which belong to workqueues with a rescuer which\n * will be explained in rescuer_thread().\n *\n * Return: 0\n */\nstatic int worker_thread(void *__worker)\n{\n struct worker *worker = __worker;\n struct worker_pool *pool = worker->pool;\n\n /* tell the scheduler that this is a workqueue worker */\n set_pf_worker(true);\nwoke_up:\n raw_spin_lock_irq(&pool->lock);\n\n /* am I supposed to die? */\n if (unlikely(worker->flags & WORKER_DIE)) {\n raw_spin_unlock_irq(&pool->lock);\n set_pf_worker(false);\n /*\n * The worker is dead and PF_WQ_WORKER is cleared, worker->pool\n * shouldn't be accessed, reset it to NULL in case otherwise.\n */\n worker->pool = NULL;\n ida_free(&pool->worker_ida, worker->id);\n return 0;\n }\n\n worker_leave_idle(worker);\nrecheck:\n /* no more worker necessary? */\n if (!need_more_worker(pool))\n goto sleep;\n\n /* do we need to manage? */\n if (unlikely(!may_start_working(pool)) && manage_workers(worker))\n goto recheck;\n\n /*\n * ->scheduled list can only be filled while a worker is\n * preparing to process a work or actually processing it.\n * Make sure nobody diddled with it while I was sleeping.\n */\n WARN_ON_ONCE(!list_empty(&worker->scheduled));\n\n /*\n * Finish PREP stage. We're guaranteed to have at least one idle\n * worker or that someone else has already assumed the manager\n * role. This is where @worker starts participating in concurrency\n * management if applicable and concurrency management is restored\n * after being rebound. See rebind_workers() for details.\n */\n worker_clr_flags(worker, WORKER_PREP | WORKER_REBOUND);\n\n do {\n struct work_struct *work =\n list_first_entry(&pool->worklist,\n struct work_struct, entry);\n\n if (assign_work(work, worker, NULL))\n process_scheduled_works(worker);\n } while (keep_working(pool));\n\n worker_set_flags(worker, WORKER_PREP);\nsleep:\n /*\n * pool->lock is held and there's no work to process and no need to\n * manage, sleep. Workers are woken up only while holding\n * pool->lock or from local cpu, so setting the current state\n * before releasing pool->lock is enough to prevent losing any\n * event.\n */\n worker_enter_idle(worker);\n __set_current_state(TASK_IDLE);\n raw_spin_unlock_irq(&pool->lock);\n schedule();\n goto woke_up;\n}\n" }, "git_blame_hashes": [ "197f6accacdaf9a0cf4da3c4ac8dd788633c0e38", "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "228f1d0018ba6b24c9f718a97a5bc35b24f1e1e3", "3af24433efac62f451bfdb1cf1edb7181fb73645", "4690c4ab56c71919893ca25252f2dd65b58188c7", "6183c009f6cd94b42e5812adcfd4ba6220a196e1", "63d95a9150ee3bbd4117fcd609dee40313b454d9", "73613840a8896f4f859eea489cb4a7a656939e70", "873eaca6eaf84b1d1ed5b7259308c6a4fca70fdc", "a9ab775bcadf122d91e1a201eb66ae2eec90365a", "a9b8a985294debae00f6c087dfec8c384d30a3b9", "affee4b294a0fc97d67c8a77dc080c4dd262a79e", "bd7bdd43dcb81bb08240b9401b36a104f77dc135", "c34056a3fdde777c079cc8a70785c2602f2586cb", "c5a94a618e7ac86b20f53d947f68d7cee6a4c6bc", "c5aa87bbf4b23f5e4f167489406daeb0ed275c47", "c8e55f360210c1bc49bea5d62bc3939b7ee13483", "d185af300fe43c130083851ca918ea2bb9600f0f", "d313dd85ad846bc768d58e9ceb28588f917f4c9a", "d565ed6309300304de4a865a04adef07a85edc45", "db7bccf45cb87522096b8f43144e31ca605a9f24", "e22bee782b3b00bd4534ae9b1c5fb2e8e6573c5c", "e441b56fe438fd126b9eea7d30c57d3cd3f34e14" ], "recent_commits": [ { "hash": "73613840a889", "subject": "workqueue: Clear worker->pool in the worker thread context" }, { "hash": "98cc1730c894", "subject": "workqueue: Remove incorrect \"WARN_ON_ONCE(!list_empty(&worker->entry));\" from dying worker" }, { "hash": "b02c520fee63", "subject": "Merge tag 'wq-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq" }, { "hash": "f4b7b53c94af", "subject": "workqueue: Detach workers directly in idle_cull_fn()" }, { "hash": "68f83057b913", "subject": "workqueue: Reap workers via kthread_stop() and remove detach_completion" }, { "hash": "2a1b02bcba78", "subject": "workqueue: Refactor worker ID formatting and make wq_worker_comm() use full ID string" }, { "hash": "873eaca6eaf8", "subject": "workqueue: Factor out work to worker assignment and collision handling" }, { "hash": "c0ab017d43f4", "subject": "workqueue: Cleanups around process_scheduled_works()" }, { "hash": "e02b93124855", "subject": "workqueue: Unbind kworkers before sending them to exit()" }, { "hash": "e441b56fe438", "subject": "workqueue: Replace deprecated ida_simple_*() with ida_alloc()/ida_free()" } ] }, { "index": 8, "function": "kthread", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8190ae58", "address_formatted": "0xffffffff8190ae58 (0xffffffff8190aad0 + 0x388)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8190ae57", "source": { "primary": { "function": "kthread", "file": "kernel/kthread.c", "line": 436 }, "inlined_frames": [] }, "function_source": { "file": "kernel/kthread.c", "start_line": 379, "end_line": 439, "code": "\nstatic int kthread(void *_create)\n{\n static const struct sched_param param = { .sched_priority = 0 };\n /* Copy data: it's on kthread's stack */\n struct kthread_create_info *create = _create;\n int (*threadfn)(void *data) = create->threadfn;\n void *data = create->data;\n struct completion *done;\n struct kthread *self;\n int ret;\n\n self = to_kthread(current);\n\n /* Release the structure when caller killed by a fatal signal. */\n done = xchg(&create->done, NULL);\n if (!done) {\n kfree(create->full_name);\n kfree(create);\n kthread_exit(-EINTR);\n }\n\n self->full_name = create->full_name;\n self->threadfn = threadfn;\n self->data = data;\n\n /*\n * The new thread inherited kthreadd's priority and CPU mask. Reset\n * back to default in case they have been changed.\n */\n sched_setscheduler_nocheck(current, SCHED_NORMAL, ¶m);\n\n /* OK, tell user we're spawned, wait for stop or wakeup */\n __set_current_state(TASK_UNINTERRUPTIBLE);\n create->result = current;\n /*\n * Thread is going to call schedule(), do not preempt it,\n * or the creator may spend more time in wait_task_inactive().\n */\n preempt_disable();\n complete(done);\n schedule_preempt_disabled();\n preempt_enable();\n\n self->started = 1;\n\n /*\n * Apply default node affinity if no call to kthread_bind[_mask]() nor\n * kthread_affine_preferred() was issued before the first wake-up.\n */\n if (!(current->flags & PF_NO_SETAFFINITY) && !self->preferred_affinity)\n kthread_affine_node();\n\n ret = -EINTR;\n if (!test_bit(KTHREAD_SHOULD_STOP, &self->flags)) {\n cgroup_kthread_ready();\n __kthread_parkme(self);\n ret = threadfn(data);\n }\n kthread_exit(ret);\n}\n" }, "git_blame_hashes": [ "00b89fe0197f0c55a045775c11553c0cdb7082fe", "1a7243ca4074beed97b68d7235a6e34862fc2cd6", "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "1da5c46fa965ff90f5ffc080b6ab3fae5e227bc3", "26c7295be0c5e6da3fa45970e9748be983175b1b", "2a1d446019f9a5983ec5a335b95e8593fdb6fa2e", "3217ab97f14c5c8f9f975ed8c40c351164b0b10e", "4d13f4304fa43471bfea101658a11feec7b28ac0", "52782c92ac85c4e393eb4a903a62e6c24afa633f", "5eacb68a358503cb350eaf68599a0d6caef569ab", "60ba9c38b9316efa3eb1c8a927bee6f8a4f101a5", "63706172f332fd3f6e7458ebfb35fa6de9c21dc5", "73c279927f89561ecb45b2dfdf9314bafcfd9f67", "73e0c116594d99f807754b15e474690635a87249", "77f88796cee819b9c4562b0b6b44691b3b7755b1", "786235eeba0e1e85e5cbbb9f97d1087ad03dfa21", "a076e4bca2fdabb9e45d86722cc72c0944da5f94", "bbda86e988d4c124e4cfa816291cbd583ae8bfb1", "d1a89197589c4a77468298ef2b14ff4084c4ea29", "d25c83c6606ffc3abdf0868136ad3399f648ad70" ], "recent_commits": [ { "hash": "60ba9c38b931", "subject": "kthread: Comment on the purpose and placement of kthread_affine_node() call" }, { "hash": "4d13f4304fa4", "subject": "kthread: Implement preferred affinity" }, { "hash": "d1a89197589c", "subject": "kthread: Default affine kthread to its preferred NUMA node" }, { "hash": "5eacb68a3585", "subject": "kthread: Make sure kthread hasn't started while binding it" }, { "hash": "73e0c116594d", "subject": "kthread: Pass in the thread's name during creation" }, { "hash": "d25c83c6606f", "subject": "kthread: make it clear that kthread_create_on_node() might be terminated by any fatal signal" }, { "hash": "04d4e665a609", "subject": "sched/isolation: Use single feature type while referring to housekeeping cpumask" }, { "hash": "40966e316f86", "subject": "kthread: Ensure struct kthread is present for all kthreads" }, { "hash": "bbda86e988d4", "subject": "exit: Implement kthread_exit" }, { "hash": "1a7243ca4074", "subject": "kthread: Move prio/affinite change into the newly created thread" } ] }, { "index": 9, "function": "ret_from_fork", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff816bfae4", "address_formatted": "0xffffffff816bfae4 (0xffffffff816bf5d0 + 0x514)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff816bfae3", "source": { "primary": { "function": "ret_from_fork", "file": "arch/x86/kernel/process.c", "line": 158 }, "inlined_frames": [] }, "function_source": { "file": "arch/x86/kernel/process.c", "start_line": 150, "end_line": 168, "code": "\n__visible void ret_from_fork(struct task_struct *prev, struct pt_regs *regs,\n int (*fn)(void *), void *fn_arg)\n{\n schedule_tail(prev);\n\n /* Is this a kernel thread? */\n if (unlikely(fn)) {\n fn(fn_arg);\n /*\n * A kernel thread is allowed to return here after successfully\n * calling kernel_execve(). Exit to userspace to complete the\n * execve() syscall.\n */\n regs->ax = 0;\n }\n\n syscall_exit_to_user_mode(regs);\n}\n" }, "git_blame_hashes": [ "2fff071d28b54f050f62654dad4ec111b8416d8e", "3aec4ecb3d1f313a8ab985df7cab07c4af81f478" ], "recent_commits": [ { "hash": "3aec4ecb3d1f", "subject": "x86: Rewrite ret_from_fork() in C" }, { "hash": "2fff071d28b5", "subject": "x86/process: Unify copy_thread_tls()" } ] }, { "index": 10, "function": "ret_from_fork_asm", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff813370aa", "address_formatted": "0xffffffff813370aa (0xffffffff81337090 + 0x1a)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff813370a9", "source": { "primary": { "function": "ret_from_fork_asm", "file": "arch/x86/entry/entry_64.S", "line": 245 }, "inlined_frames": [] }, "function_source": { "file": "arch/x86/entry/entry_64.S", "start_line": 205, "end_line": 305, "code": " */\n FILL_RETURN_BUFFER %r12, RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW\n\n /* restore callee-saved registers */\n popq %r15\n popq %r14\n popq %r13\n popq %r12\n popq %rbx\n popq %rbp\n\n jmp __switch_to\nSYM_FUNC_END(__switch_to_asm)\n.popsection\n\n/*\n * A newly forked process directly context switches into this address.\n *\n * rax: prev task we switched from\n * rbx: kernel thread func (NULL for user thread)\n * r12: kernel thread arg\n */\n.pushsection .text, \"ax\"\nSYM_CODE_START(ret_from_fork_asm)\n /*\n * This is the start of the kernel stack; even through there's a\n * register set at the top, the regset isn't necessarily coherent\n * (consider kthreads) and one cannot unwind further.\n *\n * This ensures stack unwinds of kernel threads terminate in a known\n * good state.\n */\n UNWIND_HINT_END_OF_STACK\n ANNOTATE_NOENDBR // copy_thread\n CALL_DEPTH_ACCOUNT\n\n movq %rax, %rdi /* prev */\n movq %rsp, %rsi /* regs */\n movq %rbx, %rdx /* fn */\n movq %r12, %rcx /* fn_arg */\n call ret_from_fork\n\n /*\n * Set the stack state to what is expected for the target function\n * -- at this point the register set should be a valid user set\n * and unwind should work normally.\n */\n UNWIND_HINT_REGS\n\n#ifdef CONFIG_X86_FRED\n ALTERNATIVE \"jmp swapgs_restore_regs_and_return_to_usermode\", \\\n \"jmp asm_fred_exit_user\", X86_FEATURE_FRED\n#else\n jmp swapgs_restore_regs_and_return_to_usermode\n#endif\nSYM_CODE_END(ret_from_fork_asm)\n.popsection\n\n.macro DEBUG_ENTRY_ASSERT_IRQS_OFF\n#ifdef CONFIG_DEBUG_ENTRY\n pushq %rax\n SAVE_FLAGS\n testl $X86_EFLAGS_IF, %eax\n jz .Lokay_\\@\n ud2\n.Lokay_\\@:\n popq %rax\n#endif\n.endm\n\nSYM_CODE_START(xen_error_entry)\n ANNOTATE_NOENDBR\n UNWIND_HINT_FUNC\n PUSH_AND_CLEAR_REGS save_ret=1\n ENCODE_FRAME_POINTER 8\n UNTRAIN_RET_FROM_CALL\n RET\nSYM_CODE_END(xen_error_entry)\n\n/**\n * idtentry_body - Macro to emit code calling the C function\n * @cfunc: C function to be called\n * @has_error_code: Hardware pushed error code on stack\n */\n.macro idtentry_body cfunc has_error_code:req\n\n /*\n * Call error_entry() and switch to the task stack if from userspace.\n *\n * When in XENPV, it is already in the task stack, and it can't fault\n * for native_iret() nor native_load_gs_index() since XENPV uses its\n * own pvops for IRET and load_gs_index(). And it doesn't need to\n * switch the CR3. So it can skip invoking error_entry().\n */\n ALTERNATIVE \"call error_entry; movq %rax, %rsp\", \\\n \"call xen_error_entry\", X86_FEATURE_XENPV\n\n ENCODE_FRAME_POINTER\n UNWIND_HINT_REGS\n\n movq %rsp, %rdi /* pt_regs pointer into 1st argument*/\n" }, "git_blame_hashes": [ "0100301bfdf56a2a370c7157b5ab0fbf9313e1cd", "1d3e53e8624a3ec85f4041ca6d973da7c1575938", "1eeb207f870f746a863e5c59321d837d2d91c218", "2c08b9b38f5b0f4a6c2d29be22b695e4ec4a556b", "2e7e5bbb1c3c8d502edeb5c0670eac4995134b6f", "3aec4ecb3d1f313a8ab985df7cab07c4af81f478", "3e3f069504344c241f89737e4af014f83fca0b27", "51ef2a4da7ec347e3315af69a426ac36fab98a6c", "520a7e80c96d655fbe4650d9cc985bd9d0443389", "5d8213864ade86b48fc492584ea86d65a62f892e", "616d24835eeafa8ef3466479db028abfdfc77531", "64cbd0acb58203fb769ed2f4eab526d43e243847", "8a055d7f411d41755ce30db5bb65b154777c4b78", "96c64806b4bf35f5edb465cafa6cec490e424a30", "b9f6976bfb949121bb6e1e6f4fd9909735729148", "c22cf380c79c4bb0e502b0343f57271b17626424", "c995efd5a740d9cbafbf58bde4973e8b50b4d761", "cfa82a00533f7074011a3a49fbb6ed1b1f6fa010", "d147553b64bad34d2f92cb7d8ba454ae95c3baac", "d1c99108af3c5992640aa2afa7d2e88c3775c06e", "e17f8234538d1ff708673f287a42457c4dee720d", "e2dcb5f1390715244aec12dbd6f294863ca37b88", "fafe5e74229fd3f425e3cbfc68b90e615aa6d62f" ], "recent_commits": [ { "hash": "51ef2a4da7ec", "subject": "x86/fred: Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled" }, { "hash": "2e7e5bbb1c3c", "subject": "x86: Fix kthread unwind" }, { "hash": "3aec4ecb3d1f", "subject": "x86: Rewrite ret_from_fork() in C" }, { "hash": "fb799447ae29", "subject": "x86,objtool: Split UNWIND_HINT_EMPTY in two" }, { "hash": "5d8213864ade", "subject": "x86/retbleed: Add SKL return thunk" }, { "hash": "c22cf380c79c", "subject": "x86/entry: Make some entry symbols global" }, { "hash": "67e93ddd5d0b", "subject": "x86/entry: Align SYM_CODE_START() variants" }, { "hash": "2c08b9b38f5b", "subject": "x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry" }, { "hash": "b2620facef48", "subject": "x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n" }, { "hash": "d147553b64ba", "subject": "x86/xen: Add UNTRAIN_RET" } ] } ] }