linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Ashwin Rao <ashwin_s_rao@yahoo.com>
Cc: haveblue@us.ibm.com, linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: Atomic operation for physically moving a page (for memory defragmentation)
Date: Fri, 18 Jun 2004 23:34:06 -0400	[thread overview]
Message-ID: <200406190334.i5J3Y6D1015854@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Fri, 18 Jun 2004 20:15:36 PDT." <20040619031536.61508.qmail@web10902.mail.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]

On Fri, 18 Jun 2004 20:15:36 PDT, Ashwin Rao said:

> The problem is the memory fragmentation. The code i am
> writing is for the memory defragmentation as proposed
> by Daniel Phillips, my project partner Alok mooley has
> given mailed a simple prototype in the mid of feb.

OK.. Now we're getting somewhere. ;)  (Feel free to ignore
the rest - I'm *not* a memory management expert, but
a few thoughts come to mind - things that might help the
real experts answer the question..)

> > (*) Yes, I know the BKL isn't something you want to
> > grab if you can help it.
> 
> Isnt it a bad idea to take the BKL, the performance of
> SMP systems will drastically be hampered.

As I noted - not something you *want* to grab.  But sometimes,
especially when it's in error recovery, code may want to be able
to tell *everything* else to stay put for a moment while it figures
out what it needs to do next...

> The way we work is as follows
> Initially a block is selected which can be moved i.e
> pages on lru or free and the pages are moved to a

Out of curiosity, have you done any modeling to see how often
you need to move a page to coalesce holes and keep fragmentation
down?  The "best" solution will quite likely be vastly different if it's
something that needs to be done only as a "last resort" (i.e. order-N
allocations are failing for non-large N), or if it's something that
works best if it's being done several times a second during normal
system operation, etc....

> suitable free pages. The main problem arises during
> the copying and updation process. All the ptes are to
> updates. a method similar to try_to_unmap_one  is used
> to identify the ptes and the physical address is
> updated.

> The problem we are facing is to maintain the atomicity
> of this operation on SMP boxes.

Ahh..  Is there one thing in particular that causes the issues?
It may make sense to grab whatever lock usually controls that,
at least as a first-cut (what lock(s) are used by try_to_unmap_one,
for instance).  There's probably already a suitable lock, already
grabbed by whatever code is interfering with what your code is doing..


[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

  reply	other threads:[~2004-06-19  3:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-19  0:37 Atomic operation for physically moving a page Ashwin Rao
2004-06-19  1:03 ` Valdis.Kletnieks
2004-06-19  2:53   ` Dave Hansen
2004-06-19  3:15   ` Atomic operation for physically moving a page (for memory defragmentation) Ashwin Rao
2004-06-19  3:34     ` Valdis.Kletnieks [this message]
2004-06-19  4:25     ` Dave Hansen
2004-06-23  9:04       ` IWAMOTO Toshihiro
2004-06-23 11:59       ` Hirokazu Takahashi
2004-06-23 20:56         ` Dave Hansen
2004-06-24  7:19           ` IWAMOTO Toshihiro
2004-06-24 11:31             ` Dave Hansen
2004-06-23 10:32     ` Hirokazu Takahashi
2004-06-19  2:43 ` Atomic operation for physically moving a page Dave Hansen

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=200406190334.i5J3Y6D1015854@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=ashwin_s_rao@yahoo.com \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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