Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8814949imu; Tue, 4 Dec 2018 14:51:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/WsBShqFBForZsIDj8Ysr1VCspFOkdb4xYNMnbhGCPo/N/i2p50Vwuyf1D4RehumJJTmJ6O X-Received: by 2002:a63:6ac5:: with SMTP id f188mr18509464pgc.165.1543963899085; Tue, 04 Dec 2018 14:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543963899; cv=none; d=google.com; s=arc-20160816; b=ZT4ELIaOeKYZWe1eRTJcu5dhtTSIKccne4J7Ckfn6rDsK5s7/lhx3e2LkpkzSgHITV jTNTkhp2Q6mk5tjpGFf5kJ2riLfaAN6wfhwYeRQfthWn8i4CS3GacoxtRA24W9yR/RFV XLpRSLsmnMkS5ry9AQ3PZ+JC6isHkESKfhDKv2iJqCmq/n4K9rM41gsW05JrRUyEUkK4 IMvP8XGN0Q+u3I0R4QIHlqIBMfOf3zrcH2Yqgeo53P5srenergXP5dhPlgTQ4WGN4jwo 7/dmKzRPix2xlevC8eaTFpG9opyymwbuO2lOiFDz8p70ZO+0hvV2Zu3hxB+BHyi0/inZ P0VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=RkbcslWjaQXOUBfMRCL1x4m7Mm5obVNnRZht87rnZFU=; b=EkLDOAaCGud5D8ldmnrZ6U1Op8fi6cC1bwaGlypk05Vlq9DU5Es2RYthgOmfQO5hgq N2CkTdnkG0v/hkWMYvpohqhDU/eqwHsL5uCOM9Ce/cW31jXHT2l04qZ3yX8FOAvrbCRq uqsP6bRBKw4t2q3SoO5s6VZ7LU7BnB6/7cIdin6YjrLHPgPzG8i4g6irH/gsmE1zXRUu jvBG5ZufzqolqpiyDYjLXEV8PPAktj5awtAhfgtLQDC8uWKQcrbUINgi/YAxEFoLs49l TSYZF5IIE17kPP0nCL4//9Wffq7RqdHZshgyUgaYuz7muEu4XmugxDzZ5bRiDe1T8f3e K0Dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si15910518pgm.559.2018.12.04.14.51.24; Tue, 04 Dec 2018 14:51:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726664AbeLDWuh (ORCPT + 99 others); Tue, 4 Dec 2018 17:50:37 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47364 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbeLDWuh (ORCPT ); Tue, 4 Dec 2018 17:50:37 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 548C3A47; Tue, 4 Dec 2018 22:50:36 +0000 (UTC) Date: Tue, 4 Dec 2018 14:50:34 -0800 From: Andrew Morton To: Josef Bacik Cc: kernel-team@fb.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, tj@kernel.org, david@fromorbit.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, riel@redhat.com, jack@suse.cz Subject: Re: [PATCH 4/4] mm: use the cached page for filemap_fault Message-Id: <20181204145034.4b69bdea36506be45946f8c9@linux-foundation.org> In-Reply-To: <20181130195812.19536-5-josef@toxicpanda.com> References: <20181130195812.19536-1-josef@toxicpanda.com> <20181130195812.19536-5-josef@toxicpanda.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Nov 2018 14:58:12 -0500 Josef Bacik wrote: > If we drop the mmap_sem we have to redo the vma lookup which requires > redoing the fault handler. Chances are we will just come back to the > same page, so save this page in our vmf->cached_page and reuse it in the > next loop through the fault handler. > Is this really worthwhile? Rerunning the fault handler is rare (we hope) and a single pagecache lookup is fast. Some performance testing results would be helpful here. It's practically obligatory when claiming a performance improvement.