Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9472727pxu; Mon, 28 Dec 2020 17:48:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8HrcC2TdmUOJ3MVSTMLmtGqxg7GKDzfie8Engeu8jgT773CO9wDx90Jqg5Zy4MftEkbrs X-Received: by 2002:a50:cd57:: with SMTP id d23mr44486505edj.95.1609206515892; Mon, 28 Dec 2020 17:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609206515; cv=none; d=google.com; s=arc-20160816; b=mTCdry9PgWDvrrP0jyvV2GiSP/aZpN69w9cSVYt3xGKjsuNImOnkk7i3vVA1R/xOfJ ilixHCysUzBzev0nXGQPOMe8GRUwR6CsbIaOsgGeHaAtDRcx1k+ixLMw7bnyBbHWyZQZ elEYiOfqUD8KCI62jkPmdP20gYh1ey7dn6d72M4Nr1Jwu6V/YHVgEk2gjkoiRrx50dZ+ YycUzcoRCTVTtjTbDMy5+c7h9C9OnZ+z2/JVttViqk3lM9PhXjo/Iygo2eBQAF9mWwNE xlwwGE61XfRqJVJ7Wd47sqwBeoKDmY/MdVHrx6+YC/6Y8N8B9rGaoExmEaC0rhqtKRxx cg4Q== 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=XYFP2ulc60ot4/NC1efgeH0hQlOhvsC8IPEDkooBvEs=; b=gi4aEgwTv0rztjrwAREepB9Lu8T3OAbmpJor0gpNuIRBVuPs9cFA6G+XBu6nfu3vJB D3941I0OOCWIEVzdDT79YjUwy4X35gY5vVGzt1SGLRiSuHsF47U3M8+wnn3TiKlz9mjZ N8WNFpM9R+bbHWLAbwsJTfri8PoUSyFMenVfQx0V+JZlsMc1EBkdZvkgpPs8cqrsClZo MaLiZoKxqBplfE8+BPHQwbdTdkPFSHZwJrtcCgIg4ctUueDKhOUlkTkaPTLG0gln2DJg 7hMcaNHHDkSS2LfWVtXMCzdmrYRu4Smh/Xc8r+BeGDWnGezMck6LqNZ5qlnzhlcNDlH8 XnjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=PnzaIY0W; 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 us12si20034515ejb.252.2020.12.28.17.48.14; Mon, 28 Dec 2020 17:48:35 -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=@linux-foundation.org header.s=google header.b=PnzaIY0W; 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 S1728740AbgL1X30 (ORCPT + 99 others); Mon, 28 Dec 2020 18:29:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728569AbgL1X3Y (ORCPT ); Mon, 28 Dec 2020 18:29:24 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4BD9C061796 for ; Mon, 28 Dec 2020 15:28:43 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id l11so27329156lfg.0 for ; Mon, 28 Dec 2020 15:28:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XYFP2ulc60ot4/NC1efgeH0hQlOhvsC8IPEDkooBvEs=; b=PnzaIY0WevdN1LX4x77XkAqdCbHnILaK8s5lgAa0OpFX4yGYQetICtSErEbnRqJyF2 df1IdnigAMWBVb78TsJfEZX+2u+q70jwsNoCzYhAOeHQSolJsz4xefb3lBQb/IMqWPfX LLsh+emoPQ9elejcOAXkRap3sj2sF/7th9mgE= 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=XYFP2ulc60ot4/NC1efgeH0hQlOhvsC8IPEDkooBvEs=; b=CTUJlicA9aEtteiDy5vX07rWfBq/UB4ZlMzONJnvGQVQP5+V637vbeoPxKxs+z3cKX iLtrY28CbkC+Meq5JTY3sABoCRW4SMrFBQJvHVyYaEnCsN7vGDaOobr1XX1cfEHXJ9IL luUx78mgixq4enW+UdE+J4tw6ewkxDivkEiZ29lOWzBQWqFy3IljbPDf9siKsFrbjc+o QUQZ/v/hX5EPNgND8nKr0fnW5KsGk98UNqwXrkp+9XlB/xweXFyEUUXbD14yJpOVMH9m a0hlhbtQtsNZGb6/AJAqoN6vjaqT+F+GyztsncWkHn17g6Zszaj1c1yLcVQJPOASXHA+ RQSA== X-Gm-Message-State: AOAM531kBqdvl93CMHMsHQGhzl17I4XdNl9OM7x3pEMkJ+evhOOJIInR EtH34O1wNyhCT2IPlbwr79Mvk4YFVwGEOQ== X-Received: by 2002:a2e:98ca:: with SMTP id s10mr21664506ljj.417.1609198122248; Mon, 28 Dec 2020 15:28:42 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id g13sm5461457lfb.43.2020.12.28.15.28.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Dec 2020 15:28:40 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id 23so27198154lfg.10 for ; Mon, 28 Dec 2020 15:28:40 -0800 (PST) X-Received: by 2002:a2e:6f17:: with SMTP id k23mr23942779ljc.411.1609198119916; Mon, 28 Dec 2020 15:28:39 -0800 (PST) MIME-Version: 1.0 References: <20201226224016.dxjmordcfj75xgte@box> <20201227234853.5mjyxcybucts3kbq@box> <20201228125352.phnj2x2ci3kwfld5@box> <20201228220548.57hl32mmrvvefj6q@box> In-Reply-To: <20201228220548.57hl32mmrvvefj6q@box> From: Linus Torvalds Date: Mon, 28 Dec 2020 15:28:23 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: "Kirill A. Shutemov" Cc: Hugh Dickins , Matthew Wilcox , "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , Vinayak Menon , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 28, 2020 at 2:05 PM Kirill A. Shutemov wrote: > > > But I *think* we should be fine here: do_fault_around() limits start_pgoff > and end_pgoff to stay within the page table. Yeah, but I was thinking it would then update ->pte to just past the edge. But looking at that logic, you're right - it will update ->pte and ->address only just before installing the pte, so it will never go _to_ the edge, it will always stay inside. So scratch my suspicion. It looked promising mainly because that ->pte pointer update was one of the things that changed when you instead compared against the address. Linus