Re: [patch] 'virtual => physical page mapping cache', vcache-2.5.38-B8

Linus Torvalds (torvalds@transmeta.com)
Fri, 27 Sep 2002 10:32:04 -0700 (PDT)


On Fri, 27 Sep 2002, Ingo Molnar wrote:
>
> the problem is that we want to catch all COW events of the virtual
> address, *and* we want to have a correct (physpage,offset) futex hash.

So?

spin_lock(&futex_lock);

> q.page = NULL;
> attach_vcache(&q.vcache, uaddr, current->mm, futex_vcache_callback);
>
> page = pin_page(uaddr - offset);
> ret = IS_ERR(page);
> if (ret)
> goto out;
> head = hash_futex(page, offset);
> set_current_state(TASK_INTERRUPTIBLE);
> init_waitqueue_head(&q.waiters);
> add_wait_queue(&q.waiters, &wait);
> queue_me(head, &q, page, offset, -1, NULL, uaddr);

spin_unlock(&futex_lock);

And get the futex_lock in the callback.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/