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 0C5D9C433F5 for ; Thu, 14 Oct 2021 09:38:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF19E60F41 for ; Thu, 14 Oct 2021 09:38:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AF19E60F41 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 338286B006C; Thu, 14 Oct 2021 05:38:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E7B96B0071; Thu, 14 Oct 2021 05:38:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D6F9900002; Thu, 14 Oct 2021 05:38:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 0EA7D6B006C for ; Thu, 14 Oct 2021 05:38:45 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BFCF18249980 for ; Thu, 14 Oct 2021 09:38:44 +0000 (UTC) X-FDA: 78694543368.36.269D985 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf28.hostedemail.com (Postfix) with ESMTP id 5282E900009E for ; Thu, 14 Oct 2021 09:38:44 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id E649021A7B; Thu, 14 Oct 2021 09:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634204322; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DmZ5akoXKpU1hd4PPv8PEewIyYp47yGCHH0hv20lKRM=; b=Z4v+wbg1Vx9DMuid409Yie+SChNxGQGXpjgNWPAnkSOLSpd4QyKDZ0+oUUde4GRop9NlBe evhWTZ3agMyTeGK3l2zTlea+9Ho3sKhPq/walk0/KL6O2lF9AwZC7scG2OKDnIQyfpMXGT dijnbIDLajYISet/UvgB0yK4/K8QI4w= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 46A34A3B94; Thu, 14 Oct 2021 09:38:42 +0000 (UTC) Date: Thu, 14 Oct 2021 11:38:42 +0200 From: Michal Hocko To: "Aneesh Kumar K.V" 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 Subject: Re: [RFC PATCH] mm/mempolicy: add MPOL_PREFERRED_STRICT memory policy Message-ID: References: <20211013094539.962357-1-aneesh.kumar@linux.ibm.com> <83483424-e617-51c4-d55c-6106e66e2659@linux.intel.com> <87pms8ymvl.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pms8ymvl.fsf@linux.ibm.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5282E900009E X-Stat-Signature: np418r7msrjowednq36c7rosbueb4fog Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Z4v+wbg1; spf=pass (imf28.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-HE-Tag: 1634204324-217889 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 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? Besides that it would be really great to finish the discussion about the usecase before suggesting a new userspace API. -- Michal Hocko SUSE Labs