lkml.org 
[lkml]   [2007]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] cpuset relative memory policies - second choice
On Wed, 31 Oct 2007, Paul Jackson wrote:

> The basic reason that I went with an additional per-task modal
> state, rather than a modal flag for each mbind, set_mempolicy and
> get_mempolicy call was to reduce the likely rate of bugs in user
> level C code using this API.
>

I think it may be more error prone to accidently leave off the
get_mempolicy() system call to use the system-wide numbering or for
user-level code to forget that the mode was already set (and now stored in
their task_struct) without a subsequent get_mempolicy() to revert back to
the default behavior. Both of these problems can be addressed by checking
the *policy returned by get_mempolicy(), as you've coded it, but many
applications will probably ignore that overhead.

Allowing the mode to be passed on each set_mempolicy() system call seems
better, this is where the nodemask is passed anyway so it's legitimate for
the caller to specify how that nodemask should be interpreted (either
system-wide or cpuset-wide). This keeps all semantics of the nodemask to
a single invocation of a system call instead of setting policy modes with
get_mempolicy() and confusing the matter later.

I think get_mempolicy() can remain unchanged because it will simply return
the contextualized nodemask in either case and would not require a mode to
be passed.

David
-
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/

\
 
 \ /
  Last update: 2007-11-01 20:09    [W:0.144 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site