+ fix-__pfn_to_pagepfn-for-config_discontigmem=y.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Fix __pfn_to_page(pfn) for CONFIG_DISCONTIGMEM=y
has been added to the -mm tree.  Its filename is
     fix-__pfn_to_pagepfn-for-config_discontigmem=y.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: Fix __pfn_to_page(pfn) for CONFIG_DISCONTIGMEM=y
From: Rafael J. Wysocki <rjw@xxxxxxx>

Fix macro __pfn_to_page(pfn) so that it doesn't evaluate its argument
twice in the CONFIG_DISCONTIGMEM=y case, because 'pfn' may be a result of
a funtion call having side effects.

For example, the hibernation code applies pfn_to_page(pfn) to the result
of a function returning the pfn corresponding to the next set bit in a
bitmap and the current bit position is modified on each call.  This leads
to "interesting" failures for CONFIG_DISCONTIGMEM=y due to the current
behavior of __pfn_to_page(pfn).

Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
Acked-by: Pavel Machek <pavel@xxxxxxx>
Cc: <stable@xxxxxxxxxx>		[2.6.27.x]
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/asm-generic/memory_model.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN include/asm-generic/memory_model.h~fix-__pfn_to_pagepfn-for-config_discontigmem=y include/asm-generic/memory_model.h
--- a/include/asm-generic/memory_model.h~fix-__pfn_to_pagepfn-for-config_discontigmem=y
+++ a/include/asm-generic/memory_model.h
@@ -34,7 +34,7 @@
 
 #define __pfn_to_page(pfn)			\
 ({	unsigned long __pfn = (pfn);		\
-	unsigned long __nid = arch_pfn_to_nid(pfn);  \
+	unsigned long __nid = arch_pfn_to_nid(__pfn);  \
 	NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\
 })
 
_

Patches currently in -mm which might be from rjw@xxxxxxx are

fix-__pfn_to_pagepfn-for-config_discontigmem=y.patch
linux-next.patch
e1000e-use-device_set_wakeup_enable.patch
e1000-use-device_set_wakeup_enable.patch
igb-use-device_set_wakeup_enable.patch
shrink_slab-handle-bad-shrinkers.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux