RE: condvar wakeups

"Perez-Gonzalez, Inaky" <[email protected]>
Newsgroups gmane.comp.lib.phil
Message-ID <[email protected]>
> From: Ingo Molnar [mailto:[email protected]]
> 
> here's the latest futex-requeue kernel patch, against 2.5.69. I fixed the
>
> ...
> +			if (++ret <= num) {
> +				wake_up_all_sync(&this->waiters);
> +				if (this->filp)
> +					send_sigio(&this->filp->f_owner,
this->fd, POLL_IN);
> +			} else {
> +				list_add_tail(i, head2);
> +				__attach_vcache(&this->vcache, uaddr2,
current->mm, futex_vcache_callback);
> +				this->offset = offset2;
> +				this->page = page2;
> +			}
> +		}
> +	}
> +
> +	unlock_futex_mm();
> +
> +	unpin_page(page1);
> +	unpin_page(page2);

Call me pedantic, please, but if we are attaching so many waiters 
to a new page, shall not we unpin q->page before requeuing, then
pin that new page once per waiter and then at the tail of futex_wait() 
unpin q->page?

Unless I am missing anything, once we exit from requeue(), page2 is
not pinned by anyone, so it could be perfectly be taken out to swap
space for a walk.

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.