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 X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2965C433E0 for ; Mon, 8 Feb 2021 02:18:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4060764E3F for ; Mon, 8 Feb 2021 02:18:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4060764E3F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8637B6B0006; Sun, 7 Feb 2021 21:18:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EE986B006C; Sun, 7 Feb 2021 21:18:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68EF16B006E; Sun, 7 Feb 2021 21:18:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id 4F0996B0006 for ; Sun, 7 Feb 2021 21:18:05 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F02AF181AEF1A for ; Mon, 8 Feb 2021 02:18:04 +0000 (UTC) X-FDA: 77793490488.17.fish29_3c10887275fb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id CF8E0180D0180 for ; Mon, 8 Feb 2021 02:18:04 +0000 (UTC) X-HE-Tag: fish29_3c10887275fb X-Filterd-Recvd-Size: 5377 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Mon, 8 Feb 2021 02:18:04 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id lw17so8624606pjb.0 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=KDo97dsjDm5zYHDUYZGvvfveVWqOvsKTVLeOvspxTUjmDIRiT3yFczadZKGHIGw3eY OxXh9SI+swhWoBOSI5DHLpyUs/nU0C94eW8b6eA1Te+SEBtr2oJvBJr/DsXO1NzCbGa+ jEUTa8qNbABjxe2P3QpsvfyfT+w+ONrfFuJ5bLtnxza1B2+nsfniY/tI3PjRWKvfBf8Z q3I1qrFbeG8jHmA8Mxy+v+d+AJvjEjr6CfB5zA8sjlPu2/6Gqj/xya0WEOKjGrPDwHm6 YncOtuX6javlGizKGVljStu+uxCSpvK8MS/umVqLu3vMBoH9KuQeN7iV9HpOjGdB09W3 FwoA== X-Gm-Message-State: AOAM530QUZCx/km80bFIagOga1/30Znla8+EPEKkD2LCYKDnhgeTohya WcpErexa+mnoK3P7ddPvGNC8ww== X-Google-Smtp-Source: ABdhPJzp7qfYhmXBu6bdi33JxaukusthN+TP0Ot/ZqOrf1qCP06tl6JjG1EiU2ivo+TK3WKChum8ew== 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 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 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.