by Anonymous » 31 Aug 2025, 11:18
Ich habe den folgenden Code, um zu verfolgen, welcher Prozess aufweckt, welcher Prozess in __pollwake < /p>
aufweckt.
Code: Select all
linux kernel 6.6.6x
/fs/select.c:
static int __pollwake(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
{
struct poll_wqueues *pwq = wait->private;
DECLARE_WAITQUEUE(dummy_wait, pwq->polling_task);
/*
* Although this function is called under waitqueue lock, LOCK
* doesn't imply write barrier and the users expect write
* barrier semantics on wakeup functions. The following
* smp_wmb() is equivalent to smp_wmb() in try_to_wake_up()
* and is paired with smp_store_mb() in poll_schedule_timeout.
*/
smp_wmb();
pwq->triggered = 1;
/*
* Perform the default wake up operation using a dummy
* waitqueue.
*
* TODO: This is hacky but there currently is no interface to
* pass in @sync. @sync is scheduled to be removed and once
* that happens, wake_up_process() can be used directly.
*/
if (wait->private && (wait->func == pollwake) && (pwq->polling_task) && strstr(pwq->polling_task->comm, "process1") != 0) {
pwqLWB = pwq;
pr_info("LWB %s:%d__pollwake: waking task current: %s (pid %d)\n", __func__, __LINE__, current->pid, current->comm);
WARN_ON(!pwq || !pwq->polling_task); pr_info("LWB DONE %s \n", pwq->polling_task->comm); polling_task->comm,
// pwq->polling_task->pid,
// pwq->error);
}
int rtn = default_wake_function(&dummy_wait, mode, sync, key);
if (wait->private && (wait->func == pollwake) && (pwq->polling_task) && strstr(pwq->polling_task->comm, "process1") != 0) {
pr_info("LWB %s:%d__pollwake: waking task current: %s (pid %d)\n", __func__, __LINE__,
current->pid, current->comm);
WARN_ON(!pwq || !pwq->polling_task); pr_info("LWB DONE %s\n", pwq->polling_task->comm);
//pr_info("LWB %s:%d__pollwake DONE: waking task poll_task: %s (pid %d) error:%d\n", __func__, __LINE__,
// pwq->polling_task->comm,
// pwq->polling_task->pid,
// pwq->error);
}
return rtn;
}
< /code>
Und es stürzt hier ab:
pr_info("LWB DONE %s \n", pwq->polling_task->comm);
Hier ist die Absturzspur:
Code: Select all
pstate: 000000c5 (nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : string_nocheck+0x3c/0x70
lr : string+0x54/0x68
sp : ffff800082cc38a0
x29: ffff800082cc38a0 x28: ffff800082cc3a65 x27: ffff800080e8e126
x26: ffff800080e8e126 x25: 0000000000000020 x24: 0000000000000008
x23: 00000000ffffffe0 x22: ffff800080ca2ff8 x21: ffff0a00ffffff04
x20: 0000000000001083 x19: ffff800082cc3a38 x18: 00000000fffffffc
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000001
x14: ffffffffffffffff x13: ffff800082cc3a38 x12: ffff800082cc3a41
x11: 0000000000000000 x10: ffff800082cc3c10 x9 : 00000000fffffffe
x8 : ffff800082cc3a38 x7 : 000000000000000a x6 : 0000000000000002
x5 : 0000000000000002 x4 : 0000000000000000 x3 : ffff0a00ffffff04
x2 : 0000000000001083 x1 : ffff800082cc3a38 x0 : ffff800082cc3a65
Call trace:
string_nocheck+0x3c/0x70
string+0x54/0x68
vsnprintf+0x178/0x738
vprintk_store+0xd8/0x428
vprintk_emit+0x80/0x2b8
vprintk_default+0x3c/0x50
vprintk+0x94/0x100
_printk+0x50/0x60
pollwake+0x180/0x1c0
__wake_up_common+0x9c/0x190
__wake_up_locked_key+0x24/0x38
eventfd_write+0xb0/0x1b8
vfs_write+0xe0/0x458
ksys_write+0x5c/0xe0
__arm64_sys_write+0x20/0x30
el0_svc_common.constprop.0+0x60/0x138
do_el0_svc+0x20/0x30
el0_svc+0x24/0x98
el0t_64_sync_handler+0xb8/0xc0
el0t_64_sync+0x14c/0x150
< /code>
Was ich Problemen habestrstr(pwq->polling_task->comm, "process1")
und es stürzte nicht ab und es stürzte vor, wenn ich die Zeichenfolge ausdrucken ...
Kann jemand bitte erklären, was mir fehlt?
Ich habe den folgenden Code, um zu verfolgen, welcher Prozess aufweckt, welcher Prozess in __pollwake < /p>
aufweckt.[code]linux kernel 6.6.6x
/fs/select.c:
static int __pollwake(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
{
struct poll_wqueues *pwq = wait->private;
DECLARE_WAITQUEUE(dummy_wait, pwq->polling_task);
/*
* Although this function is called under waitqueue lock, LOCK
* doesn't imply write barrier and the users expect write
* barrier semantics on wakeup functions. The following
* smp_wmb() is equivalent to smp_wmb() in try_to_wake_up()
* and is paired with smp_store_mb() in poll_schedule_timeout.
*/
smp_wmb();
pwq->triggered = 1;
/*
* Perform the default wake up operation using a dummy
* waitqueue.
*
* TODO: This is hacky but there currently is no interface to
* pass in @sync. @sync is scheduled to be removed and once
* that happens, wake_up_process() can be used directly.
*/
if (wait->private && (wait->func == pollwake) && (pwq->polling_task) && strstr(pwq->polling_task->comm, "process1") != 0) {
pwqLWB = pwq;
pr_info("LWB %s:%d__pollwake: waking task current: %s (pid %d)\n", __func__, __LINE__, current->pid, current->comm);
WARN_ON(!pwq || !pwq->polling_task); pr_info("LWB DONE %s \n", pwq->polling_task->comm); polling_task->comm,
// pwq->polling_task->pid,
// pwq->error);
}
int rtn = default_wake_function(&dummy_wait, mode, sync, key);
if (wait->private && (wait->func == pollwake) && (pwq->polling_task) && strstr(pwq->polling_task->comm, "process1") != 0) {
pr_info("LWB %s:%d__pollwake: waking task current: %s (pid %d)\n", __func__, __LINE__,
current->pid, current->comm);
WARN_ON(!pwq || !pwq->polling_task); pr_info("LWB DONE %s\n", pwq->polling_task->comm);
//pr_info("LWB %s:%d__pollwake DONE: waking task poll_task: %s (pid %d) error:%d\n", __func__, __LINE__,
// pwq->polling_task->comm,
// pwq->polling_task->pid,
// pwq->error);
}
return rtn;
}
< /code>
Und es stürzt hier ab:
pr_info("LWB DONE %s \n", pwq->polling_task->comm);[/code]
Hier ist die Absturzspur:
[code]pstate: 000000c5 (nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : string_nocheck+0x3c/0x70
lr : string+0x54/0x68
sp : ffff800082cc38a0
x29: ffff800082cc38a0 x28: ffff800082cc3a65 x27: ffff800080e8e126
x26: ffff800080e8e126 x25: 0000000000000020 x24: 0000000000000008
x23: 00000000ffffffe0 x22: ffff800080ca2ff8 x21: ffff0a00ffffff04
x20: 0000000000001083 x19: ffff800082cc3a38 x18: 00000000fffffffc
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000001
x14: ffffffffffffffff x13: ffff800082cc3a38 x12: ffff800082cc3a41
x11: 0000000000000000 x10: ffff800082cc3c10 x9 : 00000000fffffffe
x8 : ffff800082cc3a38 x7 : 000000000000000a x6 : 0000000000000002
x5 : 0000000000000002 x4 : 0000000000000000 x3 : ffff0a00ffffff04
x2 : 0000000000001083 x1 : ffff800082cc3a38 x0 : ffff800082cc3a65
Call trace:
string_nocheck+0x3c/0x70
string+0x54/0x68
vsnprintf+0x178/0x738
vprintk_store+0xd8/0x428
vprintk_emit+0x80/0x2b8
vprintk_default+0x3c/0x50
vprintk+0x94/0x100
_printk+0x50/0x60
pollwake+0x180/0x1c0
__wake_up_common+0x9c/0x190
__wake_up_locked_key+0x24/0x38
eventfd_write+0xb0/0x1b8
vfs_write+0xe0/0x458
ksys_write+0x5c/0xe0
__arm64_sys_write+0x20/0x30
el0_svc_common.constprop.0+0x60/0x138
do_el0_svc+0x20/0x30
el0_svc+0x24/0x98
el0t_64_sync_handler+0xb8/0xc0
el0t_64_sync+0x14c/0x150
< /code>
Was ich Problemen habestrstr(pwq->polling_task->comm, "process1")[/code] und es stürzte nicht ab und es stürzte vor, wenn ich die Zeichenfolge ausdrucken ...
Kann jemand bitte erklären, was mir fehlt?