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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 C6172C4361A for ; Fri, 4 Dec 2020 15:56:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A90722B30 for ; Fri, 4 Dec 2020 15:56:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A90722B30 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 07D216B0068; Fri, 4 Dec 2020 10:56:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 02DF96B0074; Fri, 4 Dec 2020 10:56:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5ECD6B0075; Fri, 4 Dec 2020 10:56:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id CF72F6B0068 for ; Fri, 4 Dec 2020 10:56:08 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8F790181AEF1E for ; Fri, 4 Dec 2020 15:56:08 +0000 (UTC) X-FDA: 77556051216.27.talk66_020bd4e273c5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 68D033D668 for ; Fri, 4 Dec 2020 15:56:08 +0000 (UTC) X-HE-Tag: talk66_020bd4e273c5 X-Filterd-Recvd-Size: 5133 Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Dec 2020 15:56:07 +0000 (UTC) Received: by mail-ej1-f65.google.com with SMTP id 7so9401209ejm.0 for ; Fri, 04 Dec 2020 07:56:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z1hSH0l5Mma4TVkpXqECWzqdZtweOdCfO88BYm8fACs=; b=RUzCcvPH0tW5ee4reJQV971WgWVIF+pT2Zzgzrx7RqkCoMfZv49Ur27stVaGJbAobj mNZUiVCfBJmH1BYYnKppQ1c3uuKMVEWq9h0vp+Ryg1k8c/B6fU/R9wUXJbpEVhjqEfsS 3/w3MD13NUqO/iOhjGvzn3nRbQPpS94fJZ509yjyRP+z5fmTE9UqkIAHDKwZZJNFyFqM 5aaD+Fv5DH4cxwHWTokWvH64sebt9P6miHnsB12RFnonT96X5mnIWyWGgF+xGA4IAKkI iV7gCCyHtMnDjYbWPMSfoL2ekwNa3t+te3gFp/joq9Hb7Exv5zNMXbL4uM9xYAChdFQ+ RJzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z1hSH0l5Mma4TVkpXqECWzqdZtweOdCfO88BYm8fACs=; b=IkolIYAJCjiYSyx8dAQGV7FogMtXUiYZtNmlK75MEoeEsGvXoIjglh4lE9136GoB1i tPIN/dmn5TdumocebDRpIno1kaIz0URw+lt2ghAAUc5IdFmqZ5T5w2Sm6IoZ6ViuC2t8 rDhEKVPbMKI6NTVt7CIunz+a+sTuYW/3rCs6ouW//uYVdLnjl8DNWbLCX5BBLC+fRIH+ BKN8qCWUjbnWNVZCC94UhxangdHOo9WwfC9/4M2ZY/VOZ5zpfmCcGvr/1YgOVtPhmxQX 4vZjJ68JoSX5bnzJFOUL0Pr+o3FhyCvCLKpfWRIKLh3K80b4w6dT/K7fGn01J6zNZ/jT 0yYw== X-Gm-Message-State: AOAM531GPmYRqQvIqzUUESioiKk0zinRAhGHGm9cAv7m/SnQo50Ux9cc xzWYdsmWEiEBGn+7avy1SrAMg6FHyCSACk8UErZB0w== X-Google-Smtp-Source: ABdhPJyYx9fPZe07SmVSs01be5+MSE5f/I39Ebl7hnoQ/Cwrxmg307rfKvaC6gipYgPUpXrRYOA8LB9osYG/5huDQbM= X-Received: by 2002:a17:906:d41:: with SMTP id r1mr7510400ejh.383.1607097366456; Fri, 04 Dec 2020 07:56:06 -0800 (PST) MIME-Version: 1.0 References: <20201202052330.474592-1-pasha.tatashin@soleen.com> <20201204035953.GA17056@js1304-desktop> In-Reply-To: <20201204035953.GA17056@js1304-desktop> From: Pavel Tatashin Date: Fri, 4 Dec 2020 10:55:30 -0500 Message-ID: Subject: Re: [PATCH 0/6] prohibit pinning pages in ZONE_MOVABLE To: Joonsoo Kim Cc: LKML , linux-mm , Andrew Morton , Vlastimil Babka , Michal Hocko , David Hildenbrand , Oscar Salvador , Dan Williams , Sasha Levin , Tyler Hicks , mike.kravetz@oracle.com, Steven Rostedt , Ingo Molnar , Jason Gunthorpe , Peter Zijlstra , Mel Gorman , Matthew Wilcox , David Rientjes , John Hubbard Content-Type: text/plain; charset="UTF-8" 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, Dec 3, 2020 at 11:03 PM Joonsoo Kim wrote: > > Hello, > > On Wed, Dec 02, 2020 at 12:23:24AM -0500, Pavel Tatashin wrote: > > When page is pinned it cannot be moved and its physical address stays > > the same until pages is unpinned. > > > > This is useful functionality to allows userland to implementation DMA > > access. For example, it is used by vfio in vfio_pin_pages(). > > > > However, this functionality breaks memory hotplug/hotremove assumptions > > that pages in ZONE_MOVABLE can always be migrated. > > > > This patch series fixes this issue by forcing new allocations during > > page pinning to omit ZONE_MOVABLE, and also to migrate any existing > > pages from ZONE_MOVABLE during pinning. > > I love what this patchset does, but, at least, it's better to consider > the side-effect of this patchset and inform it in somewhere. IIUC, > ZONE_MOVABLE exists for two purposes. > > 1) increasing availability of THP > 2) memory hot-unplug > > Potential issue would come from the case 1). They uses ZONE_MOVABLE > for THP availability and hard guarantee for migration isn't required > until now. So, there would be a system with following congifuration. > > - memory layout: ZONE_NORMAL-512MB, ZONE_MOVABLE-512MB > - memory usage: unmovable-256MB, movable pinned-256MB, movable > unpinned-512MB > > With this patchset, movable pinned should be placed in ZONE_NORMAL so > 512MB is required for ZONE_NORMAL. ZONE_NORMAL would be exhausted and > system performance would be highly afftect according to memory usage > pattern. > > I'm not sure whether such configuration exists or not, but, at least, > it's better to write down this risk on commit message or something > else. Yes, this indeed could be a problem for some configurations. I will add your comment to the commit log of one of the patches. Thank you, Pasha