Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1035127pxu; Mon, 23 Nov 2020 09:59:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGlsdsTxogi3fO9siwmNUtVSti2nfuLzWeNYrKgvqyhhWZJoRQ/r3sPA4b2d++d8v+Gjlp X-Received: by 2002:a17:906:254d:: with SMTP id j13mr752852ejb.376.1606154342049; Mon, 23 Nov 2020 09:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606154342; cv=none; d=google.com; s=arc-20160816; b=Up6hxZvQDbv/4R0eNm1AXQxDfllHCKLmS858RcBJUzv3x50tYYSH76aYTGViYRce7+ V++MJq2WGVDj0p0AxpUjCD93pb7SaYi8vAiXzLJHnOGT7M6LXurvge//z1JlVyrmiuKs Qo15wq28fGrNT3N4eaA7H/gE4boawbwDSxe9CMxUoAIOitE7AbglmGu7AWCIIWXicUed Kh0UWM+QHJ0LANiv0J5yf2UU9naFyqVMTxI7AaBfUxCDt9Q8NCFlOWDGZk6kWV9+8GdJ d9c1uxCYMKPIwvf+1o1X0ecnp22nfqOeLfMXsUBNdYN13OhS/x31SdnyXt97ao0bg6Gw TFSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IuMYUJdtH/2nxOl3I7w6Zr/wW7lBFGJLSxs8ekU48XU=; b=A4vVbTMQ1/Rxi0kA1n2xNvKMBtBfjyEIZIcmdg0ljwWXFlIBvEl0x1cPvXIacQAIHZ z7uQfD/Gnzd33ZaGUeQjOtuFIuZVqZwm71LtuORvwJPbEJr8QpQ511cAs0/jzqmM+YzC wWd7tJD2/aO/xvxzMxagWa+i0qCd1ChbSoKOrF8oZB94n0PDMy4CMoUC9wTWeDGqPLg4 LMhlNaaiZrgilPQO4ChaqPKEhqFfavr5MsuU6O59D/tHErQ2mJgSd4mqvDdN5M/fYvJT R2gnuH4aW3V73XNFuIEngRdLMPP1ppmVGNc/2Y4nEGRrGmkZabg1KdV3AqcBuaTa9oHm sM0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=EZyroN8Q; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si7470577edq.317.2020.11.23.09.58.38; Mon, 23 Nov 2020 09:59:02 -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=@soleen.com header.s=google header.b=EZyroN8Q; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732624AbgKWRyz (ORCPT + 99 others); Mon, 23 Nov 2020 12:54:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730906AbgKWRyy (ORCPT ); Mon, 23 Nov 2020 12:54:54 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5942DC0613CF for ; Mon, 23 Nov 2020 09:54:54 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id q16so18009719edv.10 for ; Mon, 23 Nov 2020 09:54:54 -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=IuMYUJdtH/2nxOl3I7w6Zr/wW7lBFGJLSxs8ekU48XU=; b=EZyroN8QsWMlG8MTbc4cEihy9jePh/EDRLIjidMYCh0AaOGMIsSZ+OIATwGTb7DrBg B0Y1wY8pXvHBi6kX0TuUMi2Fdaf8/jL0YYRk8gQBTf34tAYfi7wTZVQbICJ6erlFoTnn gInq2VWGc7qr88/qrPaiO2j8C7HaCasgFulEZuWEY+s4HTf5C89bIQH2CuSqqzHDwZLb SW1ZK7U1VKG+c+pTLi3qwYcop/T7aXkxdii36ISw06hkxzwkbqUfwSvgdRcVscA/1F2K HXzrUVMZ0qTJB8usXug7XfUu9DDeABr7dCAv3/Yq6EpSpY2b6FOKz09hxaYomrGi6hPi VJ5A== 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=IuMYUJdtH/2nxOl3I7w6Zr/wW7lBFGJLSxs8ekU48XU=; b=bQITNgf+zK036dCUSYxjMKNbTr9HoNdI58V1D4fy8lrC3rpbU7brlJ9VF4PWoqOULQ z4h7dsjl0IEfQvnCWhKRHUXcMV9zwkhD3562Ff693CzxMaus8fFhUfE7kA9sVPt4k3Qf wjMoqMtynyMtvi4b4gt1peTjie7MTFcvhl1RfUC6aqBD0YmDpm7AWT60ApKtx58dfH5W FHXHQbZh5FmGEpNk8yzgnV1cjPpN9rL0fVmtjP7D0KqEWzRC2V11EpE0uxuhk4D7nmxo NOAbYC6ZNcrGktTi+7bsqAJujfsaWd1aSw8j61KSwaTyF33MLLIZNiNpxcp+B603je7Z Rbqg== X-Gm-Message-State: AOAM531pDKSDu/e3VX/bB+hDLIPcAbb9bQXlngI1/JBZkYDuSS6EUwcj MLpFLpgjhIvS2T9jh0G0XkfZF0t5efycNzrCfAtkbg== X-Received: by 2002:aa7:d54b:: with SMTP id u11mr309610edr.341.1606154092463; Mon, 23 Nov 2020 09:54:52 -0800 (PST) MIME-Version: 1.0 References: <20201123090129.GD27488@dhcp22.suse.cz> <20201123171502.GX244516@ziepe.ca> In-Reply-To: <20201123171502.GX244516@ziepe.ca> From: Pavel Tatashin Date: Mon, 23 Nov 2020 12:54:16 -0500 Message-ID: Subject: Re: Pinning ZONE_MOVABLE pages To: Jason Gunthorpe Cc: Michal Hocko , linux-mm , Andrew Morton , Vlastimil Babka , LKML , David Hildenbrand , Oscar Salvador , Dan Williams , Sasha Levin , Tyler Hicks , Joonsoo Kim , Stephen Hemminger Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 23, 2020 at 12:15 PM Jason Gunthorpe wrote: > > On Mon, Nov 23, 2020 at 11:06:21AM -0500, Pavel Tatashin wrote: > > > What I mean here is allowing users to guarantee that the page's PA is > > going to stay the same. Sort of a stronger mlock. Mlock only > > guarantees that the page is not swapped, but something like > > You've just described get/pin_user_pages(), that is exactly what it is > for. You are right. No need for the madvise() flag at all. (The slight difference of being able to mark memory pinned prior to touching is really insignificant). > > I agree with the other emails, ZONE_MOVABLE needs to be reconciled > with FOLL_LONGTERM - most likely by preventing ZONE_MOVABLE pages from > being returned. This will need migration like CMA does and the point > about faulting is only an optimization to prevent fault then immediate > migration. That is right, as the first step we could just do fault and immediate migration, which is silly, but still better than what we have now. > > Jason