Re: [RFC PATCH 00/11] mm/mempolicy: Make task->mempolicy externally modifiable via syscall and procfs

From: Gregory Price
Date: Tue Nov 28 2023 - 08:16:10 EST


On Tue, Nov 28, 2023 at 10:45:02AM +0100, Michal Hocko wrote:
> > 2) Should we combine all the existing operations into set_mempolicy2 and
> > add an operation arg.
> >
> > set_mempolicy2(pidfd, arg_struct, len)
> >
> > struct {
> > int pidfd; /* optional */
> > int operation; /* describe which op_args to use */
> > union {
> > struct {
> > } set_mempolicy;
> > struct {
> > } set_vma_home_node;
> > struct {
> > } mbind;
> > ...
> > } op_args;
> > } args;
> >
> > capturing:
> > sys_set_mempolicy
> > sys_set_mempolicy_home_node
> > sys_mbind
> >
> > or should we just make a separate interface for mbind/home_node to
> > limit complexity of the single syscall?
>
> My preference would be to go with specific syscalls. Multiplexing
> syscalls have turned much more complex and less flexible over time.
> Just have a look at futex.

got it, that simplifies things a bit. I can pull my set/get mempolicy2
work forward and just keep the interfaces pretty much the same. Only
difference being an argument structure that is extensible and possibly
some additional refactoring in do_get_mempolicy to make things a bit
cleaner.

~Gregory