[lkml]   [2007]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] mm: remove global locks from mm/highmem.c
Andrew Morton wrote:
> On Sun, 28 Jan 2007 15:11:34 +0100
> Peter Zijlstra <> wrote:

>>+static inline int set_page_address(struct page *page, void *address)
>>+ if (address)
>>+ return cmpxchg(&page->virtual, NULL, address) == NULL;
>>+ else {
>>+ /*
>>+ * cmpxchg is a bit abused because it is not guaranteed
>>+ * safe wrt direct assignment on all platforms.
>>+ */
>>+ void *virt = page->virtual;
>>+ return cmpxchg(&page->vitrual, virt, NULL) == virt;
>>+ }
> Have you verified that all architectures which can implement
> WANT_PAGE_VIRTUAL also implement cmpxchg?

Simple: we should not implement cmpxchg in generic code. We should
be able to use atomic_long_cmpxchg for this -- it will work perfectly
regardless of what anybody else tells you.

cmpxchg is only required for when that memory location may get modified
by some other means than under your control (eg. userspace, in the case
of drm, or hardware MMU in the case of Christoph's old page fault
scalability patches).

SUSE Labs, Novell Inc.
Send instant messages to your online friends

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-01-29 03:55    [W:0.071 / U:33.404 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site