linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Setting stack NUMA policy?
@ 2013-11-25 23:35 Andy Lutomirski
  2013-11-25 23:43 ` Andy Lutomirski
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Lutomirski @ 2013-11-25 23:35 UTC (permalink / raw)
  To: linux-kernel, linux-mm

I'm trying to arrange for a process to have a different memory policy
on its stack as compared to everything else (e.g. mapped libraries).
Before I start looking for kludges, is there any clean way to do this?

So far, the best I can come up with is to either parse /proc/self/maps
on startup or to deduce the stack range from the stack pointer and
then call mbind.  Then, for added fun, I'll need to hook mmap so that
I can mbind MAP_STACK vmas that are created for threads.

This is awful.  Is there something better?

(What I really want is a separate policy for MAP_SHARED vs MAP_PRIVATE.)

--Andy

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Setting stack NUMA policy?
  2013-11-25 23:35 Setting stack NUMA policy? Andy Lutomirski
@ 2013-11-25 23:43 ` Andy Lutomirski
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Lutomirski @ 2013-11-25 23:43 UTC (permalink / raw)
  To: linux-kernel, linux-mm

On Mon, Nov 25, 2013 at 3:35 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> I'm trying to arrange for a process to have a different memory policy
> on its stack as compared to everything else (e.g. mapped libraries).
> Before I start looking for kludges, is there any clean way to do this?
>
> So far, the best I can come up with is to either parse /proc/self/maps
> on startup or to deduce the stack range from the stack pointer and
> then call mbind.  Then, for added fun, I'll need to hook mmap so that
> I can mbind MAP_STACK vmas that are created for threads.
>
> This is awful.  Is there something better?
>
> (What I really want is a separate policy for MAP_SHARED vs MAP_PRIVATE.)

After a bit more thought, I think that what I *really* want is for the
stack for a thread that has affinity for a single NUMA node to
automatically end up on that node.  This seems like a straightforward
win if it's implementable.

--Andy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-25 23:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-25 23:35 Setting stack NUMA policy? Andy Lutomirski
2013-11-25 23:43 ` Andy Lutomirski

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).