Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753362Ab0ARCUk (ORCPT ); Sun, 17 Jan 2010 21:20:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752748Ab0ARCUj (ORCPT ); Sun, 17 Jan 2010 21:20:39 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:55671 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281Ab0ARCUi (ORCPT ); Sun, 17 Jan 2010 21:20:38 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: "Rafael J. Wysocki" Subject: Re: [linux-pm] [RFC][PATCH] PM: Force GFP_NOIO during suspend/resume (was: Re: Memory allocations in .suspend became very unreliable) Cc: kosaki.motohiro@jp.fujitsu.com, Minchan Kim , Maxim Levitsky , "linux-mm" , linux-pm@lists.linux-foundation.org, LKML , Andrew Morton In-Reply-To: <201001180125.59413.rjw@sisk.pl> References: <1263745267.2162.42.camel@barrios-desktop> <201001180125.59413.rjw@sisk.pl> Message-Id: <20100118111703.AE36.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Mon, 18 Jan 2010 11:20:28 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1234 Lines: 31 > Index: linux-2.6/mm/page_alloc.c > =================================================================== > --- linux-2.6.orig/mm/page_alloc.c > +++ linux-2.6/mm/page_alloc.c > @@ -1963,10 +1963,13 @@ __alloc_pages_nodemask(gfp_t gfp_mask, u > page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order, > zonelist, high_zoneidx, ALLOC_WMARK_LOW|ALLOC_CPUSET, > preferred_zone, migratetype); > - if (unlikely(!page)) > + if (unlikely(!page)) { > + mm_lock_suspend(gfp_mask); > page = __alloc_pages_slowpath(gfp_mask, order, > zonelist, high_zoneidx, nodemask, > preferred_zone, migratetype); > + mm_unlock_suspend(gfp_mask); > + } > > trace_mm_page_alloc(page, order, gfp_mask, migratetype); > return page; I think we don't need read side lock at all. generally, no lock might makes race. But in this case, changing gfp_allowed_mask and nvidia suspend method should be serialized higher level. Why the above two code need to run concurrently? -- 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/