linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Andi Kleen <ak@linux.intel.com>,
	linux-mm@kvack.org, akpm@linux-foundation.org,
	Ben Widawsky <ben.widawsky@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Feng Tang <feng.tang@intel.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Dan Williams <dan.j.williams@intel.com>,
	Huang Ying <ying.huang@intel.com>
Subject: Re: [RFC PATCH] mm/mempolicy: add MPOL_PREFERRED_STRICT memory policy
Date: Thu, 14 Oct 2021 15:58:29 +0530	[thread overview]
Message-ID: <49514c97-c540-48ee-0b2f-3cd7bd3dfcf9@linux.ibm.com> (raw)
In-Reply-To: <YWf6oiXM+L8J7yyW@dhcp22.suse.cz>

On 10/14/21 15:08, Michal Hocko wrote:
> On Thu 14-10-21 15:00:22, Aneesh Kumar K.V wrote:
>> Michal Hocko <mhocko@suse.com> writes:
>>
>>> On Wed 13-10-21 18:53:55, Aneesh Kumar K.V wrote:
>>>> On 10/13/21 18:46, Andi Kleen wrote:
>>>>>
>>>>>> The difference with MPOL_BIND is the ability to specify a preferred node
>>>>>> which is the first node in the nodemask argument passed.
>>>>>
>>>>> That's always the one with the lowest number. Isn't that quite limiting
>>>>> in practice?
>>>>>
>>>>> It seems if you really want to do that you would need another argument.
>>>>>
>>>> Yes. But that would make it a new syscall. Should we do that?
>>>
>>> Yes, I do not see any reasonable to cram this into the existing syscall.
>>> I am not yet sure what the syscall should look like though. I can see
>>> two usecases, one of the is a very specific node allocation fallback
>>> order requirement and another one is preferrence for a cpu less node
>>> over other nodes. Both are slightly different.
>>
>> How about
>>
>> SYSCALL_DEFINE5(preferred_mbind, unsigned long, start, unsigned long, len,
>> 		unsigned long, preferred_node, const unsigned long __user *, nmask,
>> 		unsigned long, maxnode)
>> {
>> 	return kernel_mbind(start, len, MPOL_PREFERRED_STRICT, preferred_node,
>> 			    nmask, maxnode, 0);
>> }
> 
> Semantic? How does it interact with MPOL_PREFERRED_MANY, MPOL_BIND and
> other others?
> 

This allows to specify a new memory policy for the va range. We are 
forced to use a new syscall because of the limitation of the current 
mbind(2) syscall. We could make a generic sys_mbind2(), but i was not 
sure whether we need to make it that complex. mbind() is already a 6 
argument syscall.

> Besides that it would be really great to finish the discussion about the
> usecase before suggesting a new userspace API.
> 

Application would like to hint a preferred node for allocating memory 
backing a va range and at the same time wants to avoid fallback to some 
set of nodes (in the use case I am interested don't fall back to slow 
memory nodes).


-aneesh


  reply	other threads:[~2021-10-14 10:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13  9:45 Aneesh Kumar K.V
2021-10-13 10:42 ` Michal Hocko
2021-10-13 10:48   ` Michal Hocko
2021-10-13 12:35     ` Aneesh Kumar K.V
2021-10-13 12:50       ` Michal Hocko
2021-10-13 12:58         ` Aneesh Kumar K.V
2021-10-13 13:07           ` Michal Hocko
2021-10-13 13:10             ` Aneesh Kumar K.V
2021-10-13 14:22               ` Michal Hocko
2021-10-13 13:57           ` Aneesh Kumar K.V
2021-10-13 14:26             ` Michal Hocko
2021-10-13 13:16 ` Andi Kleen
2021-10-13 13:23   ` Aneesh Kumar K.V
2021-10-13 14:21     ` Michal Hocko
2021-10-14  9:30       ` Aneesh Kumar K.V
2021-10-14  9:38         ` Michal Hocko
2021-10-14 10:28           ` Aneesh Kumar K.V [this message]
2021-10-14 11:41             ` Michal Hocko
2021-10-14 13:29               ` Aneesh Kumar K.V
2021-10-14 14:56                 ` Michal Hocko
2021-10-14 15:50                   ` Aneesh Kumar K.V
2021-10-19  9:38                     ` Michal Hocko

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=49514c97-c540-48ee-0b2f-3cd7bd3dfcf9@linux.ibm.com \
    --to=aneesh.kumar@linux.ibm.com \
    --cc=aarcange@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ben.widawsky@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=feng.tang@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=rdunlap@infradead.org \
    --cc=vbabka@suse.cz \
    --cc=ying.huang@intel.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