Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3665029pxb; Sun, 7 Feb 2021 18:20:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHJvFbXGjMWAMObtXI5AXlXYJdbVW4ma93UEczpONahyUy2KaFOUKujG6drnxhdaJ2i/zn X-Received: by 2002:a17:906:854d:: with SMTP id h13mr14245264ejy.124.1612750854427; Sun, 07 Feb 2021 18:20:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612750854; cv=none; d=google.com; s=arc-20160816; b=nzuH3GLPNyghCrxWnJDzQAYMOpxztMS0fJcE8IOD+yKhPTlr17lbvxyz6277R4TnkG teKuvhq8rjT6q74aNsS3Zx6BOMWwTzwYYX/11dwZwy+qiTJ7esFsKDabSr6ViK37Opq2 ovo4YaOIxR5fDnW+lL7IDSbYVuc6RDoVevCvGEygScc9g945R7p33zaWCiQsKi50SH4X TqwmKKvVkZICmprc0RYwQotjQo4A8JmlWiwok+n84lMNymk5sCFYUWRf9wIhtVV06KEo Jw9mrY5cy13Zj/eDpP0RugPJ2Cpj3emogrrN8NqYUs9Xn4fiOPrbgy4yccEs3WFDYmWN iOKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=GAcPfGgqFaC7AQHCBuJv2BWxwOPW6rvQxJdX43h7J8I=; b=zXz3qabxYej3//o+D6ZKNopOdI3LM2nnzDrojEEI83UJNR1mBjAYJvgm2RTbKwi5T2 vJFmb8Z7mh5MkBV4SFJg076sl+pKsY0GTbXYpQ/em+1J9ZFQVRNw1jsvtF2tZeT10fGA QG3DPmg37//FtMlsTgutfabrNXXoohOYr/xqKdAGUSSllXhg9zFim3DWDEo7YLEcsMF1 RTZQYZDAtkVl49P1IpGPXwDRCAMnxBtsyrukdfT8p8kMhGQhbKBrVvufu8AZRLuRgAb+ WyQSNvarzIZxSU1hcq2JntYWyq3VCTxx7qCGVoUgsUVQe/9oKuo8rx5jxcjVCXnyZGX6 BqUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RFsozuFj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kk2si4426390ejc.613.2021.02.07.18.20.19; Sun, 07 Feb 2021 18:20:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RFsozuFj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229601AbhBHCSo (ORCPT + 99 others); Sun, 7 Feb 2021 21:18:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbhBHCSo (ORCPT ); Sun, 7 Feb 2021 21:18:44 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C73C061756 for ; Sun, 7 Feb 2021 18:18:04 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id s24so7370071pjp.5 for ; Sun, 07 Feb 2021 18:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=GAcPfGgqFaC7AQHCBuJv2BWxwOPW6rvQxJdX43h7J8I=; b=RFsozuFj8ctQYWnOlHXA/Y/S/JT+BT2d1zgMTOBparInBD0Zft//MwDz9Pv3qTpRo6 cYnt4/eMEoTNmZaIjVO2TLhCmJ5C57vV4qvNpNJbSbEiEAYxF4yWJG4MXu8cAsWDTDo+ WbVbEUREEq2v/o6uVpD3zSkYM6tjdfLSWrvXySJCEv2KSD78mt+euMZNuzFuILuIrev/ gekJ7tvJj2hVKKklNDYczXUA/ko/19HwJDowAenLYVLrIG2SP/7gwDb1vJahO8ndfhgh 01X02jthq8tr3Gyytp+nR/cZpF484dMC3l0bxJqjGc6dIl8lMe9epYDH0TO4L9WbxQHy xe+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=GAcPfGgqFaC7AQHCBuJv2BWxwOPW6rvQxJdX43h7J8I=; b=TIVRzCZ27DJL+8a1oF3/86H4T3xqz9guWCShgueAWbCJwoeX3S/+HP2twDF0DWIYPE J0dGnn8DC+ofegqQlZVwGhq83kBn2Yi0pXjuyTQ+dY1WUq5HT4rH992gUFp+Q/uMeOdK ByYOzw9XICKKGAIVEnD1XOkR7sBNmDNBSMhkXbnlwUXyuIbO1FMCPAP2PWOO6p0oxtBI cgdpT4S7LGZxybVPs85f26SCmdNJlPh3oEI9yK1JDM50JJe+4BV5jm9EWnPgzGg4+kNu DRu0j+ZX+wRCNDANjFix94qCe3AmZNCt90ToEZJ2R8fndbr3031MP3gy+mIvOiAbMlqK LCbw== X-Gm-Message-State: AOAM532IWu7WvGjumO2MPKiqWmVT/zraCsCjb3fssNUJ5SZlSqoGy7of ukwERiB98ykX1Rin59FniZmdn7t/PIHA8w== X-Received: by 2002:a17:90a:b782:: with SMTP id m2mr14552165pjr.220.1612750683085; Sun, 07 Feb 2021 18:18:03 -0800 (PST) Received: from [2620:15c:17:3:8d40:a1e2:ae2d:6c53] ([2620:15c:17:3:8d40:a1e2:ae2d:6c53]) by smtp.gmail.com with ESMTPSA id f33sm354958pjk.17.2021.02.07.18.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 18:18:02 -0800 (PST) Date: Sun, 7 Feb 2021 18:18:01 -0800 (PST) From: David Rientjes To: "Song Bao Hua (Barry Song)" cc: Matthew Wilcox , "Wangzhou (B)" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-mm@kvack.org" , "linux-arm-kernel@lists.infradead.org" , "linux-api@vger.kernel.org" , Andrew Morton , Alexander Viro , "gregkh@linuxfoundation.org" , "jgg@ziepe.ca" , "kevin.tian@intel.com" , "jean-philippe@linaro.org" , "eric.auger@redhat.com" , "Liguozhu (Kenneth)" , "zhangfei.gao@linaro.org" , "chensihang (A)" Subject: RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin In-Reply-To: Message-ID: <90aca1e9-61b5-88d-d28c-369e6973559e@google.com> References: <1612685884-19514-1-git-send-email-wangzhou1@hisilicon.com> <1612685884-19514-2-git-send-email-wangzhou1@hisilicon.com> <20210207213409.GL308988@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 7 Feb 2021, Song Bao Hua (Barry Song) wrote: > NUMA balancer is just one of many reasons for page migration. Even one > simple alloc_pages() can cause memory migration in just single NUMA > node or UMA system. > > The other reasons for page migration include but are not limited to: > * memory move due to CMA > * memory move due to huge pages creation > > Hardly we can ask users to disable the COMPACTION, CMA and Huge Page > in the whole system. > What about only for mlocked memory, i.e. disable vm.compact_unevictable_allowed? Adding syscalls is a big deal, we can make a reasonable inference that we'll have to support this forever if it's merged. I haven't seen mention of what other unevictable memory *should* be migratable that would be adversely affected if we disable that sysctl. Maybe that gets you part of the way there and there are some other deficiencies, but it seems like a good start would be to describe how CONFIG_NUMA_BALANCING=n + vm.compact_unevcitable_allowed + mlock() doesn't get you mostly there and then look into what's missing. If it's a very compelling case where there simply are no alternatives, it would make sense. Alternative is to find a more generic way, perhaps in combination with vm.compact_unevictable_allowed, to achieve what you're looking to do that can be useful even beyond your originally intended use case.