Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2582036ybg; Fri, 5 Jun 2020 18:10:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvcSaCFDhFkMqkseJyGIo4/or6F4Kp7IdFTGaSI/a4snFG9AsBYaQ2gao+uPuW0cko3pE5 X-Received: by 2002:a17:907:2058:: with SMTP id pg24mr10859141ejb.63.1591405854804; Fri, 05 Jun 2020 18:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591405854; cv=none; d=google.com; s=arc-20160816; b=zEYOHPhGAUysrCiIsGv83pkP9eL2pbCHuAudbhXRUsb2DaQ3Mw4zth9NgcLfo/KpRl 1A7ll8lCdJTjLglHZiD1Kb0DuoSZuuuvYkk2G+CYeV1/aOYleTAVCwmlruzWj9xaDid+ wNq2FNto2uWQ+4Y/EsRhnIe2jismANRdMwl25EmF1afvoNETd9BuvgpyjM/q2eZpI7Jj r+yFC+jpVk72WvbyIDBSLUyRxLF1Eara98cHCuB3s18kZHRTVDv2FyeIP0LSKR6D+cFv aDdNRI1u5mOpBoLiDxszb9Zgxz/QzRc/b6NMulX72Nka1IQUc4mYrNOib9McOy2W0E0k pr7Q== 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 :dkim-signature; bh=wUEFKbg5d7lsKbJyCLLby5dYEo2fthjw8hOCGLhXbY4=; b=CNU3sTksvsEIfD55+0B75qDENqlb9JTX2DaDUn9bYnNld6aNa02d/6hZRVGFPBV0EM s3NxbbT+0sVgwmX6YHdeou9JLPBqy7rawdnbDU1L1iVWhWX0kxJF2oiRd+AAWX1HYd7Y RWxxd0ISida+0loW/zHm7XdmVdI8lLhPaw8LYajIZpBgwCR2t2abZyH81c0AoQLR4sHn JVEp/zGXX0UKJKMLHzPWP6ncYcypJvfXwrV4fS8EOy7OHQRESwBEDOXNzCxmCGt0cdIv XnjgsHEoHL14Ojn3lCmMDudVn3z2N4R9bSb6IDN6qiXCQJURU2IqExNXOStidZIqi15k vDxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vw2MqBpJ; 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 c62si5367578edd.408.2020.06.05.18.10.30; Fri, 05 Jun 2020 18:10:54 -0700 (PDT) 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=@kernel.org header.s=default header.b=vw2MqBpJ; 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 S1728486AbgFFBIG (ORCPT + 99 others); Fri, 5 Jun 2020 21:08:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:58894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726803AbgFFBIG (ORCPT ); Fri, 5 Jun 2020 21:08:06 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2546820723; Sat, 6 Jun 2020 01:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591405684; bh=JdeeZEG/s9PJWjwa/MTfv/JgYtVWchaFYWKs9Z3jNuE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vw2MqBpJYwqq+09ZZ6vagDXamXK2QaHHbzr5ql5vspav6hv4YZxBA9Sa4ChzzdwfO f/Dh52fmkY9R8vhHgQz9fdtpn+TjCFlhSMwVVdtJ9ubadfm0w+RJfmxoaoYNQKAW1k SmUDydhrZ/piDRkHlyEgWO2OdyChN5IIcEAyO+5E= Date: Fri, 5 Jun 2020 18:08:03 -0700 From: Andrew Morton To: Bibo Mao Cc: Thomas Bogendoerfer , Paul Burton , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/2] MIPS: set page access bit with pgprot on some MIPS platform Message-Id: <20200605180803.9ba58249ed681f4da9822f43@linux-foundation.org> In-Reply-To: <1591348266-28392-1-git-send-email-maobibo@loongson.cn> References: <1591348266-28392-1-git-send-email-maobibo@loongson.cn> X-Mailer: Sylpheed 3.5.1 (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, 5 Jun 2020 17:11:05 +0800 Bibo Mao wrote: > On MIPS system which has rixi hardware bit, page access bit is not > set in pgrot. For memory reading, there will be one page fault to > allocate physical page; however valid bit is not set, there will > be the second fast tlb-miss fault handling to set valid/access bit. > > This patch set page access/valid bit with pgrot if there is reading > access privilege. It will reduce one tlb-miss handling for memory > reading access. > > The valid/access bit will be cleared in order to track memory > accessing activity. If the page is accessed, tlb-miss fast handling > will set valid/access bit, pte_sw_mkyoung is not necessary in slow > page fault path. This patch removes pte_sw_mkyoung function which > is defined as empty function except MIPS system. > > ... > > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -2704,7 +2704,6 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf) > } > flush_cache_page(vma, vmf->address, pte_pfn(vmf->orig_pte)); > entry = mk_pte(new_page, vma->vm_page_prot); > - entry = pte_sw_mkyoung(entry); > entry = maybe_mkwrite(pte_mkdirty(entry), vma); > /* > * Clear the pte entry and flush it first, before updating the > @@ -3379,7 +3378,6 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf) > __SetPageUptodate(page); > > entry = mk_pte(page, vma->vm_page_prot); > - entry = pte_sw_mkyoung(entry); > if (vma->vm_flags & VM_WRITE) > entry = pte_mkwrite(pte_mkdirty(entry)); > > @@ -3662,7 +3660,6 @@ vm_fault_t alloc_set_pte(struct vm_fault *vmf, struct mem_cgroup *memcg, > > flush_icache_page(vma, page); > entry = mk_pte(page, vma->vm_page_prot); > - entry = pte_sw_mkyoung(entry); > if (write) > entry = maybe_mkwrite(pte_mkdirty(entry), vma); > /* copy-on-write page */ Only affects mips, so cheerily Acked-by: Andrew Morton