Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2304473pxb; Mon, 11 Jan 2021 06:29:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPkCVUf5PlL1pLs3+wkGJthwFwWKvSbANtXXegU99blpxR3ehWPxiN88z70xDthbHYJ8iE X-Received: by 2002:a17:906:e206:: with SMTP id gf6mr11111193ejb.342.1610375340314; Mon, 11 Jan 2021 06:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610375340; cv=none; d=google.com; s=arc-20160816; b=0TOYnIQWU/XA8JE6DXcZBUbE1HbPrSSoPNTJFqd8nEeBVAymlzlcgvOM3JIOxEd6jp jRge+6NCoGt4VUGhIb5GAvkoOl6R2nqGXEsyIuT5PGdnGZVfRrx0Yf0wteRydax7vUwr V2YovhZ/NE8M7micZB0RFw2r667dR1aV6zbIEsYz0dFTi6C97U7hdatFyJ4LODhbd72x R1EemlnJX/I6AlYKtFez/ApsVU2Nn0JyQBfgntZEf8kQWHI7rIsTxXlO8VmFQt9LFWDo bP3A0Y1jdgvzydrJL+4kSW9QFDRsnMy3S9qbGmN0CM/2dY5zv8Y1YGwGkCOuwNCPlaEu 19WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=smCy1Yjkgz+gZDtvnre1/QglxuwwJh77VQyDG7f7TRE=; b=lsx7o3shzocEA7b7eIKXQNlwhAmmKy0l/NdyMUdK6IRRkXXZHIETF36MzbJ0CflGhY 7zOhBr39dWkM7iLOIj6ynKP0ODt/I3sgX12Af85TMyURWm39lFhsYv2UfSsHta2iEfek GU6G6XDmH5YpjWZCP2H/gm8D1rJlpiIf3veoMUqsNngQJxLTocIuWa+DSntGUdxLlJRl Gu1t+hg9XOGDomIZ5xXMp6HyOJUUCKnNavURThMKcEIOhm2IMsO4u2gFVInCLyasPNdw 2mtjuH8U69b0tSGn9+y9guNT+fuZQG/Yg4MeyT5duBs0Y/7hks8W4t36u1ybdZfrusRX qmOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=ZUuH8XyU; 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 l7si7758324edv.230.2021.01.11.06.28.35; Mon, 11 Jan 2021 06:29:00 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=ZUuH8XyU; 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 S2388703AbhAKO0M (ORCPT + 99 others); Mon, 11 Jan 2021 09:26:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728348AbhAKO0L (ORCPT ); Mon, 11 Jan 2021 09:26:11 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7491BC061795 for ; Mon, 11 Jan 2021 06:25:30 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id u25so17208373lfc.2 for ; Mon, 11 Jan 2021 06:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=smCy1Yjkgz+gZDtvnre1/QglxuwwJh77VQyDG7f7TRE=; b=ZUuH8XyUNwUDj/ax6jtLuay1zUfAHTmdAj5OEzyXghQZcVky5ep8DZqIxsMBY2n40g c06X17Dy/0BohuoUCgTPEfnF1EKIHFZ+Uin5pZQVE8W7Zie1OKBDts7Fw6CAJ8oUkF0+ r/h5M78XOTQOyOFRvsAhMPXJIxAmIhjxGdlOX9Hi3+nX64JjFSDQLgrhZZq82sDae6ST Awd6jayAfyX09bC+vlJFcEgIfQybESEifE9Tuf2F/hjEouxgD3ozygW24IF04Z8y8ynU N9j5pf85cu+j4nquHHa/0nuHULcDcB/q8AmB2mg3d0OdxGBUSWwN2TzUtKlGvU/bY+eL /P7g== 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=smCy1Yjkgz+gZDtvnre1/QglxuwwJh77VQyDG7f7TRE=; b=KuSY3YjmgIRUrOxCELZMH9whP+26K9Rx49JlHre3aa0AXAQwgUBntC/MzEKjoGaNn5 KX29zHxIBp0zB/qDSIFVP8UvSckURF8IKl5GNCCE988EfoNLr9L/b7YaID4+y3gN4OWu wi8P7+IC+8KLWqt7YaqUVEwg+jefAxN75FJjXLne1GnXGYrXVyN1QtiPNX08UwsRm0jI hOe5zM6XizKwCTHVC+WmvNV1pK3oI94fb23asF5JJzTTEiiUjrK6NcCqyzMJW/AkY85M lA9hCxEknuLzfeadvNJk/NF/cE9WVgDe+rcQ6PvWmmZgxjbTkX5kw6ZgzXtfA+3uIeWs +1wg== X-Gm-Message-State: AOAM532HF8zjhSz1+EyqhzU/f5i8c2fOKfcoHf9jTNSHhJdziGGiEJrt 1xuLS2Pngz3iWxLgAhMvPbKSxw== X-Received: by 2002:a19:f601:: with SMTP id x1mr7048733lfe.256.1610375129044; Mon, 11 Jan 2021 06:25:29 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id b7sm3440379ljf.76.2021.01.11.06.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 06:25:28 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id B18BE102238; Mon, 11 Jan 2021 17:25:33 +0300 (+03) Date: Mon, 11 Jan 2021 17:25:33 +0300 From: "Kirill A. Shutemov" To: Will Deacon Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Linus Torvalds , Vinayak Menon , Hugh Dickins , kernel-team@android.com Subject: Re: [PATCH v2 2/3] mm: Allow architectures to request 'old' entries when prefaulting Message-ID: <20210111142533.oulduqd76mkpdkst@box> References: <20210108171517.5290-1-will@kernel.org> <20210108171517.5290-3-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210108171517.5290-3-will@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 08, 2021 at 05:15:16PM +0000, Will Deacon wrote: > diff --git a/mm/filemap.c b/mm/filemap.c > index c1f2dc89b8a7..0fb9d1714797 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -3051,14 +3051,18 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, > if (!pte_none(*vmf->pte)) > goto unlock; > > + /* We're about to handle the fault */ > + if (vmf->address == address) { > + vmf->flags &= ~FAULT_FLAG_PREFAULT; > + ret = VM_FAULT_NOPAGE; > + } else { > + vmf->flags |= FAULT_FLAG_PREFAULT; > + } > + Do we need to restore the oririnal status of the bit once we are done? -- Kirill A. Shutemov