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 3EACFC433EF for ; Thu, 14 Oct 2021 13:29:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E5A436109F for ; Thu, 14 Oct 2021 13:29:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E5A436109F 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 516816B006C; Thu, 14 Oct 2021 09:29:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C6146B0071; Thu, 14 Oct 2021 09:29:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B53E900002; Thu, 14 Oct 2021 09:29:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id 28A236B006C for ; Thu, 14 Oct 2021 09:29:34 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D75AA18144D26 for ; Thu, 14 Oct 2021 13:29:33 +0000 (UTC) X-FDA: 78695125026.35.A8DEDDD Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf15.hostedemail.com (Postfix) with ESMTP id 91FF2D00009D for ; Thu, 14 Oct 2021 13:29:32 +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 19ECVhMu030587; Thu, 14 Oct 2021 09:29:28 -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=qkzIoLVTJYM457sA8oEoLweHYGFspG3Kcj5AYIvJDX0=; b=PDE29cR8O/+zvceYRCaERe2sq2IaqNSsssJ4XBLYaMv0NVZEnQyFMn3c8blPU5fUVOG8 yMcnTQwLjEjawQn+S7TN5qYQksH/B9u/NDGBcyQrGDg6h0JT/GFBo3QHTm4kLbz/FfDI yAAchJi3tyqOXkHHPfm9LFBwYN/D+JLL+UpoCX1U5g+aMHhine8dgF1uS9SmlwFt1tAG +E3Dw38r8i5sJyvp5L8o+L/WpkWRmBajgf9LRUoB5pR/9cVs9Y9L5VgknkbYlpefR/m5 2fHTfvgRexWphphkMDiJ7ucQr2q0jrRQEnT8GJqehsQLs0CiZuAPIiFA+ZxlhMcdFz7S mg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bpgv4f7as-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 09:29:27 -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 19EARMw7004400; Thu, 14 Oct 2021 09:29:27 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bpgv4f77c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 09:29:27 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19EDMATO029722; Thu, 14 Oct 2021 13:29:24 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 3bk2qa5pam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 13:29:23 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19EDTLOi45089112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Oct 2021 13:29:21 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0282C11C058; Thu, 14 Oct 2021 13:29:21 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2B0811C071; Thu, 14 Oct 2021 13:29:16 +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 13:29:16 +0000 (GMT) Message-ID: Date: Thu, 14 Oct 2021 18:59:14 +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> <49514c97-c540-48ee-0b2f-3cd7bd3dfcf9@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: zpqLc3T83hrZ8kyUSy78XXjoTwQllL2H X-Proofpoint-ORIG-GUID: 2vTe_XkO7A_g-o_Ui4gov1kxEcPPOtbE 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_08,2021-10-14_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=845 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-2110140084 X-Stat-Signature: mo18b1ofyf99nopmn5kidwko4frgth8d Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=PDE29cR8; spf=pass (imf15.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 91FF2D00009D X-HE-Tag: 1634218172-143290 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 17:11, Michal Hocko wrote: > On Thu 14-10-21 15:58:29, Aneesh Kumar K.V wrote: >> On 10/14/21 15:08, Michal Hocko wrote: > [...] >>> 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). > > We do have means for that, right? You can set your memory policy and > then set the cpu afffinity to the node you want to allocate from > initially. You can migrate to a different cpu/node if this is not the > preferred affinity. Why is that not usable? For the same reason you mentioned earlier, these nodes can be cpu less nodes. > > Also think about extensibility. Say I want to allocate from a set of > nodes first before falling back to the rest of the nodemask? If you want > to add a new API then think of other potential usecases. > Describing the specific allocation details become hard with preferred node being a nodemask. With the below interface SYSCALL_DEFINE5(preferred_mbind, unsigned long, start, unsigned long, len, const unsigned long __user *, preferred_nmask, const unsigned long __user *, fallback_nmask, unsigned long, maxnode) { 1. The preferred node is the first node in the preferred node mask 2. Then we try to allocate from nodes present in the preferred node mask which is closer to the first node in the preferred node mask 3. If the above fails, we try to allocate from nodes in the fallback node mask which is closer to the first node in the preferred nodemask. Isn't that too complicated? Do we have a real usecase for that? -aneesh