From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6189C433F5 for ; Thu, 14 Oct 2021 10:28:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D87E60F93 for ; Thu, 14 Oct 2021 10:28:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D87E60F93 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 65BD66B006C; Thu, 14 Oct 2021 06:28:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60C6E6B0071; Thu, 14 Oct 2021 06:28:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4ACBB6B0072; Thu, 14 Oct 2021 06:28:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 3EED06B006C for ; Thu, 14 Oct 2021 06:28:50 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 01E3B26DF9 for ; Thu, 14 Oct 2021 10:28:50 +0000 (UTC) X-FDA: 78694669620.37.EAC40B1 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf27.hostedemail.com (Postfix) with ESMTP id 8FFB770000A4 for ; Thu, 14 Oct 2021 10:28:48 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19E8Ekp0030584; Thu, 14 Oct 2021 06:28:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=O4/9mr4rwhyl7BRl2Q5s1MabSjaJYoa2E1o2IGDxbjw=; b=ZV7HTZwNQDi1CFSTxX7PZhOQOmY/U2WKiTFuX2O+To+ocA72Af8m7hf/iNGmQLzVwsqS gdV44RbkiCXb+MJfM43+MIf9i8S40hz5Z5tLAM30ftjH6W9fgjyKj8frXoCjKc++GZYz BeyyS7yx9uxxan0GJt98b1aC2z7QXmtHhLbds6egkiCnVMFp3vvSTxMPi4xcPP5JNMlF ZirkUyUicXvR+6BukG0czpM5E5DXl1qxJ+1F+dnq6z9MVe8j6InqMLoaHLxXTQM6TawM qZ4SYXjWP0AF+Od3jtrkSZaIlYJNevPF4odWngp6wr8rajEPeWCZebCwIdnb1PcHSqx9 wA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bpgv4aqj0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 06:28:41 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 19E93Ql8032579; Thu, 14 Oct 2021 06:28:41 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bpgv4aqhh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 06:28:40 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19EAS5vA017635; Thu, 14 Oct 2021 10:28:39 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06ams.nl.ibm.com with ESMTP id 3bk2bjv4ep-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 10:28:39 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19EASZ6s58130786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Oct 2021 10:28:35 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5FD3911C04A; Thu, 14 Oct 2021 10:28:35 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1B0911C052; Thu, 14 Oct 2021 10:28:30 +0000 (GMT) Received: from [9.43.85.209] (unknown [9.43.85.209]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 Oct 2021 10:28:30 +0000 (GMT) Message-ID: <49514c97-c540-48ee-0b2f-3cd7bd3dfcf9@linux.ibm.com> Date: Thu, 14 Oct 2021 15:58:29 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [RFC PATCH] mm/mempolicy: add MPOL_PREFERRED_STRICT memory policy Content-Language: en-US To: Michal Hocko Cc: Andi Kleen , linux-mm@kvack.org, akpm@linux-foundation.org, Ben Widawsky , Dave Hansen , Feng Tang , Andrea Arcangeli , Mel Gorman , Mike Kravetz , Randy Dunlap , Vlastimil Babka , Dan Williams , Huang Ying References: <20211013094539.962357-1-aneesh.kumar@linux.ibm.com> <83483424-e617-51c4-d55c-6106e66e2659@linux.intel.com> <87pms8ymvl.fsf@linux.ibm.com> From: "Aneesh Kumar K.V" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: iT0Gcr2fK78R5z5lbLaexqIRdnsFeOd9 X-Proofpoint-ORIG-GUID: FznFaV4Zu-Pv6h36jXaYXNa2c43aUBWY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-14_03,2021-10-14_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110140062 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=ZV7HTZwN; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf27.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com X-Stat-Signature: qkx1f6pe4ex53u15r4j69e1mm6e9dr7a X-Rspamd-Queue-Id: 8FFB770000A4 X-Rspamd-Server: rspam01 X-HE-Tag: 1634207328-179478 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10/14/21 15:08, Michal Hocko wrote: > On Thu 14-10-21 15:00:22, Aneesh Kumar K.V wrote: >> Michal Hocko 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