[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAGO-9moQrepikUk198XjgiE=hC2W6u_Wsup8yK=ooBfPNg1PfQ@mail.gmail.com>
Date: Fri, 30 May 2014 10:57:08 +0800
From: yang ben <benyangfsl@...il.com>
To: linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Ask for help on the memory allocation for process shared mutex
(resend with plain text)
Dear experts,
I came across a memory/mutex issue. Would you kindly shed some light on it?
I use pthread_mutex_xxx API to protect processes in user space. Since
it should be process shared, I allocated a shared memory to store
pthread_mutex_t structure.
The shared memory is allocated using vmalloc_user() and mapped using
remap_vmalloc_range() in driver. However, get_futex_key() will always
return -EFAULT, because page_head->mapping==0.
futex.c (Linux-3.10.31)
if (!page_head->mapping) {
int shmem_swizzled = PageSwapCache(page_head);
unlock_page(page_head);
put_page(page_head);
if (shmem_swizzled)
goto again;
return -EFAULT;
}
Is there special requirement on the memory to store mutex? What's the
correct way to allocate such memory in driver?
Thanks in advance!
Regards,
Ben
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists