Thread (22 messages) 22 messages, 6 authors, 2016-12-22

Re: [RFC][PATCH] make global bitlock waitqueues per-node

From: Dave Hansen <dave.hansen@linux.intel.com>
Date: 2016-12-20 00:20:08
Also in: lkml

On 12/19/2016 03:07 PM, Linus Torvalds wrote:
    +wait_queue_head_t *bit_waitqueue(void *word, int bit)
    +{
    +       const int __maybe_unused nid = page_to_nid(virt_to_page(word));
    +
    +       return __bit_waitqueue(word, bit, nid);

No can do. Part of the problem with the old coffee was that it did that
virt_to_page() crud. That doesn't work with the virtually mapped stack. 
Ahhh, got it.

So, what did you have in mind?  Just redirect bit_waitqueue() to the
"first_online_node" waitqueues?

wait_queue_head_t *bit_waitqueue(void *word, int bit)
{
        return __bit_waitqueue(word, bit, first_online_node);
}

We could do some fancy stuff like only do virt_to_page() for things in
the linear map, but I'm not sure we'll see much of a gain for it.  None
of the other waitqueue users look as pathological as the 'struct page'
ones.  Maybe:

wait_queue_head_t *bit_waitqueue(void *word, int bit)
{
	int nid
	if (word >= VMALLOC_START) /* all addrs not in linear map */
		nid = first_online_node;
	else
		nid = page_to_nid(virt_to_page(word));
        return __bit_waitqueue(word, bit, nid);
}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help