lkml.org 
[lkml]   [2002]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: remove mixture of non-atomic operations with page->flags which requires atomic operations to access
From: William Lee Irwin III <wli@holomorphy.com>
Date: Mon, 3 Jun 2002 03:28:09 -0700
> It should be clearing it, I'd retransmit if there weren't other objections
> to address...

On Mon, Jun 03, 2002 at 02:27:39AM -0700, David S. Miller wrote:
> Such as the fact that none of these operations need to
> be atomic :-)

After looking around a little bit the unique reference guarantee
plus various memory barriers surrounding it appear to suffice. But
I'm still left quite uneasy by the usage of non-atomic operations
on an atomically updated lock word. At the very least making the
operand shifted an unsigned long is needed. So this ensues:


Cheers,
Bill

===== mm/page_alloc.c 1.63 vs edited =====
--- 1.63/mm/page_alloc.c Tue May 28 16:57:49 2002
+++ edited/mm/page_alloc.c Mon Jun 3 03:58:59 2002
@@ -110,8 +110,8 @@
BUG();
if (PageWriteback(page))
BUG();
- ClearPageDirty(page);
- page->flags &= ~(1<<PG_referenced);
+
+ page->flags &= ~((1UL << PG_referenced) | (1UL << PG_dirty));

if (current->flags & PF_FREE_PAGES)
goto local_freelist;
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.059 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site