All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richardw.yang@linux.intel.com>
To: dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Wei Yang <richardw.yang@linux.intel.com>
Subject: [PATCH] x86/mm: fix return value of p[um]dp_set_access_flags
Date: Thu, 19 Sep 2019 16:25:49 +0800	[thread overview]
Message-ID: <20190919082549.3895-1-richardw.yang@linux.intel.com> (raw)

Function p[um]dp_set_access_flags is used with update_mmu_cache_p[um]d
and the return value from p[um]dp_set_access_flags indicates whether it
is necessary to do the cache update.

From current code logic, only when changed && dirty, related page table
entry would be updated. It is not necessary to update cache when the
real page table entry is not changed.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 arch/x86/mm/pgtable.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 44816ff6411f..ba910f8ab43a 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -509,9 +509,10 @@ int pmdp_set_access_flags(struct vm_area_struct *vma,
 		 * #PF is architecturally guaranteed to do that and in the
 		 * worst-case we'll generate a spurious fault.
 		 */
+		return true;
 	}
 
-	return changed;
+	return false;
 }
 
 int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address,
@@ -529,9 +530,10 @@ int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address,
 		 * #PF is architecturally guaranteed to do that and in the
 		 * worst-case we'll generate a spurious fault.
 		 */
+		return true;
 	}
 
-	return changed;
+	return false;
 }
 #endif
 
-- 
2.17.1


             reply	other threads:[~2019-09-19  8:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19  8:25 Wei Yang [this message]
2019-09-19 17:25 ` [PATCH] x86/mm: fix return value of p[um]dp_set_access_flags Dave Hansen
2019-09-20  2:18   ` Wei Yang
2019-09-20 16:16     ` Dave Hansen
2019-09-23  6:00       ` Wei Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190919082549.3895-1-richardw.yang@linux.intel.com \
    --to=richardw.yang@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.