From: Ray Bryant <raybry@sgi.com>
To: Andi Kleen <ak@suse.de>
Cc: Paul Jackson <pj@sgi.com>,
ak@muc.de, raybry@austin.rr.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Dave Hansen <haveblue@us.ibm.com>,
Jack Steiner <steiner@sgi.com>
Subject: Re: [RFC 2.6.11-rc2-mm2 0/7] mm: manual page migration -- overview II
Date: Tue, 22 Feb 2005 16:04:43 -0600 [thread overview]
Message-ID: <421BAC7B.4030100@sgi.com> (raw)
In-Reply-To: <20050222180122.GO23433@wotan.suse.de>
Andi Kleen wrote:
>>OK, so what is the alternative? Well, if we had a va_start and
>>va_end (or a va_start and length) we could move the shared object
>>once using a call of the form
>>
>> migrate_pages(pid, va_start, va_end, count, old_node_list,
>> new_node_list);
>>
>>with old_node_list = 0 1 2 ... 31
>> new_node_list = 2 3 4 ... 33
>>
>>for one of the pid's in the job.
>
>
> I still don't like it. It would be bad to make migrate_pages another
> ptrace() [and ptrace at least really enforces a stopped process]
>
> But I can see your point that migration DEFAULT pages with first touch
> aware applications pretty much needs the old_node, new_node lists.
> I just don't think an external process should mess with other processes
> VA. But I can see that it makes sense to do this on SHM that
> is mapped into a management process.
>
> How about you add the va_start, va_end but only accept them
> when pid is 0 (= current process). Otherwise enforce with EINVAL
> that they are both 0. This way you could map the
> shared object into the batch manager, migrate it there, then
> mark it somehow to not be migrated further, and then
> migrate the anonymous pages using migrate_pages(pid, ...)
>
There can be mapped files that can't be mapped into the migration task.
.
Here's an example (courtesy of Jack Steiner);
sprintf(fname, "/tmp/tmp.%d", getpid());
unlink(fname);
fd = open(fname, O_CREAT|O_RDWR);
p = mmap(NULL, bytes, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
close(fd);
unlink(fname);
/* "p" remains valid until unmapped */
The file /tmp/tmp.pid is both mapped and deleted. It can't be opened
by another process to mmap() it, so it can't be mapped into the
migration task AFAIK how to do things. The file does show up in
/proc/pid/maps as shown below (pardon the line splitting):
2000000000270000-2000000000278000 rw-p 00200000 08:13 75498728 \
/lib/tls/libc.so.6.1
2000000000278000-2000000000284000 rw-p 2000000000278000 00:00 0
2000000000300000-2000000000c8c000 rw-s 00000000 08:13 100885287 \
/tmp/tmp.18259 (deleted)
4000000000000000-4000000000008000 r-xp 00000000 00:2a 14688706 \
/home/tulip14/steiner/apps/bigmem/big
Jack says:
"This is a fairly common way to work with scratch map'ed files. Sites that
have very large disk farms but limited swap space frequently do this (or at
least they use to...)"
So while I tend to agree with your concern about manipulating
one process's address space from another, I honestly think we
are stuck, and I don't see a good way around this.
> BTW it might be better to make va_end a size, just to be more
> symmetric with mlock,madvise,mmap et.al.
>
Yes, I agree. Let's make that so.
> -Andi
> -
> 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/
>
--
Best Regards,
Ray
-----------------------------------------------
Ray Bryant
512-453-9679 (work) 512-507-7807 (cell)
raybry@sgi.com raybry@austin.rr.com
The box said: "Requires Windows 98 or better",
so I installed Linux.
-----------------------------------------------
next prev parent reply other threads:[~2005-02-22 22:01 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-12 3:25 [RFC 2.6.11-rc2-mm2 0/7] mm: manual page migration -- overview Ray Bryant
2005-02-12 3:25 ` [RFC 2.6.11-rc2-mm2 1/7] mm: manual page migration -- cleanup 1 Ray Bryant
2005-02-12 3:25 ` [RFC 2.6.11-rc2-mm2 2/7] mm: manual page migration -- cleanup 2 Ray Bryant
2005-02-12 3:25 ` [RFC 2.6.11-rc2-mm2 3/7] mm: manual page migration -- cleanup 3 Ray Bryant
2005-02-12 3:26 ` [RFC 2.6.11-rc2-mm2 4/7] mm: manual page migration -- cleanup 4 Ray Bryant
2005-02-12 3:26 ` [RFC 2.6.11-rc2-mm2 5/7] mm: manual page migration -- cleanup 5 Ray Bryant
2005-02-12 3:26 ` [RFC 2.6.11-rc2-mm2 6/7] mm: manual page migration -- add node_map arg to try_to_migrate_pages() Ray Bryant
2005-02-12 3:26 ` [RFC 2.6.11-rc2-mm2 7/7] mm: manual page migration -- sys_page_migrate Ray Bryant
2005-02-12 8:08 ` Paul Jackson
2005-02-12 12:34 ` Arjan van de Ven
2005-02-12 14:48 ` Andi Kleen
2005-02-12 20:51 ` Paul Jackson
2005-02-12 21:04 ` Dave Hansen
2005-02-12 21:44 ` Paul Jackson
2005-02-14 13:52 ` Robin Holt
2005-02-14 18:50 ` Dave Hansen
2005-02-14 22:01 ` Robin Holt
2005-02-14 22:22 ` Dave Hansen
2005-02-15 10:50 ` Robin Holt
2005-02-15 15:38 ` Paul Jackson
2005-02-15 18:39 ` Dave Hansen
2005-02-15 18:54 ` Ray Bryant
2005-02-15 15:49 ` Paul Jackson
2005-02-15 16:21 ` Robin Holt
2005-02-15 16:35 ` Paul Jackson
2005-02-15 18:59 ` Robin Holt
2005-02-15 20:54 ` Dave Hansen
[not found] ` <16914.28795.316835.291470@wombat.chubb.wattle.id.au>
2005-02-15 22:10 ` Paul Jackson
2005-02-15 22:51 ` Robin Holt
2005-02-15 23:00 ` Paul Jackson
2005-02-15 15:40 ` Paul Jackson
2005-02-12 11:17 ` [RFC 2.6.11-rc2-mm2 0/7] mm: manual page migration -- overview Andi Kleen
2005-02-12 12:12 ` Robin Holt
2005-02-14 19:18 ` Andi Kleen
2005-02-15 1:02 ` Steve Longerbeam
2005-02-12 15:54 ` Marcelo Tosatti
2005-02-12 16:18 ` Marcelo Tosatti
2005-02-12 21:29 ` Andi Kleen
2005-02-14 16:38 ` Robin Holt
2005-02-14 19:15 ` Andi Kleen
2005-02-14 23:49 ` Ray Bryant
2005-02-15 3:16 ` Paul Jackson
2005-02-15 9:14 ` Ray Bryant
2005-02-15 15:21 ` Paul Jackson
2005-02-15 0:29 ` Ray Bryant
2005-02-15 11:05 ` Robin Holt
2005-02-15 17:44 ` Ray Bryant
2005-02-15 11:53 ` Andi Kleen
2005-02-15 12:15 ` Robin Holt
2005-02-15 15:07 ` Paul Jackson
2005-02-15 15:11 ` Paul Jackson
2005-02-15 18:16 ` Ray Bryant
2005-02-15 18:24 ` Andi Kleen
2005-02-15 12:14 ` [RFC 2.6.11-rc2-mm2 0/7] mm: manual page migration -- overview II Andi Kleen
2005-02-15 18:38 ` Ray Bryant
2005-02-15 21:48 ` Andi Kleen
2005-02-15 22:37 ` Paul Jackson
2005-02-16 3:44 ` Ray Bryant
2005-02-17 23:54 ` Andi Kleen
2005-02-18 8:38 ` Ray Bryant
2005-02-18 13:02 ` Andi Kleen
2005-02-18 16:18 ` Paul Jackson
2005-02-18 16:20 ` Paul Jackson
2005-02-18 16:22 ` Paul Jackson
2005-02-18 16:25 ` Paul Jackson
2005-02-19 1:01 ` Ray Bryant
2005-02-20 21:49 ` Andi Kleen
2005-02-20 22:30 ` Paul Jackson
2005-02-20 22:35 ` Andi Kleen
2005-02-21 1:50 ` Paul Jackson
2005-02-21 7:39 ` Ray Bryant
2005-02-21 7:29 ` Ray Bryant
2005-02-21 9:57 ` Andi Kleen
2005-02-21 12:02 ` Paul Jackson
2005-02-21 8:42 ` Ray Bryant
2005-02-21 12:10 ` Andi Kleen
2005-02-21 17:12 ` Ray Bryant
2005-02-22 18:03 ` Andi Kleen
2005-02-22 6:40 ` Ray Bryant
2005-02-22 18:01 ` Andi Kleen
2005-02-22 18:45 ` Ray Bryant
2005-02-22 18:49 ` Andi Kleen
2005-02-22 22:04 ` Ray Bryant [this message]
2005-02-22 6:44 ` Ray Bryant
2005-02-21 4:20 ` Ray Bryant
2005-02-18 16:58 ` Ray Bryant
2005-02-18 17:02 ` Ray Bryant
2005-02-18 17:11 ` Ray Bryant
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=421BAC7B.4030100@sgi.com \
--to=raybry@sgi.com \
--cc=ak@muc.de \
--cc=ak@suse.de \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pj@sgi.com \
--cc=raybry@austin.rr.com \
--cc=steiner@sgi.com \
/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