From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [RFC][PATCH 2/3] swsusp: Do not use page flags Date: Tue, 13 Mar 2007 22:20:34 +0100 Message-ID: <200703132220.35534.rjw@sisk.pl> References: <200703131117.43818.rjw@sisk.pl> <45F67D9A.8020202@yahoo.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <45F67D9A.8020202@yahoo.com.au> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.osdl.org Errors-To: linux-pm-bounces@lists.osdl.org To: Nick Piggin Cc: linux-mm@kvack.org, Peter Zijlstra , Pavel Machek , pm list , Johannes Berg , Christoph Lameter List-Id: linux-pm@vger.kernel.org On Tuesday, 13 March 2007 11:31, Nick Piggin wrote: > Rafael J. Wysocki wrote: > > On Tuesday, 13 March 2007 10:23, Nick Piggin wrote: > > = > = > >>I wouldn't say that. You're creating an interface here that is going to= be > >>used outside swsusp. Users of that interface may not need locking now, = but > >>that could cause problems down the line. > > = > > = > > I think we can add the locking when it's necessary. For now, IMHO, it = could be > > confusing to someone who doesn't know the locking is not needed. > = > I don't know why it would confuse them. We just define the API to > guarantee the correct locking, and that means the locking _is_ needed. Even if there are no users that actually need the locking and probably never will be? For now, register_nosave_region() is to be called by architecture initialization code _only_ and there's no reason whatsoever why any architecture would need to call it concurrently from many places. > You don't have to care what the callers are doing. That's the beauty > of a sane API. Well, I don't think adding unneded infrastructure is a good thing. > >>Sure you don't _need_ an rbtree, but our implementation makes it so sim= ple > >>that there isn't much downside. > > = > > = > > Not much, but the code is more complicated. > = > But it's in its own file and has a contained API, so it is very easy > to review, test and verify. I'm still thinking that register_nosave_region() in its current form is sim= pler and easier to review than the code using rbtrees. Still, of course this on= ly is my personal opinion. :-) > >>>mark_nosave_pages() refers to a function that's invisible outside snap= shot.c > >>>and I didn't think it was a good idea to separate mark_nosave_pages() > >>>from register_nosave_region(). > >> > >>But that's because you even use mark_nosave_pages in your implementatio= n. > >>Mine uses the nosave regions directly. > > = > > = > > Well, I think we need two bits per page anyway, to mark free pages and > > pages allocated by swsusp, so using the nosave regions directly won't s= ave us > > much. > = > Well I think it is a cleaner though. This is a matter of opinion, too ... Greetings, Rafael