linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Pavel Machek <pavel@ucw.cz>,
	Christoph Lameter <clameter@engr.sgi.com>,
	linux-mm@kvack.org, pm list <linux-pm@lists.osdl.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [RFC][PATCH 2/3] swsusp: Do not use page flags
Date: Wed, 14 Mar 2007 09:30:04 +0100	[thread overview]
Message-ID: <200703140930.05359.rjw@sisk.pl> (raw)
In-Reply-To: <45F7692D.3010709@yahoo.com.au>

On Wednesday, 14 March 2007 04:17, Nick Piggin wrote:
> Rafael J. Wysocki wrote:
> > 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?
> 
> Probably is the keyword.
> 
> Why would you *not* make this a sane API? Surely performance isn't the
> reason? Nor complexity.
> 
> > 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.
> 
> 
> But defining good APIs is a very good thing. And with my good API, the
> lock is not unneeded.
> 
> >>>>But that's because you even use mark_nosave_pages in your implementation.
> >>>>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 save us
> >>>much.
> >>
> >>Well I think it is a cleaner though.
> > 
> > 
> > This is a matter of opinion, too ...
> 
> 
> Well, as I'm not volunteering to maintain swsusp, if your opinion is that
> your way is cleaner, I can't argue ;) So long as it stops wasting those page
> flags then I'm happy.
> 
> However the register_nosave API really should use locking, I think. There
> is absolutely no downside, AFAIKS.

Hm, I can add the lock, but currently register_nosave_region() calls
alloc_bootmem_low() directly, which means it won't even work outside the
early initialization code which is single-threaded.  For this reason I think
that the locking can be added later, when register_nosave_region() is
extended so that it can be called from other contexts too.

Greetings,
Rafael

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-03-14  8:30 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-16 10:13 Remove page flags for software suspend Christoph Lameter
2007-02-16 10:56 ` Rafael J. Wysocki
2007-02-28 10:14   ` Pavel Machek
2007-02-28 15:25     ` Christoph Lameter
2007-02-28 17:13       ` Rafael J. Wysocki
2007-02-28 17:17         ` Christoph Lameter
2007-02-28 17:33           ` Rafael J. Wysocki
2007-02-28 17:35             ` Christoph Lameter
2007-02-28 17:51               ` Rafael J. Wysocki
2007-02-28 17:56                 ` Christoph Lameter
2007-02-28 21:11                   ` Pavel Machek
2007-03-01  2:35           ` Nick Piggin
2007-03-01 15:18         ` Nick Piggin
2007-03-01 15:33           ` Rafael J. Wysocki
2007-03-01 23:10             ` Rafael J. Wysocki
2007-03-04 13:50             ` [RFC][PATCH 0/3] swsusp: Do not use page flags (was: Re: Remove page flags for software suspend) Rafael J. Wysocki
2007-03-04 14:07               ` [RFC][PATCH 1/3] swsusp: Do not use page flags directly Rafael J. Wysocki
2007-03-13  4:45                 ` Nick Piggin
2007-03-04 14:07               ` [RFC][PATCH 2/3] swsusp: Do not use page flags Rafael J. Wysocki
2007-03-13  4:47                 ` Nick Piggin
2007-03-13  9:16                   ` Rafael J. Wysocki
2007-03-13  9:23                     ` Nick Piggin
2007-03-13 10:17                       ` Rafael J. Wysocki
2007-03-13 10:31                         ` Nick Piggin
2007-03-13 21:20                           ` Rafael J. Wysocki
2007-03-14  3:17                             ` Nick Piggin
2007-03-14  8:30                               ` Rafael J. Wysocki [this message]
2007-03-04 14:08               ` [RFC][PATCH 3/3] mm: Remove nosave and nosave_free " Rafael J. Wysocki
2007-03-08  1:00               ` [RFC][PATCH 0/3] swsusp: Do not use page flags (was: Re: Remove page flags for software suspend) Johannes Berg
2007-03-08 22:05                 ` Rafael J. Wysocki
2007-03-08 22:10                   ` Johannes Berg
2007-03-08 22:33                     ` Rafael J. Wysocki
2007-03-08 22:43                       ` Johannes Berg
2007-03-08 22:54                         ` Rafael J. Wysocki
2007-03-08 22:54                           ` Johannes Berg
2007-03-08 23:15                   ` Pavel Machek
2007-03-08 23:21                     ` Johannes Berg
2007-03-08 23:23                       ` Pavel Machek
2007-03-08 23:34                       ` Rafael J. Wysocki
2007-03-08 23:36                         ` Pavel Machek
2007-03-08 15:09               ` Johannes Berg
2007-03-08 22:10                 ` Rafael J. Wysocki
2007-03-08 22:12                   ` Johannes Berg
2007-03-08 15:53               ` Peter Zijlstra
2007-03-08 22:11                 ` Rafael J. Wysocki
2007-03-01 17:48           ` Remove page flags for software suspend Hugh Dickins
2007-03-13  3:36             ` Nick Piggin
2007-03-01 20:46           ` Rafael J. Wysocki
2007-03-02 10:17             ` Pavel Machek
2007-02-28 21:08       ` Pavel Machek
2007-02-28 21:16         ` Christoph Lameter
2007-02-28 21:22           ` Pavel Machek
2007-02-28 22:23             ` Rafael J. Wysocki
2007-03-01  2:31         ` Nick Piggin
2007-02-28 10:14   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703140930.05359.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=a.p.zijlstra@chello.nl \
    --cc=clameter@engr.sgi.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).