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>
И он сбои здесь:
pr_info("LWB DONE %s \n", pwq->polling_task->comm);
У меня есть следующий код, чтобы отслеживать, какой процесс проснется, какой процесс в __pollwake < /p> [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. */